Push mark before jumping

This commit is contained in:
Greg Sexton 2016-09-24 10:13:03 +01:00
parent b571187d68
commit fdd8fc306f

View File

@ -687,6 +687,7 @@ is in a fold, move to the beginning of the fold that POINT is
in." in."
(interactive (list (current-buffer) (point))) (interactive (list (current-buffer) (point)))
(-when-let (tree (origami-get-fold-tree buffer)) (-when-let (tree (origami-get-fold-tree buffer))
(push-mark)
(-> tree (-> tree
(origami-fold-preorder-reduce (lambda (state n) (origami-fold-preorder-reduce (lambda (state n)
(cons (origami-fold-beg n) state)) nil) (cons (origami-fold-beg n) state)) nil)
@ -699,6 +700,7 @@ in."
a fold, move to the end of the fold that POINT is in." a fold, move to the end of the fold that POINT is in."
(interactive (list (current-buffer) (point))) (interactive (list (current-buffer) (point)))
(-when-let (tree (origami-get-fold-tree buffer)) (-when-let (tree (origami-get-fold-tree buffer))
(push-mark)
(-> tree (-> tree
(origami-fold-postorder-reduce (lambda (state n) (origami-fold-postorder-reduce (lambda (state n)
(cons (origami-fold-end n) state)) nil) (cons (origami-fold-end n) state)) nil)
@ -710,6 +712,7 @@ a fold, move to the end of the fold that POINT is in."
after POINT." after POINT."
(interactive (list (current-buffer) (point))) (interactive (list (current-buffer) (point)))
(-when-let (tree (origami-get-fold-tree buffer)) (-when-let (tree (origami-get-fold-tree buffer))
(push-mark)
(-> tree (-> tree
(origami-fold-preorder-reduce (lambda (state n) (origami-fold-preorder-reduce (lambda (state n)
(cons (origami-fold-beg n) state)) nil) (cons (origami-fold-beg n) state)) nil)
@ -722,6 +725,7 @@ that is a sibling of the fold the point is currently in."
(interactive (list (current-buffer) (point))) (interactive (list (current-buffer) (point)))
(-when-let (tree (origami-get-fold-tree buffer)) (-when-let (tree (origami-get-fold-tree buffer))
(-when-let (path (origami-fold-find-path-containing tree point)) (-when-let (path (origami-fold-find-path-containing tree point))
(push-mark)
(-when-let (c (-> (origami-fold-next-sibling (origami-fold-children (-when-let (c (-> (origami-fold-next-sibling (origami-fold-children
(origami-fold-parent path)) (origami-fold-parent path))
(-last-item path)) (-last-item path))
@ -734,6 +738,7 @@ that is a sibling of the fold the point is currently in."
(interactive (list (current-buffer) (point))) (interactive (list (current-buffer) (point)))
(-when-let (tree (origami-get-fold-tree buffer)) (-when-let (tree (origami-get-fold-tree buffer))
(-when-let (path (origami-fold-find-path-containing tree point)) (-when-let (path (origami-fold-find-path-containing tree point))
(push-mark)
(-when-let (c (-> (origami-fold-prev-sibling (origami-fold-children (-when-let (c (-> (origami-fold-prev-sibling (origami-fold-children
(origami-fold-parent path)) (origami-fold-parent path))
(-last-item path)) (-last-item path))