Add functions to narrow from or to point
This commit is contained in:
parent
cb4c371e5c
commit
b6d0f96a40
14
gists.org
14
gists.org
|
@ -713,6 +713,20 @@ Based on an answer at the [[https://emacs.stackexchange.com/a/77480/34645][Emacs
|
|||
(magit-diff-range range () (list (buffer-file-name)))))
|
||||
#+end_src
|
||||
|
||||
* Narrow from/to point :emacs:
|
||||
|
||||
#+begin_src elisp :tangle gists/narrow-from-to-point.el
|
||||
(defun my/narrow-from-point ()
|
||||
"Narrow the buffer from point to end of the (narrowed) buffer."
|
||||
(interactive)
|
||||
(narrow-to-region (point) (point-max)))
|
||||
|
||||
(defun my/narrow-to-point ()
|
||||
"Narrow the buffer the start of a (narrowed) buffer up to point."
|
||||
(interactive)
|
||||
(narrow-to-region (point-min) (point)))
|
||||
#+end_src
|
||||
|
||||
* Meta
|
||||
** License
|
||||
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
(defun my/narrow-from-point ()
|
||||
"Narrow the buffer from point to end of the (narrowed) buffer."
|
||||
(interactive)
|
||||
(narrow-to-region (point) (point-max)))
|
||||
|
||||
(defun my/narrow-to-point ()
|
||||
"Narrow the buffer the start of a (narrowed) buffer up to point."
|
||||
(interactive)
|
||||
(narrow-to-region (point-min) (point)))
|
Loading…
Reference in New Issue