Home / GitHub Page

Note for Emacs users


#1

Emacs users that want to use Joplin (desktop) “Edit in external editor” feature may run into the situation that, when the note is saved in Emacs, it is not updated in Joplin.
This will happen when you use the emacsclient program with a running emacs server, and Emacs is configured to create backup files (files with the same name as the original but with a ~ appended), which is enabled by default.
In this case, Emacs will rename the original file to the new name, and create a new file. Since Joplin is watching the original file for modifications, it will not detect the changes.
Only when Joplin is restarted it will pick up the modified contents.

A solution to this is to either permanently disable creating backup files (not advised) or to force backup files being made by copying their contents in a new file, while Emacs continues editing the original file.

The most elegant solution is to enforce this behaviour only when editing via the emacs server. You can do this by adding the following lines to your .emacs:

  (custom-set-variables
    '(server-switch-hook
      '((lambda nil
         (let (server-buf)
           (setq backup-by-copying t)
           ))))
  )

For more information, please see https://www.emacswiki.org/emacs/EmacsClient.