diff options
| author | Stefan Monnier | 2019-03-13 15:55:39 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2019-03-13 15:55:39 -0400 |
| commit | 7dda131ab02b36362ae63744db66413a9f1df58d (patch) | |
| tree | 41ddbd5c0052b56db9425a61d372f2cb621a032b | |
| parent | fd71d626dc0554bcb770dc4b97b06edcf42516fb (diff) | |
| download | emacs-7dda131ab02b36362ae63744db66413a9f1df58d.tar.gz emacs-7dda131ab02b36362ae63744db66413a9f1df58d.zip | |
* lisp/emacs-lisp/easy-mmode.el: Fix most obvious bug#34723
(easy-mmode-define-navigation): Don't scroll in the opposite direction of
the movement.
| -rw-r--r-- | lisp/emacs-lisp/easy-mmode.el | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index 0cb9a6fa122..8ac0a1d5938 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el | |||
| @@ -628,6 +628,7 @@ BODY is executed after moving to the destination location." | |||
| 628 | ,body | 628 | ,body |
| 629 | (when was-narrowed (funcall #',narrowfun))))))) | 629 | (when was-narrowed (funcall #',narrowfun))))))) |
| 630 | (unless name (setq name base-name)) | 630 | (unless name (setq name base-name)) |
| 631 | ;; FIXME: Move most of those functions's bodies to helper functions! | ||
| 631 | `(progn | 632 | `(progn |
| 632 | (defun ,next-sym (&optional count) | 633 | (defun ,next-sym (&optional count) |
| 633 | ,(format "Go to the next COUNT'th %s. | 634 | ,(format "Go to the next COUNT'th %s. |
| @@ -649,7 +650,11 @@ Interactively, COUNT is the prefix numeric argument, and defaults to 1." name) | |||
| 649 | `(re-search-forward ,re nil t 2))) | 650 | `(re-search-forward ,re nil t 2))) |
| 650 | (point-max)))) | 651 | (point-max)))) |
| 651 | (unless (pos-visible-in-window-p endpt nil t) | 652 | (unless (pos-visible-in-window-p endpt nil t) |
| 652 | (recenter '(0))))))) | 653 | (let ((ws (window-start))) |
| 654 | (recenter '(0)) | ||
| 655 | (if (< (window-start) ws) | ||
| 656 | ;; recenter scrolled in the wrong direction! | ||
| 657 | (set-window-start nil ws)))))))) | ||
| 653 | ,@body)) | 658 | ,@body)) |
| 654 | (put ',next-sym 'definition-name ',base) | 659 | (put ',next-sym 'definition-name ',base) |
| 655 | (defun ,prev-sym (&optional count) | 660 | (defun ,prev-sym (&optional count) |