Hi all, this is just to properly end the thread [1], and ask whether I should open an issue, or add an annotation to the existing (but not exactly the same) issue #7179 [2], or what. Back in April I applied Johan Bockgård's suggestion and since then I haven't seen the reported problem again: >> Johan Bockgård writes: >> >>> >>> Does it work correctly if you change >>> >>> (switch-to-buffer (current-buffer)) >>> ;; Fixes some point-moving oddness (bug#2209). >>> (save-excursion >>> (y-or-n-p (if replace >>> >>> to >>> >>> (save-excursion >>> (switch-to-buffer (current-buffer)) >>> (y-or-n-p (if replace >>> >>> ? To summarize, I shuffled just a couple of lines: the attached `diff -u` does not make that clear, but hopefully the following `diff -u --ignore-space-change` gives a better idea since it ignores the indentation changes: --- copyright-orig.el 2017-10-31 18:54:20.957330092 +0100 +++ copyright.el 2017-10-31 18:55:11.624754452 +0100 @@ -181,19 +181,22 @@ ;; This uses the match-data from copyright-find-copyright/end. (goto-char (match-end 1)) (copyright-find-end) + (let ((copyright-end (point))) (setq copyright-current-year (format-time-string "%Y")) (unless (string= (buffer-substring (- (match-end 3) 2) (match-end 3)) (substring copyright-current-year -2)) (if (or noquery (save-window-excursion + (save-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? ")))))) + (progn + (goto-char copyright-end) (if replace (replace-match copyright-current-year t t nil 3) (let ((size (save-excursion (skip-chars-backward "0-9")))) @@ -218,7 +221,7 @@ (if (eq (char-after (+ (point) size -3)) ?') (insert ?'))) ;; Finally insert the new year. - (insert (substring copyright-current-year size))))))) + (insert (substring copyright-current-year size))))))))) ;;;###autoload (defun copyright-update (&optional arg interactivep) thanks&bye, lele. [1] http://lists.gnu.org/archive/html/emacs-devel/2017-04/msg00271.html [2] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=7179