|
From: | Lluís Vilanova |
Subject: | bug#25125: 25.1; copyright-fix-years pollutes undo history |
Date: | Sat, 27 Jul 2019 20:35:48 +0200 |
Lluís Vilanova <vilanova@ac.upc.edu> writes:
> I have setup `copyright-update' to run every time I save a file in prog-mode:
>
> (add-hook 'prog-mode-hook
> (lambda ()
> (add-hook 'before-save-hook
> (lambda ()
> (save-excursion (copyright-fix-years))))))
>
> Every time it runs in a file that has a copyright, a change is recorded into the
> undo history, even if the function performed no changes at all (i.e., the
> copyright years were already correct).
>
> This makes it quite annoying to go back my modifications history,
> since it keeps jumping up and down between the header and the actual
> code.
(I'm going through older Emacs bug reports that have received no
response.)
I tried testing this by just saying `M-x copyright-fix-years' in a file
where it doesn't do any changes (like lisp/emacs-lisp/edebug.el). It
didn't record anything in the undo history, so I'm unable to reproduce
this bug in Emacs 27. Are you still seeing this?
[Prev in Thread] | Current Thread | [Next in Thread] |