You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to make trash marking act as a move to the trash folder, without setting the trashed flag.
This is a the scenario when the server handles auto-trashing, mentioned in the isync manual. It's also briefly mentioned in section 8.4 of the mu4e info manual.
The previous similar discussions are: #1018, #1136.
I implemented an advice function for this:
(defun mu4e-trash-by-moving-advice (args)
"Makes `mu4e-mark-at-point' handle trash marks as moves to the trash folder."
(cl-destructuring-bind (mark &optional target) args
(if (eql mark 'trash)
(list 'move (mu4e-get-trash-folder (mu4e-message-at-point)))
args)))
(advice-add 'mu4e-mark-at-point :filter-args 'mu4e-trash-by-moving-advice)
It seems a better solution than modifying mu4e-marks (which was mentioned by previous posters: #1136), because it doesn't reference any internals or modify a defconst.
But I found the docstring of mu4e-mark-at-point confusing:
It says that for trash marks the target argument is non-nil. However, the current implementation ignores any provided target argument and uses a dynamically computed value via mu4e--mark-get-dyn-target. This, in turn, calls what seems to be an internal function under mu4e-marks -> 'trash -> :dyn-target. It then calls the user-provided mu4e-trash-folder function with the result of mu4e-message-at-point as argument. But if it did receive a meaningful target argument, I would have to consider handling it in the advice.
Is that docstring outdated or am I misunderstanding the code?
Is that advice reasonable from maintainer perspective, or is it likely to cause problems with future versions of mu4e?
How to Reproduce
It's only a documentation issue.
Environment
mu/mu4e 1.12.5
The text was updated successfully, but these errors were encountered:
Outdated mu4e-mark-at-point docstring
Hello!
I wanted to make trash marking act as a move to the trash folder, without setting the trashed flag.
This is a the scenario when the server handles auto-trashing, mentioned in the isync manual. It's also briefly mentioned in section 8.4 of the mu4e info manual.
The previous similar discussions are: #1018, #1136.
I implemented an advice function for this:
It seems a better solution than modifying mu4e-marks (which was mentioned by previous posters: #1136), because it doesn't reference any internals or modify a defconst.
But I found the docstring of mu4e-mark-at-point confusing:
It says that for trash marks the target argument is non-nil. However, the current implementation ignores any provided target argument and uses a dynamically computed value via
mu4e--mark-get-dyn-target
. This, in turn, calls what seems to be an internal function undermu4e-marks -> 'trash -> :dyn-target
. It then calls the user-provided mu4e-trash-folder function with the result of mu4e-message-at-point as argument. But if it did receive a meaningfultarget
argument, I would have to consider handling it in the advice.How to Reproduce
It's only a documentation issue.
Environment
mu/mu4e 1.12.5
The text was updated successfully, but these errors were encountered: