]> git.eshelyaron.com Git - emacs.git/commitdiff
copyright.el: Avoid inadvertent point motion
authorJohan Bockgård <bojohan@gnu.org>
Sun, 19 Nov 2017 15:29:14 +0000 (16:29 +0100)
committerJohan Bockgård <bojohan@gnu.org>
Sun, 19 Nov 2017 15:29:14 +0000 (16:29 +0100)
* lisp/emacs-lisp/copyright.el (copyright-update-year): Enlarge the
scope of save-excursion. Reported in:
https://lists.gnu.org/archive/html/emacs-devel/2017-04/msg00271.html

lisp/emacs-lisp/copyright.el

index 11569e405634dc0ac9e2112b9b75095d0f9bca0e..25dc77c72581b9840982776a017ebf18f83a87a9 100644 (file)
@@ -186,9 +186,10 @@ skips to the end of all the years."
                   (substring copyright-current-year -2))
     (if (or noquery
            (save-window-excursion
-             (switch-to-buffer (current-buffer))
-             ;; Fixes some point-moving oddness (bug#2209).
+              ;; switch-to-buffer might move point when
+              ;; switch-to-buffer-preserve-window-point is non-nil.
              (save-excursion
+                (switch-to-buffer (current-buffer))
                (y-or-n-p (if replace
                              (concat "Replace copyright year(s) by "
                                      copyright-current-year "? ")