From 3778862a798306d14be27ef357db09059e545e4f Mon Sep 17 00:00:00 2001 From: TEC Date: Sat, 19 Jun 2021 03:20:50 +0800 Subject: [PATCH] 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. --- modules/email/mu4e/autoload/mu-lock.el | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/email/mu4e/autoload/mu-lock.el b/modules/email/mu4e/autoload/mu-lock.el index 421952a49..c34329d6a 100644 --- a/modules/email/mu4e/autoload/mu-lock.el +++ b/modules/email/mu4e/autoload/mu-lock.el @@ -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