(copyright-update-year): Don't let y-or-n-p move point. (Bug#2209)

This commit is contained in:
Glenn Morris 2009-02-17 03:02:25 +00:00
parent 1640a85f9c
commit 4431546e80
2 changed files with 10 additions and 5 deletions

View file

@ -157,11 +157,13 @@ 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
(y-or-n-p (if replace
(concat "Replace copyright year(s) by "
copyright-current-year "? ")
(concat "Add " copyright-current-year
" to copyright? "))))
;; 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"))))