A tip how to preserve tags when editing text documents externally with Emacs

Devonthink is pretty decent for searching and managing text documents, Emacs is great for editing text documents.

So if your are an Emacs fan it’s a good idea to set Emacs as your preferred editor for text documents (then in DEVONthink accessible via shift-cmd-OOpen with (default)”).

However one problem which bugged me for every is that the (Finder) tags of the files you edit with Emacs are normally lost on save. Here a trick how to preserve Finder tags:

Set in Emacs the variable backup-by-copying to t and Emacs will create backups by copying (instead of renaming) and therefore write the new content to the same file (i.e. inode) as before. This will keep the Finder tags intact and keep them in DEVONthink too!

Life is again a bit better!

2 Likes

Thank you for the great tip!