From 8a6da6a869f1527b14ca98909f42c67a102d5a77 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Tue, 2 Aug 2022 07:21:15 +0300 Subject: [PATCH] mu4e: be more precise about non-nil in server As seen in #2310, we should test for non-nil for some parameters rather then expect them to be literally nil or t. Also update some docstrings. --- mu4e/mu4e-server.el | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/mu4e/mu4e-server.el b/mu4e/mu4e-server.el index 29c58581..73d74d7a 100644 --- a/mu4e/mu4e-server.el +++ b/mu4e/mu4e-server.el @@ -491,16 +491,26 @@ or an error." (mu4e--server-call-mu `(find :query ,query - :threads ,threads + :threads ,(and threads t) :sortfield ,sortfield :descending ,(if (eq sortdir 'descending) t nil) :maxnum ,maxnum - :skip-dups ,skip-dups - :include-related ,include-related))) + :skip-dups ,(and skip-dups t) + :include-related ,(and include-related t)))) (defun mu4e--server-index (&optional cleanup lazy-check) - "Index messages with possible CLEANUP and LAZY-CHECK." - (mu4e--server-call-mu `(index :cleanup ,cleanup :lazy-check ,lazy-check))) + "Index messages. +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 +consider messages for which the time stamp (ctime) of the +directory they reside in has not changed since the previous +indexing run. This is much faster than the non-lazy check, but +won't update messages that have change (rather than having been +added or removed), since merely editing a message does not update +the directory time stamp." + (mu4e--server-call-mu + `(index :cleanup ,(and cleanup t) + :lazy-check ,(and lazy-check t)))) (defun mu4e--server-mkdir (path) "Create a new maildir-directory at filesystem PATH." @@ -573,19 +583,19 @@ If this works, we will receive (:info add :path :docid (mu4e--server-call-mu `(sent :path ,path))) (defun mu4e--server-view (docid-or-msgid &optional mark-as-read) - "Get a message DOCID-OR-MSGID. + "View a message referred to by DOCID-OR-MSGID. Optionally, if MARK-AS-READ is non-nil, the backend marks the -message as read before returning, if it was not already unread. -The result will be delivered to the function registered as -`mu4e-view-func'." +message as \"read\" before returning, if not already. The result +will be delivered to the function registered as `mu4e-view-func'." (mu4e--server-call-mu `(view :docid ,(if (stringp docid-or-msgid) nil docid-or-msgid) :msgid ,(if (stringp docid-or-msgid) docid-or-msgid nil) - :mark-as-read ,mark-as-read + :mark-as-read ,(and mark-as-read t) ;; when moving (due to mark-as-read), change filenames - ;; if so configured. - :rename ,mu4e-change-filenames-when-moving))) + ;; if so configured. Note: currently this *ignored* + ;; because mbsync seems to get confused. + :rename ,(and mu4e-change-filenames-when-moving t)))) (provide 'mu4e-server)