branch: externals/tex-parens
commit fdc4ff6939bd65dfef44b0b9acd591faf32b9e48
Author: Paul Nelson <ultr...@gmail.com>
Commit: Paul Nelson <ultr...@gmail.com>
Push mark in tex-parens-{beginning,end}-of-list
* tex-parens.el (tex-parens-beginning-of-list, tex-parens-end-of-list):
Push mark at original position before moving.
---
tex-parens.el | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/tex-parens.el b/tex-parens.el
index 3a7001a689..63e5c9a194 100644
--- a/tex-parens.el
+++ b/tex-parens.el
@@ -1063,22 +1063,31 @@ Otherwise, call `self-insert-command'."
(tex-parens-backward-down-list))
(defun tex-parens-beginning-of-list ()
- "Move to the beginning of the current balanced group."
+ "Move to the beginning of the current balanced group.
+Pushes a mark at the starting position."
(interactive)
- (let ((last (point)))
+ (let ((origin (point))
+ (last (point)))
(tex-parens-backward-sexp)
(while (< (point) last)
(setq last (point))
- (tex-parens-backward-sexp))))
+ (tex-parens-backward-sexp))
+ (unless (= origin (point))
+ (push-mark origin t))))
(defun tex-parens-end-of-list ()
- "Move to the end of the current balanced group."
+ "Move to the end of the current balanced group.
+Pushes a mark at the starting position."
(interactive)
- (let ((last (point)))
+ (let ((origin (point))
+ (last (point)))
(tex-parens-forward-sexp)
(while (> (point) last)
(setq last (point))
- (tex-parens-forward-sexp))))
+ (tex-parens-forward-sexp))
+ (unless (= origin (point))
+ (push-mark origin t))))
+
(defun tex-parens-kill-to-end-of-list ()
"Kill text between point and end of current list."