I use GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.23) of 2020-11-09 (bundled with Ubuntu 21.10) with this init file:
% cat ~/.emacs.d/init-1.el (add-hook 'before-save-hook 'time-stamp) I have this file:
% cat good modification : (2022-01-21 17:08:15 WET) <!-- Local Variables: --> <!-- time-stamp-pattern: "-10/modification :[ \t]+\\\\?[\"(]+%:y-%02m-%02d %02H:%02M:%02S %Z\\\\?[\")]" --> <!-- End: --> (ended by an empty line, not visible here).
If you wish to reproduce my experiment, you may save time by creating ~/.emacs.d/init-1.el and good in your system and protecting good.
Then run this in Terminal:
cp good good1 chmod u+w good1 emacs -Q --load ~/.emacs.d/init-1.el good1& In Emacs, delete or remove the trailing new line or run M-x time-stamp, check that the timestamp updates. So far so good.
Capitalize the m in both instances of modification in the file good1.
time-stamp is now broken: editing and saving or M-x time-stamp won't ever update the timestamp again, unless you restore the initial ms or kill the buffer and reload the file.
Can you confirm my experiment?
Is it Emacs bug?