mu4e-proc: only rename when maildir is set

The restores the old behavior (but with the fix for non-boolean
mu4e-change-filename-when-moving)

And some cleanups as suggested by Jonas Bernoulli.
This commit is contained in:
Dirk-Jan C. Binnema
2020-04-30 11:32:28 +03:00
parent 7c3673b3de
commit 7a47784d78

View File

@ -330,8 +330,8 @@ The result is delivered to the function registered as
`mu4e-compose-func'." `mu4e-compose-func'."
(mu4e~call-mu `(compose (mu4e~call-mu `(compose
:type ,type :type ,type
:decrypt ,(if decrypt t nil) :decrypt ,(and decrypt t)
:docid ,docid))) :docid ,docid)))
(defun mu4e~proc-contacts (personal after tstamp) (defun mu4e~proc-contacts (personal after tstamp)
"Ask for contacts with PERSONAL AFTER TSTAMP. "Ask for contacts with PERSONAL AFTER TSTAMP.
@ -340,9 +340,9 @@ response. If PERSONAL is non-nil, only get personal contacts, if
AFTER is non-nil, get only contacts seen AFTER (the time_t AFTER is non-nil, get only contacts seen AFTER (the time_t
value)." value)."
(mu4e~call-mu `(contacts (mu4e~call-mu `(contacts
:personal ,(if personal t nil) :personal ,(and personal t)
:after ,(or after nil) :after ,(or after nil)
:tstamp ,(or tstamp nil)))) :tstamp ,(or tstamp nil))))
(defun mu4e~proc-extract (action docid index decrypt (defun mu4e~proc-extract (action docid index decrypt
&optional path what param) &optional path what param)
@ -357,7 +357,7 @@ to a temporary file, then respond with
:action ,action :action ,action
:docid ,docid :docid ,docid
:index ,index :index ,index
:decrypt ,(if decrypt t nil) :decrypt ,(and decrypt t)
:path ,path :path ,path
:what ,what :what ,what
:param ,param))) :param ,param)))
@ -441,8 +441,8 @@ Returns either (:update ... ) or (:error ) sexp, which are handled my
:msgid ,(if (stringp docid-or-msgid) docid-or-msgid nil) :msgid ,(if (stringp docid-or-msgid) docid-or-msgid nil)
:flags ,(or flags nil) :flags ,(or flags nil)
:maildir ,(or maildir nil) :maildir ,(or maildir nil)
:rename ,(if mu4e-change-filenames-when-moving t nil) :rename ,(and maildir mu4e-change-filenames-when-moving t)
:no-view ,(if no-view t nil)))) :no-view ,(and no-view t))))
(defun mu4e~proc-ping (&optional queries) (defun mu4e~proc-ping (&optional queries)
"Sends a ping to the mu server, expecting a (:pong ...) in response. "Sends a ping to the mu server, expecting a (:pong ...) in response.
@ -474,8 +474,8 @@ registered as `mu4e-view-func'."
:docid ,(if (stringp docid-or-msgid) nil docid-or-msgid) :docid ,(if (stringp docid-or-msgid) nil docid-or-msgid)
:msgid ,(if (stringp docid-or-msgid) docid-or-msgid nil) :msgid ,(if (stringp docid-or-msgid) docid-or-msgid nil)
:extract-images ,(if images t nil) :extract-images ,(if images t nil)
:decrypt ,(if decrypt t nil) :decrypt ,(and decrypt t)
:verify ,(if verify t nil)))) :verify ,(and verify t))))
(defun mu4e~proc-view-path (path &optional images decrypt) (defun mu4e~proc-view-path (path &optional images decrypt)
"View message at PATH.. "View message at PATH..
@ -485,9 +485,9 @@ result will be delivered to the function registered as
`mu4e-view-func'. Optionally DECRYPT and VERIFY." `mu4e-view-func'. Optionally DECRYPT and VERIFY."
(mu4e~call-mu `(view (mu4e~call-mu `(view
:path ,path :path ,path
:extract-images ,(if images t nil) :extract-images ,(and images t)
:decrypt ,(if decrypt t nil) :decrypt ,(and decrypt t)
:verify ,(if verify t nil)))) :verify ,(and verify t))))
;;; _ ;;; _
(provide 'mu4e-proc) (provide 'mu4e-proc)