Zettelkasten Forum

Sync Emacs org files and reload on external changes

edited April 2019 in Software & Gadgets

Haxx0red my Emacs to do what I always wanted it to do, and am so happy with the setup I want to share it with the 0.2% of readers who use Emacs :)

I did read Emacs org files on mobile devices using the beorg app but hesitated to modify them because of file/buffer content conflicts. Now I found out how to set up Emacs to sync two ways via Dropbox with virtually no conflicts.

  1. Auto-save org buffers regularly: (add-hook 'auto-save-hook 'org-save-all-org-buffers)
  2. Enable auto-revert-mode for buffers from files in your synced org directory. Create a .dir-locals.el in that directory with the following content to run a script when a file is opened from that dir (best trick ever!):

    ((nil . ((eval . (auto-revert-mode 1)))))

I didn't want to enable global-auto-revert-mode, and this limits reverting/reloading from disk to the synced files. Hooray!

I wrote this up in more detail on my blog:

-- Christian

Post edited by ctietze on

Author at Zettelkasten.de • https://christiantietze.de/

Sign In or Register to comment.