diff lisp/emacs-lisp/lisp.el @ 57457:8c6dae33cdc3

(mark-sexp): Preserve direction when repeating.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Tue, 12 Oct 2004 16:05:55 +0000
parents bca93997a4d7
children 2ee970dcd072 ff0e824afa37
line wrap: on
line diff
--- a/lisp/emacs-lisp/lisp.el	Tue Oct 12 15:47:32 2004 +0000
+++ b/lisp/emacs-lisp/lisp.el	Tue Oct 12 16:05:55 2004 +0000
@@ -75,17 +75,19 @@
 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))))