diff options
| author | Kelly Dean | 2015-02-18 07:41:10 +0000 |
|---|---|---|
| committer | Artur Malabarba | 2015-02-18 16:36:24 -0200 |
| commit | b1d6ddd44614c84746f5ee494e1f29cd9be8a2d8 (patch) | |
| tree | cfa469b9f2c7bf9783e7325b18e831c00ce470d9 | |
| parent | 56f5ea17f19bfb07e263dd2d59a3c61b652fcc3d (diff) | |
| download | emacs-b1d6ddd44614c84746f5ee494e1f29cd9be8a2d8.tar.gz emacs-b1d6ddd44614c84746f5ee494e1f29cd9be8a2d8.zip | |
Push mark before goto-char in jump-to-register and check-parens
* register.el (jump-to-register):
* emacs-lisp/lisp.el (check-parens):
Push mark before goto-char so user doesn't lose his previous place.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/emacs-lisp/lisp.el | 3 | ||||
| -rw-r--r-- | lisp/register.el | 3 |
3 files changed, 11 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a15295f4b4e..b71b55d8477 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,11 @@ | |||
| 1 | 2015-02-18 Kelly Dean <kelly@prtime.org> | 1 | 2015-02-18 Kelly Dean <kelly@prtime.org> |
| 2 | 2 | ||
| 3 | * register.el (jump-to-register): | ||
| 4 | * emacs-lisp/lisp.el (check-parens): | ||
| 5 | Push mark before goto-char so user doesn't lose his previous place. | ||
| 6 | |||
| 7 | 2015-02-18 Kelly Dean <kelly@prtime.org> | ||
| 8 | |||
| 3 | * rect.el (rectangle-mark-mode): | 9 | * rect.el (rectangle-mark-mode): |
| 4 | Suppress superfluous "Mark set" message from push-mark. | 10 | Suppress superfluous "Mark set" message from push-mark. |
| 5 | 11 | ||
diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index fb631a73da1..67d14872b3a 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el | |||
| @@ -714,7 +714,8 @@ character." | |||
| 714 | (condition-case data | 714 | (condition-case data |
| 715 | ;; Buffer can't have more than (point-max) sexps. | 715 | ;; Buffer can't have more than (point-max) sexps. |
| 716 | (scan-sexps (point-min) (point-max)) | 716 | (scan-sexps (point-min) (point-max)) |
| 717 | (scan-error (goto-char (nth 2 data)) | 717 | (scan-error (push-mark) |
| 718 | (goto-char (nth 2 data)) | ||
| 718 | ;; Could print (nth 1 data), which is either | 719 | ;; Could print (nth 1 data), which is either |
| 719 | ;; "Containing expression ends prematurely" or | 720 | ;; "Containing expression ends prematurely" or |
| 720 | ;; "Unbalanced parentheses", but those may not be so | 721 | ;; "Unbalanced parentheses", but those may not be so |
diff --git a/lisp/register.el b/lisp/register.el index 053657bd8cb..7afbc06c7fc 100644 --- a/lisp/register.el +++ b/lisp/register.el | |||
| @@ -254,6 +254,9 @@ Interactively, reads the register using `register-read-with-preview'." | |||
| 254 | (or (marker-buffer val) | 254 | (or (marker-buffer val) |
| 255 | (user-error "That register's buffer no longer exists")) | 255 | (user-error "That register's buffer no longer exists")) |
| 256 | (switch-to-buffer (marker-buffer val)) | 256 | (switch-to-buffer (marker-buffer val)) |
| 257 | (unless (or (= (point) (marker-position val)) | ||
| 258 | (eq last-command 'jump-to-register)) | ||
| 259 | (push-mark)) | ||
| 257 | (goto-char val)) | 260 | (goto-char val)) |
| 258 | ((and (consp val) (eq (car val) 'file)) | 261 | ((and (consp val) (eq (car val) 'file)) |
| 259 | (find-file (cdr val))) | 262 | (find-file (cdr val))) |