The Emacs Cat has a post on an Emacs feature that I use but had mostly forgotten about. It concerns the Emacs time stamp that lets you record in a file when it was last modified. I use it at the top of my init.el
to record when it was last changed.
It’s pretty simple to use. You just add a Time-stamp:
string somewhere in the first few lines of the file, do a tiny bit of Emacs configuration, and Emacs will add a time stamp whenever the file is saved. My impression is that it’s mostly used in init.el
files but it can be used in any file that you edit with Emacs. The Cat’s post give some examples of using it with an Elisp file, an Org file, and a C++ file.
Usually you have to have the Time-stamp:
as part of a comment but in some cases, as shown in the Org file, it can be part of the actual file data. Almost everything is configurable. You can specify how many lines from the top of the file to look for the Time-stamp
, and you can specify what the time stamp itself with look like.
Take a look at the Cat’s post or the documentation for the details