From: Johan Bockgård Date: Sun, 19 Nov 2017 15:29:14 +0000 (+0100) Subject: copyright.el: Avoid inadvertent point motion X-Git-Tag: emacs-27.0.90~6153 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=369c67a6bba8ec36d9b2f29413848f5898a9e1ea;p=emacs.git copyright.el: Avoid inadvertent point motion * 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 --- diff --git a/lisp/emacs-lisp/copyright.el b/lisp/emacs-lisp/copyright.el index 11569e40563..25dc77c7258 100644 --- a/lisp/emacs-lisp/copyright.el +++ b/lisp/emacs-lisp/copyright.el @@ -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 "? ")