summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDirk-Jan C. Binnema <djcb@djcbsoftware.nl>2022-08-02 07:21:15 +0300
committerDirk-Jan C. Binnema <djcb@djcbsoftware.nl>2022-08-07 11:47:06 +0300
commit8a6da6a869f1527b14ca98909f42c67a102d5a77 (patch)
tree8fea0a492597569a18dfc12411677ebc79d7d5ff
parenta4b8471ba6b370a9b779b4e20e485dbacf5d1d22 (diff)
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.
-rw-r--r--mu4e/mu4e-server.el34
1 files changed, 22 insertions, 12 deletions
diff --git a/mu4e/mu4e-server.el b/mu4e/mu4e-server.el
index 29c5858..73d74d7 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 <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)