mu4e: remove maildir arg from proc-add/proc-sent calls
The server doesn't want that parameter anymore, so we can simplify things a bit.
This commit is contained in:
@ -280,7 +280,7 @@ If needed, set the Fcc header, and register the handler function."
|
|||||||
(unless (file-exists-p mdir-path)
|
(unless (file-exists-p mdir-path)
|
||||||
(mu4e~proc-mkdir mdir-path)))
|
(mu4e~proc-mkdir mdir-path)))
|
||||||
(write-file file) ;; writing maildirs files is easy
|
(write-file file) ;; writing maildirs files is easy
|
||||||
(mu4e~proc-add file (or maildir "/")))))))) ;; update the database
|
(mu4e~proc-add file))))))) ;; update the database
|
||||||
|
|
||||||
(defvar mu4e-compose-hidden-headers
|
(defvar mu4e-compose-hidden-headers
|
||||||
`("^References:" "^Face:" "^X-Face:"
|
`("^References:" "^Face:" "^X-Face:"
|
||||||
@ -319,7 +319,7 @@ Message-ID."
|
|||||||
(set-buffer-modified-p nil)
|
(set-buffer-modified-p nil)
|
||||||
(mu4e-message "Saved (%d lines)" (count-lines (point-min) (point-max)))
|
(mu4e-message "Saved (%d lines)" (count-lines (point-min) (point-max)))
|
||||||
;; update the file on disk -- ie., without the separator
|
;; update the file on disk -- ie., without the separator
|
||||||
(mu4e~proc-add (buffer-file-name) mu4e~draft-drafts-folder))) nil t))
|
(mu4e~proc-add (buffer-file-name)))) nil t))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; address completion; inspired by org-contacts.el and
|
;; address completion; inspired by org-contacts.el and
|
||||||
@ -524,7 +524,7 @@ buffers; lets remap its faces so it uses the ones for mu4e."
|
|||||||
(add-hook 'message-sent-hook
|
(add-hook 'message-sent-hook
|
||||||
(lambda () ;; mu4e~compose-mark-after-sending
|
(lambda () ;; mu4e~compose-mark-after-sending
|
||||||
(setq mu4e-sent-func 'mu4e-sent-handler)
|
(setq mu4e-sent-func 'mu4e-sent-handler)
|
||||||
(mu4e~proc-sent (buffer-file-name) mu4e~draft-drafts-folder)) nil t))
|
(mu4e~proc-sent (buffer-file-name))) nil t))
|
||||||
;; mark these two hooks as permanent-local, so they'll survive mode-changes
|
;; mark these two hooks as permanent-local, so they'll survive mode-changes
|
||||||
;; (put 'mu4e~compose-save-before-sending 'permanent-local-hook t)
|
;; (put 'mu4e~compose-save-before-sending 'permanent-local-hook t)
|
||||||
(put 'mu4e~compose-mark-after-sending 'permanent-local-hook t))
|
(put 'mu4e~compose-mark-after-sending 'permanent-local-hook t))
|
||||||
|
|||||||
@ -319,6 +319,54 @@ Start the process if needed."
|
|||||||
`(:msgid ,(mu4e~escape docid-or-msgid))
|
`(:msgid ,(mu4e~escape docid-or-msgid))
|
||||||
`(:docid ,docid-or-msgid)))
|
`(:docid ,docid-or-msgid)))
|
||||||
|
|
||||||
|
(defun mu4e~proc-add (path)
|
||||||
|
"Add the message at PATH to the database.
|
||||||
|
On success, we receive `'(:info add :path <path> :docid <docid>)'
|
||||||
|
as well as `'(:update <msg-sexp>)`'; otherwise, we receive an error."
|
||||||
|
(mu4e~call-mu `(add :path ,path)))
|
||||||
|
|
||||||
|
(defun mu4e~proc-compose (type decrypt &optional docid)
|
||||||
|
"Compose a message of TYPE, DECRYPT it and use DOCID.
|
||||||
|
TYPE is a symbol, either `forward', `reply', `edit', `resend' or
|
||||||
|
`new', based on an original message (ie, replying to, forwarding,
|
||||||
|
editing, resending) with DOCID or nil for type `new'.
|
||||||
|
|
||||||
|
The result is delivered to the function registered as
|
||||||
|
`mu4e-compose-func'."
|
||||||
|
(mu4e~call-mu `(compose
|
||||||
|
:type ,type
|
||||||
|
:decrypt ,decrypt
|
||||||
|
:docid ,docid)))
|
||||||
|
|
||||||
|
(defun mu4e~proc-contacts (personal after tstamp)
|
||||||
|
"Ask for contacts with PERSONAL AFTER TSTAMP.
|
||||||
|
S-expression (:contacts (<list>) :tstamp \"<tstamp>\") is expected in
|
||||||
|
response. If PERSONAL is non-nil, only get personal contacts, if
|
||||||
|
AFTER is non-nil, get only contacts seen AFTER (the time_t
|
||||||
|
value)."
|
||||||
|
(mu4e~call-mu `(contacts
|
||||||
|
:personal ,personal
|
||||||
|
:after ,(or after nil)
|
||||||
|
:tstamp ,(or tstamp nil))))
|
||||||
|
|
||||||
|
(defun mu4e~proc-extract (action docid index decrypt
|
||||||
|
&optional path what param)
|
||||||
|
"Perform ACTION on part with DOCID INDEX DECRYPT PATH WHAT PARAM.
|
||||||
|
Use a message with DOCID and perform ACTION on it (as symbol,
|
||||||
|
either `save', `open', `temp') which mean: * save: save the part
|
||||||
|
to PATH (a path) (non-optional for save)$ * open: open the part
|
||||||
|
with the default application registered for doing so * temp: save
|
||||||
|
to a temporary file, then respond with
|
||||||
|
(:temp <path> :what <what> :param <param>)."
|
||||||
|
(mu4e~call-mu `(extract
|
||||||
|
:action ,action
|
||||||
|
:docid ,docid
|
||||||
|
:index ,index
|
||||||
|
:decrypt ,decrypt
|
||||||
|
:path ,path
|
||||||
|
:what ,what
|
||||||
|
:param ,param)))
|
||||||
|
|
||||||
(defun mu4e~proc-find (query threads sortfield sortdir maxnum skip-dups
|
(defun mu4e~proc-find (query threads sortfield sortdir maxnum skip-dups
|
||||||
include-related)
|
include-related)
|
||||||
"Run QUERY with THREADS SORTFIELD SORTDIR MAXNUM SKIP-DUPS INCLUDE-RELATED.
|
"Run QUERY with THREADS SORTFIELD SORTDIR MAXNUM SKIP-DUPS INCLUDE-RELATED.
|
||||||
@ -345,6 +393,23 @@ or an error."
|
|||||||
:skip-dups ,skip-dups
|
:skip-dups ,skip-dups
|
||||||
:include-related ,include-related)))
|
:include-related ,include-related)))
|
||||||
|
|
||||||
|
(defun mu4e~proc-index (path my-addresses cleanup lazy-check)
|
||||||
|
"Index messages on PATH with possible CLEANUP and LAZY-CHECK.
|
||||||
|
PATH should point to some maildir directory structure.
|
||||||
|
MY-ADDRESSES is a list of 'my' email addresses (see
|
||||||
|
`mu4e-user-mail-address-list')."
|
||||||
|
(mu4e~call-mu `(index
|
||||||
|
:my-addresses ,my-addresses
|
||||||
|
:cleanup ,cleanup
|
||||||
|
:lazy-check ,lazy-check)))
|
||||||
|
|
||||||
|
|
||||||
|
(defun mu4e~proc-mkdir (path)
|
||||||
|
"Create a new maildir-directory at filesystem PATH."
|
||||||
|
;;(mu4e~proc-send-command "cmd:mkdir path:%s" (mu4e~escape path))
|
||||||
|
(mu4e~call-mu `(mkdir :path ,path)))
|
||||||
|
|
||||||
|
|
||||||
(defun mu4e~proc-move (docid-or-msgid &optional maildir flags no-view)
|
(defun mu4e~proc-move (docid-or-msgid &optional maildir flags no-view)
|
||||||
"Move message identified by DOCID-OR-MSGID.
|
"Move message identified by DOCID-OR-MSGID.
|
||||||
Optionally to MAILDIR and optionally setting FLAGS. If MAILDIR is
|
Optionally to MAILDIR and optionally setting FLAGS. If MAILDIR is
|
||||||
@ -402,89 +467,26 @@ Returns either (:update ... ) or (:error ) sexp, which are handled my
|
|||||||
:rename ,(and maildir mu4e-change-filenames-when-moving)
|
:rename ,(and maildir mu4e-change-filenames-when-moving)
|
||||||
:noview ,no-view))))
|
:noview ,no-view))))
|
||||||
|
|
||||||
(defun mu4e~proc-index (path my-addresses cleanup lazy-check)
|
|
||||||
"Index messages on PATH with possible CLEANUP and LAZY-CHECK.
|
|
||||||
PATH should point to some maildir directory structure.
|
|
||||||
MY-ADDRESSES is a list of 'my' email addresses (see
|
|
||||||
`mu4e-user-mail-address-list')."
|
|
||||||
(mu4e~call-mu `(index
|
|
||||||
:my-addresses ,my-addresses
|
|
||||||
:cleanup ,cleanup
|
|
||||||
:lazy-check ,lazy-check)))
|
|
||||||
|
|
||||||
(defun mu4e~proc-add (path maildir)
|
|
||||||
"Add the message at PATH to the database.
|
|
||||||
With MAILDIR set to the maildir this message resides in,
|
|
||||||
e.g. '/drafts'; if this works, we will receive (:info add :path
|
|
||||||
<path> :docid <docid>) as well as (:update <msg-sexp>)."
|
|
||||||
(mu4e~call-mu `(add
|
|
||||||
:path ,path
|
|
||||||
:maildir ,maildir)))
|
|
||||||
|
|
||||||
(defun mu4e~proc-sent (path maildir)
|
|
||||||
"Add the message at PATH to the database.
|
|
||||||
With MAILDIR set to the maildir this message resides in,
|
|
||||||
e.g. '/drafts'.
|
|
||||||
|
|
||||||
if this works, we will receive (:info add :path <path> :docid
|
|
||||||
<docid> :fcc <path>)."
|
|
||||||
(mu4e~call-mu `(sent
|
|
||||||
:path ,path
|
|
||||||
:maildir ,maildir)))
|
|
||||||
|
|
||||||
(defun mu4e~proc-compose (type decrypt &optional docid)
|
|
||||||
"Compose a message of TYPE, DECRYPT it and use DOCID.
|
|
||||||
TYPE is a symbol, either `forward', `reply', `edit', `resend' or
|
|
||||||
`new', based on an original message (ie, replying to, forwarding,
|
|
||||||
editing, resending) with DOCID or nil for type `new'.
|
|
||||||
|
|
||||||
The result is delivered to the function registered as
|
|
||||||
`mu4e-compose-func'."
|
|
||||||
(mu4e~call-mu `(compose
|
|
||||||
:type ,type
|
|
||||||
:decrypt ,decrypt
|
|
||||||
:docid ,docid)))
|
|
||||||
|
|
||||||
(defun mu4e~proc-mkdir (path)
|
|
||||||
"Create a new maildir-directory at filesystem PATH."
|
|
||||||
;;(mu4e~proc-send-command "cmd:mkdir path:%s" (mu4e~escape path))
|
|
||||||
(mu4e~call-mu `(mkdir :path ,path)))
|
|
||||||
|
|
||||||
(defun mu4e~proc-extract (action docid index decrypt
|
|
||||||
&optional path what param)
|
|
||||||
"Perform ACTION on part with DOCID INDEX DECRYPT PATH WHAT PARAM.
|
|
||||||
Use a message with DOCID and perform ACTION on it (as symbol,
|
|
||||||
either `save', `open', `temp') which mean: * save: save the part
|
|
||||||
to PATH (a path) (non-optional for save)$ * open: open the part
|
|
||||||
with the default application registered for doing so * temp: save
|
|
||||||
to a temporary file, then respond with
|
|
||||||
(:temp <path> :what <what> :param <param>)."
|
|
||||||
(mu4e~call-mu `(extract
|
|
||||||
:action ,action
|
|
||||||
:docid ,docid
|
|
||||||
:index ,index
|
|
||||||
:decrypt ,decrypt
|
|
||||||
:path ,path
|
|
||||||
:what ,what
|
|
||||||
:param ,param)))
|
|
||||||
|
|
||||||
(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.
|
||||||
QUERIES is a list of queries for the number of results with read/unread status
|
QUERIES is a list of queries for the number of results with read/unread status
|
||||||
are returned in the 'pong' response."
|
are returned in the 'pong' response."
|
||||||
(mu4e~call-mu `(ping
|
(mu4e~call-mu `(ping :queries ,queries)))
|
||||||
:queries ,queries)))
|
|
||||||
|
|
||||||
(defun mu4e~proc-contacts (personal after tstamp)
|
(defun mu4e~proc-remove (docid)
|
||||||
"Ask for contacts with PERSONAL AFTER TSTAMP.
|
"Remove message with DOCID.
|
||||||
S-expression (:contacts (<list>) :tstamp \"<tstamp>\") is expected in
|
The results are reporter through either (:update ... )
|
||||||
response. If PERSONAL is non-nil, only get personal contacts, if
|
or (:error) sexp, which are handled my `mu4e-error-func',
|
||||||
AFTER is non-nil, get only contacts seen AFTER (the time_t
|
respectively."
|
||||||
value)."
|
(mu4e~call-mu `(remove :docid ,docid)))
|
||||||
(mu4e~call-mu `(contacts
|
|
||||||
:personal ,personal
|
(defun mu4e~proc-sent (path)
|
||||||
:after ,(or after nil)
|
"Add the message at PATH to the database.
|
||||||
:tstamp ,(or tstamp nil))))
|
|
||||||
|
if this works, we will receive (:info add :path <path> :docid
|
||||||
|
<docid> :fcc <path>)."
|
||||||
|
(mu4e~call-mu `(sent :path ,path)))
|
||||||
|
|
||||||
(defun mu4e~proc-view (docid-or-msgid &optional images decrypt)
|
(defun mu4e~proc-view (docid-or-msgid &optional images decrypt)
|
||||||
"Get a message DOCID-OR-MSGID.
|
"Get a message DOCID-OR-MSGID.
|
||||||
@ -509,12 +511,6 @@ result will be delivered to the function registered as
|
|||||||
:images ,images
|
:images ,images
|
||||||
:decrypt ,decrypt)))
|
:decrypt ,decrypt)))
|
||||||
|
|
||||||
(defun mu4e~proc-remove (docid)
|
|
||||||
"Remove message with DOCID.
|
|
||||||
The results are reporter through either (:update ... )
|
|
||||||
or (:error) sexp, which are handled my `mu4e-error-func',
|
|
||||||
respectively."
|
|
||||||
(mu4e~call-mu `(remove :docid ,docid)))
|
|
||||||
|
|
||||||
(provide 'mu4e-proc)
|
(provide 'mu4e-proc)
|
||||||
;;; mu4e-proc.el ends here
|
;;; mu4e-proc.el ends here
|
||||||
|
|||||||
@ -1203,11 +1203,11 @@ displaying it). Do _not_ bury the current buffer, though."
|
|||||||
(mu4e-info (concat mu4e-doc-dir "/NEWS.org")))
|
(mu4e-info (concat mu4e-doc-dir "/NEWS.org")))
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
(defun mu4e-refresh-message (path maildir)
|
(defun mu4e-refresh-message (path)
|
||||||
"Re-parse message at PATH and MAILDIR; if this works, we will
|
"Re-parse message at PATH; if this works, we will
|
||||||
receive (:info add :path <path> :docid <docid>) as well as (:update
|
receive (:info add :path <path> :docid <docid>) as well as (:update
|
||||||
<msg-sexp>)."
|
<msg-sexp>)."
|
||||||
(mu4e~proc-add path maildir))
|
(mu4e~proc-add path))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
(defun mu4e~fontify-cited ()
|
(defun mu4e~fontify-cited ()
|
||||||
|
|||||||
Reference in New Issue
Block a user