summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorJohan Bockgård <bojohan@gnu.org>2017-11-19 16:29:14 +0100
committerJohan Bockgård <bojohan@gnu.org>2017-11-19 16:29:14 +0100
commit369c67a6bba8ec36d9b2f29413848f5898a9e1ea (patch)
treea3b758f09c7517d2203223b07e1945a54536910a /lisp/emacs-lisp
parentf41bcae3e55c4510e9f0f303962f04186f7ebdef (diff)
downloademacs-369c67a6bba8ec36d9b2f29413848f5898a9e1ea.tar.gz
emacs-369c67a6bba8ec36d9b2f29413848f5898a9e1ea.tar.bz2
emacs-369c67a6bba8ec36d9b2f29413848f5898a9e1ea.zip
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
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/copyright.el5
1 files changed, 3 insertions, 2 deletions
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 "? ")