mu4e-server: fix some flycheck warnings

This commit is contained in:
Dirk-Jan C. Binnema
2024-10-06 10:43:30 +03:00
parent e36d1554de
commit 0da33b3d7f

View File

@ -29,7 +29,7 @@
;;; Configuration ;;; Configuration
(defcustom mu4e-mu-home nil (defcustom mu4e-mu-home nil
"Location of an alternate mu home dir. "Location of an alternate mu home directory.
If not set, use the defaults, based on the XDG Base Directory If not set, use the defaults, based on the XDG Base Directory
Specification. Specification.
@ -257,15 +257,18 @@ removed."
(defun mu4e--server-plist-get (plist key) (defun mu4e--server-plist-get (plist key)
"Like `plist-get' but load data from file if it is a string. "Like `plist-get' but load data from file if it is a string.
I.e. (mu4e--server-plist-get (:foo bar) :foo) PLIST is a property-list, and KEY is the the key to search for.
E.g., (mu4e--server-plist-get (:foo bar) :foo)
=> bar => bar
but but
(mu4e--server-plist-get (:foo \"/tmp/data.eld\") :foo) (mu4e--server-plist-get (:foo \"/tmp/data.eld\") :foo)
=> evaluates the contents of /tmp/data.eld => evaluates the contents of /tmp/data.eld
(and deletes the file afterward). (and deletes the file afterward).
This for the few sexps we get from the mu server that support this This for the few sexps we get from the mu server that support
(headers, contacts, maildirs)." this -- headers, contacts, maildirs."
;; XXX: perhaps re-use the same buffer? ;; XXX: perhaps re-use the same buffer?
(let ((val (plist-get plist key))) (let ((val (plist-get plist key)))
(if (stringp val) (if (stringp val)
@ -436,6 +439,7 @@ As per issue #2198."
,(when mu4e-mu-home (format "--muhome=%s" mu4e-mu-home))))) ,(when mu4e-mu-home (format "--muhome=%s" mu4e-mu-home)))))
(defun mu4e--version-check () (defun mu4e--version-check ()
"Verify that the versions for mu4e and mu are the same."
;; sanity-check 1 ;; sanity-check 1
(let ((default-directory temporary-file-directory)) ;;ensure it's local. (let ((default-directory temporary-file-directory)) ;;ensure it's local.
(unless (and mu4e-mu-binary (file-executable-p mu4e-mu-binary)) (unless (and mu4e-mu-binary (file-executable-p mu4e-mu-binary))
@ -531,12 +535,12 @@ You cannot run the repl when mu4e is running (or vice-versa)."
((eq code 0) ((eq code 0)
(message nil)) ;; don't do anything (message nil)) ;; don't do anything
((eq code 11) ((eq code 11)
(error "schema mismatch; please re-init mu from command-line")) (error "Schema mismatch; please re-init mu from command-line"))
((eq code 19) ((eq code 19)
(error "mu database is locked by another process")) (error "Mu database is locked by another process"))
(t (error "mu server process ended with exit code %d" code)))) (t (error "Mu server process ended with exit code %d" code))))
(t (t
(error "something bad happened to the mu server process"))))) (error "Something bad happened to the mu server process")))))
(defun mu4e--server-call-mu (form) (defun mu4e--server-call-mu (form)
"Call the mu server with some command FORM." "Call the mu server with some command FORM."
@ -609,7 +613,7 @@ or an error."
(defun mu4e--server-index (&optional cleanup lazy-check) (defun mu4e--server-index (&optional cleanup lazy-check)
"Index messages. "Index messages.
If CLEANUP is non-nil, remove messages which are in the database If CLEANUP is non-nil, remove messages which are in the database
but no longer in the filesystem. If LAZY-CHECK is non-nil, only but no longer in the file system. If LAZY-CHECK is non-nil, only
consider messages for which the time stamp (ctime) of the consider messages for which the time stamp (ctime) of the
directory they reside in has not changed since the previous directory they reside in has not changed since the previous
indexing run. This is much faster than the non-lazy check, but indexing run. This is much faster than the non-lazy check, but
@ -622,7 +626,7 @@ the directory time stamp."
(setq mu4e--server-indexing t)) ;; remember we're indexing. (setq mu4e--server-indexing t)) ;; remember we're indexing.
(defun mu4e--server-mkdir (path &optional update) (defun mu4e--server-mkdir (path &optional update)
"Create a new maildir-directory at filesystem PATH. "Create a new maildir-directory at file system PATH.
When UPDATE is non-nil, send a update when completed. When UPDATE is non-nil, send a update when completed.
PATH must be below the root-maildir." PATH must be below the root-maildir."
;; handle maildir cache ;; handle maildir cache
@ -693,7 +697,7 @@ read/unread status are returned in the pong-response."
(mu4e--server-call-mu `(queries :queries ,queries))) (mu4e--server-call-mu `(queries :queries ,queries)))
(defun mu4e--server-remove (docid-or-path) (defun mu4e--server-remove (docid-or-path)
"Remove message with either DOCID or PATH. "Remove message with either DOCID-OR-PATH.
The results are reported through either (:update ... ) The results are reported through either (:update ... )
or (:error) sexps." or (:error) sexps."
(if (stringp docid-or-path) (if (stringp docid-or-path)