summaryrefslogtreecommitdiffstatshomepage
path: root/nroam.el
diff options
context:
space:
mode:
authorGravatar Damien Cassou2021-03-19 11:21:37 +0100
committerGravatar Damien Cassou2021-03-19 11:21:37 +0100
commitd7de243272f3f2bf7177ad81c5137b4ad97c15dd (patch)
tree894fae73bd2078b5a719a85702f11d2012ebf6e8 /nroam.el
parente85f625da11dfd0bd24ad6a1dc37db80c5ca5a23 (diff)
downloadnroam-d7de243272f3f2bf7177ad81c5137b4ad97c15dd.tar.gz
nroam-d7de243272f3f2bf7177ad81c5137b4ad97c15dd.zip
Add nroam-goto
* nroam.el (nroam-goto): New function. * tests/nroam-test.el: New test for the function.
Diffstat (limited to 'nroam.el')
-rw-r--r--nroam.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/nroam.el b/nroam.el
index 6900d08..d2982aa 100644
--- a/nroam.el
+++ b/nroam.el
@@ -142,6 +142,12 @@ Make the region inserted by BODY read-only, and marked with
(and (markerp nroam-start-marker)
(marker-position nroam-start-marker)))
+(defun nroam-goto ()
+ "Move point to the beginning of nroam sections if any."
+ (interactive)
+ (when (nroam--sections-inserted-p)
+ (setf (point) (marker-position nroam-start-marker))))
+
(defun nroam--prune ()
"Remove nroam sections from the current buffer."
(let ((inhibit-read-only t))