Here is a recipe for reproducing the bug in emacs-26.0.90 -Q: Create a directory /tmp/test-copyright Copy the attached file_1.c-save to that directory Start emacs -Q (require 'copyright) (add-hook 'before-save-hook 'copyright-update) (find-file "/tmp/test-copyright/file_1.c") C-x 2 C-x o C-end ;; insert '// changed line' C-x b *Messages* C-x o C-x b *scratch* C-x o M-x save-some-buffers ! y C-x b file_1.c This shows the bug: ', 2018' was inserted on the last line in file_1.c, not the copyright line. The fix in the patch given above is "include 'switch-to-buffer' in the 'save-excursion'"; it is not sufficient for this test case, although I assume it is sufficient in other cases. A discussion on emacs-devel starting at https://lists.gnu.org/archive/html/emacs-devel/2018-01/msg00024.html includes the suggestion to delete 'save-window-excursion'; that does not fix this test case, and in addition it causes file_1.c to be not displayed while asking about updating the copyright. The root cause of the bug is that emacs saves a point for each buffer in each window; when file_1.c is displayed in the lower window, point is restored to where it was last displayed in that window; on the last line. The attached patch copyright.diff fixes this test case in a minimal way, by saving the copyright-end point, and restoring it after displaying the buffer. It also includes 'switch-to-buffer' in the 'save-exursion' to address the other use cases. The email thread mentioned above also discusses trying to preserve frames as well, since switch-to-buffer can pop up a new frame with certain user settings. This patch does not address that, since it is not a regression in emacs 26. A more thorough redesign of this function, to be cleaner and address restoring frames, is left for emacs 27. -- -- Stephe