diff options
| author | Stefan Monnier | 2004-10-12 16:05:55 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2004-10-12 16:05:55 +0000 |
| commit | 3610d3c96272affc89eb64f50d801aeabf54dd34 (patch) | |
| tree | 6ebfacd7a84033afb3417b969093e1acfce4469e | |
| parent | 6fb690e298b9e1bbf6a767c5e7e830030ae30646 (diff) | |
| download | emacs-3610d3c96272affc89eb64f50d801aeabf54dd34.tar.gz emacs-3610d3c96272affc89eb64f50d801aeabf54dd34.zip | |
(mark-sexp): Preserve direction when repeating.
| -rw-r--r-- | lisp/emacs-lisp/lisp.el | 8 |
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 | |||
| 75 | move to with the same argument. | 75 | move to with the same argument. |
| 76 | If this command is repeated, it marks the next ARG sexps after the ones | 76 | If this command is repeated, it marks the next ARG sexps after the ones |
| 77 | already marked." | 77 | already marked." |
| 78 | (interactive "p") | 78 | (interactive "P") |
| 79 | (cond ((and (eq last-command this-command) (mark t)) | 79 | (cond ((and (eq last-command this-command) (mark t)) |
| 80 | (setq arg (if arg (prefix-numeric-value arg) | ||
| 81 | (if (> (mark) (point)) 1 -1))) | ||
| 80 | (set-mark | 82 | (set-mark |
| 81 | (save-excursion | 83 | (save-excursion |
| 82 | (goto-char (mark)) | 84 | (goto-char (mark)) |
| 83 | (forward-sexp (or arg 1)) | 85 | (forward-sexp arg) |
| 84 | (point)))) | 86 | (point)))) |
| 85 | (t | 87 | (t |
| 86 | (push-mark | 88 | (push-mark |
| 87 | (save-excursion | 89 | (save-excursion |
| 88 | (forward-sexp (or arg 1)) | 90 | (forward-sexp (prefix-numeric-value arg)) |
| 89 | (point)) | 91 | (point)) |
| 90 | nil t)))) | 92 | nil t)))) |
| 91 | 93 | ||