emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r101085: Save window excursion before


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r101085: Save window excursion before prompting in copyright-update-* (Bug#5394).
Date: Sat, 14 Aug 2010 19:30:51 -0400
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 101085
author: Kevin Ryde <address@hidden>
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Sat 2010-08-14 19:30:51 -0400
message:
  Save window excursion before prompting in copyright-update-* (Bug#5394).
  
  * emacs-lisp/copyright.el (copyright-update-year)
  (copyright-update): Use save-window-excursion (Bug#5394).
modified:
  lisp/ChangeLog
  lisp/emacs-lisp/copyright.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-08-14 23:01:42 +0000
+++ b/lisp/ChangeLog    2010-08-14 23:30:51 +0000
@@ -1,3 +1,8 @@
+2010-08-14  Kevin Ryde  <address@hidden>
+
+       * emacs-lisp/copyright.el (copyright-update-year)
+       (copyright-update): Use save-window-excursion (Bug#5394).
+
 2010-08-14  Tom Tromey  <address@hidden>
 
        * progmodes/etags.el (tags-file-name): Mark safe if stringp

=== modified file 'lisp/emacs-lisp/copyright.el'
--- a/lisp/emacs-lisp/copyright.el      2010-01-13 08:35:10 +0000
+++ b/lisp/emacs-lisp/copyright.el      2010-08-14 23:30:51 +0000
@@ -158,13 +158,15 @@
     (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 @@
                   (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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]