mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
mu4e: lock file may not be created by file watcher
On some OS implementations (e.g. BSD uses kqueue), `file-notify-add-watch' might not create the file if it doesn't exist. This patch fixes that error. Arguably, emacs lisp should ensure the same behaviour exists across each implementation.
This commit is contained in:
@ -52,6 +52,7 @@ Else, write to this process' PID to the lock file"
|
||||
(user-error "Unfortunately another Emacs is already doing stuff with Mu4e, and you can only have one at a time")
|
||||
(write-region (number-to-string (emacs-pid)) nil +mu4e-lock-file)
|
||||
(delete-file +mu4e-lock-request-file)
|
||||
(call-process "touch" nil nil nil +mu4e-lock-request-file)
|
||||
(funcall orig-fun callback)
|
||||
(setq +mu4e-lock--request-watcher
|
||||
(file-notify-add-watch +mu4e-lock-request-file
|
||||
|
Reference in New Issue
Block a user