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:
TEC
2021-06-19 03:20:50 +08:00
parent bfa888ced3
commit 3778862a79

View File

@ -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