wiki/2020-09-16-23-09-01.org
Gabriel Arazas aea7015cd5 Update the files for convention
Apparently, the convention (at least starting from 2018) is to make the
keywords and block names to be in lowercase as stated from one of the
following discussions at
https://orgmode.org/list/87tuuw3n15.fsf@nicolasgoaziou.fr/.

The files was updated with a one liner of shell. However, this is Emacs
and org-mode does have an API to let you do stuff in your config and
interact with the documents internally so it is not an elegant solution
in any way.
2021-04-02 00:08:15 +08:00

2.5 KiB

Use timestamps for effectively future-proofing your stuff

One of the simplest ways to future-proof your documents with File metadata is to create a timestamp. Specifically, two timestamps: one when it's created and one when it was last modified which will be continuously updated each time we modify the file. This lets you quickly evaluate whether the information is up-to-date. It also lets you Maintain your own digital library with relative ease if your focus is on up-to-date information.

In order to make updating the modification timestamp worth not to make it a chore, it is best to automate that task. 1

Different files may be applied differently as long as we can create a unified interface to search through them all. (See File metadata for more information about it.)

Here's a special example with Org-mode documents:

Thankfully, Emacs has a time stamp feature that abstracts that for us. We can then attach the timestamp update with a hook that will occur before saving the file and voila! Automated timestamp for our text documents.

Here's my (Doom Emacs) specific config as of 2020-09-17 for future references:

(after org!
  (setq
    ; Set a custom time-stamp pattern.
    ; Even though, it's not recommended, most of the time,
    time-stamp-start "DATE_MODIFIED:[ 	]+\\\\?[\"<]+"))

; Modify the time-stamp with each save.
(setq time-stamp-format "%Y-%02m-%02d %02H:%02M:%02S%:z")
(add-hook 'before-save-hook 'time-stamp)

This should be easily replicated to other editors. All you need from a text editor is the hooks and a search-and-replace feature 2.

For binary files, we can set the timestamp with a metadata writer then use a filesystem watcher and configure it to execute every time the file changes.


1

Besides, it is only a chore for the first time versus $x$ amount of times.

2

Maybe an option limiting the lines to be searched to prevent large search sessions as well.