summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2004-10-12 16:05:55 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2004-10-12 16:05:55 +0000
commit3610d3c96272affc89eb64f50d801aeabf54dd34 (patch)
tree6ebfacd7a84033afb3417b969093e1acfce4469e /lisp/emacs-lisp
parent6fb690e298b9e1bbf6a767c5e7e830030ae30646 (diff)
downloademacs-3610d3c96272affc89eb64f50d801aeabf54dd34.tar.gz
emacs-3610d3c96272affc89eb64f50d801aeabf54dd34.tar.bz2
emacs-3610d3c96272affc89eb64f50d801aeabf54dd34.zip
(mark-sexp): Preserve direction when repeating.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/lisp.el8
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el
index 63d9f759ceb..87b3fcff96c 100644
--- a/lisp/emacs-lisp/lisp.el
+++ b/lisp/emacs-lisp/lisp.el
@@ -75,17 +75,19 @@ The place mark goes is the same place \\[forward-sexp] would
move to with the same argument.
If this command is repeated, it marks the next ARG sexps after the ones
already marked."
- (interactive "p")
+ (interactive "P")
(cond ((and (eq last-command this-command) (mark t))
+ (setq arg (if arg (prefix-numeric-value arg)
+ (if (> (mark) (point)) 1 -1)))
(set-mark
(save-excursion
(goto-char (mark))
- (forward-sexp (or arg 1))
+ (forward-sexp arg)
(point))))
(t
(push-mark
(save-excursion
- (forward-sexp (or arg 1))
+ (forward-sexp (prefix-numeric-value arg))
(point))
nil t))))