]> git.eshelyaron.com Git - emacs.git/commitdiff
Save window excursion before prompting in copyright-update-* (Bug#5394).
authorKevin Ryde <user42@zip.com.au>
Sat, 14 Aug 2010 23:30:51 +0000 (19:30 -0400)
committerChong Yidong <cyd@stupidchicken.com>
Sat, 14 Aug 2010 23:30:51 +0000 (19:30 -0400)
* emacs-lisp/copyright.el (copyright-update-year)
(copyright-update): Use save-window-excursion (Bug#5394).

lisp/ChangeLog
lisp/emacs-lisp/copyright.el

index 5eb3792ef6420eee0a915b6a91814fb0f9dc18fa..5fb589a73bbb4e7b6be14d10810944300f60fd80 100644 (file)
@@ -1,3 +1,8 @@
+2010-08-14  Kevin Ryde  <user42@zip.com.au>
+
+       * emacs-lisp/copyright.el (copyright-update-year)
+       (copyright-update): Use save-window-excursion (Bug#5394).
+
 2010-08-14  Tom Tromey  <tromey@redhat.com>
 
        * progmodes/etags.el (tags-file-name): Mark safe if stringp
index 6f7a43af844ef7174d2f185177d8229a665be636..43eb61b0bee183ac01586b91a53c6029479ae6ae 100644 (file)
@@ -158,13 +158,15 @@ When this is `function', only ask when called non-interactively."
     (unless (string= (buffer-substring (- (match-end 3) 2) (match-end 3))
                     (substring copyright-current-year -2))
       (if (or noquery
-             ;; Fixes some point-moving oddness (bug#2209).
-             (save-excursion
-               (y-or-n-p (if replace
-                             (concat "Replace copyright year(s) by "
-                                     copyright-current-year "? ")
-                           (concat "Add " copyright-current-year
-                                   " to copyright? ")))))
+             (save-window-excursion
+               (switch-to-buffer (current-buffer))
+               ;; Fixes some point-moving oddness (bug#2209).
+               (save-excursion
+                 (y-or-n-p (if replace
+                               (concat "Replace copyright year(s) by "
+                                       copyright-current-year "? ")
+                             (concat "Add " copyright-current-year
+                                     " to copyright? "))))))
          (if replace
              (replace-match copyright-current-year t t nil 3)
            (let ((size (save-excursion (skip-chars-backward "0-9"))))
@@ -224,8 +226,10 @@ version \\([0-9]+\\), or (at"
                   (string-to-number copyright-current-gpl-version))
               (or noquery
                    (save-match-data
-                     (y-or-n-p (format "Replace GPL version by %s? "
-                                       copyright-current-gpl-version))))
+                    (save-window-excursion
+                      (switch-to-buffer (current-buffer))
+                      (y-or-n-p (format "Replace GPL version by %s? "
+                                        copyright-current-gpl-version)))))
               (progn
                 (if (match-end 2)
                     ;; Esperanto bilingual comment in two-column.el