Mu4e: Make the delete action trash for gmail
This commit is contained in:
parent
f7a2479064
commit
3179942dfb
1 changed files with 3 additions and 1 deletions
|
@ -368,7 +368,8 @@ Must be set before org-msg is loaded to take effect.")
|
||||||
:show-target (lambda (target) "delete")
|
:show-target (lambda (target) "delete")
|
||||||
:action (lambda (docid msg target)
|
:action (lambda (docid msg target)
|
||||||
(if (+mu4e-msg-gmail-p msg)
|
(if (+mu4e-msg-gmail-p msg)
|
||||||
(progn (message "The delete operation is invalid for Gmail accounts.")
|
(progn (message "The delete operation is invalid for Gmail accounts. Trashing instead.")
|
||||||
|
(+mu4e--mark-seen docid msg target)
|
||||||
(when (< 2 (- (float-time) +mu4e--last-invalid-gmail-action))
|
(when (< 2 (- (float-time) +mu4e--last-invalid-gmail-action))
|
||||||
(sit-for 1))
|
(sit-for 1))
|
||||||
(setq +mu4e--last-invalid-gmail-action (float-time)))
|
(setq +mu4e--last-invalid-gmail-action (float-time)))
|
||||||
|
@ -401,6 +402,7 @@ Must be set before org-msg is loaded to take effect.")
|
||||||
(when (+mu4e-msg-gmail-p msg)
|
(when (+mu4e-msg-gmail-p msg)
|
||||||
(pcase mark
|
(pcase mark
|
||||||
(`trash (mu4e-action-retag-message msg "-\\Inbox,+\\Trash,-\\Draft"))
|
(`trash (mu4e-action-retag-message msg "-\\Inbox,+\\Trash,-\\Draft"))
|
||||||
|
(`delete (mu4e-action-retag-message msg "-\\Inbox,+\\Trash,-\\Draft"))
|
||||||
(`refile (mu4e-action-retag-message msg "-\\Inbox"))
|
(`refile (mu4e-action-retag-message msg "-\\Inbox"))
|
||||||
(`flag (mu4e-action-retag-message msg "+\\Starred"))
|
(`flag (mu4e-action-retag-message msg "+\\Starred"))
|
||||||
(`unflag (mu4e-action-retag-message msg "-\\Starred"))))))))
|
(`unflag (mu4e-action-retag-message msg "-\\Starred"))))))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue