mu4e: set symbol prop definition-name in defun macros
This allows `find-function' to find the definition. While the definition doesn't contain much useful information jumping there instead of the beginning of the file is still better because the macro used to define them is defined right above. Also remove the comments about wanting to define the commands in a loop. One shouldn't do that; it would again make it impossible to find the definition.
This commit is contained in:
@ -1099,18 +1099,14 @@ user that unmarking only works in the header list."
|
||||
|
||||
(defmacro mu4e~view-defun-mark-for (mark)
|
||||
"Define a function mu4e-view-mark-for-MARK."
|
||||
(let ((funcname (intern (concat "mu4e-view-mark-for-" (symbol-name mark))))
|
||||
(docstring (format "Mark the current message for %s."
|
||||
(symbol-name mark))))
|
||||
`(defun ,funcname () ,docstring
|
||||
(interactive)
|
||||
(mu4e~view-in-headers-context
|
||||
(mu4e-headers-mark-and-next (quote ,mark))))))
|
||||
|
||||
;; would be cool to do something like the following, but somehow, I can't get
|
||||
;; the quoting right...
|
||||
;; (dolist (mark '(move trash refile delete flag unflag unmark deferred))
|
||||
;; (mu4e~view-defun-mark-for mark))
|
||||
(let ((funcname (intern (format "mu4e-view-mark-for-%s" mark)))
|
||||
(docstring (format "Mark the current message for %s." mark)))
|
||||
`(progn
|
||||
(defun ,funcname () ,docstring
|
||||
(interactive)
|
||||
(mu4e~view-in-headers-context
|
||||
(mu4e-headers-mark-and-next ',mark)))
|
||||
(put ',funcname 'definition-name ',mark))))
|
||||
|
||||
(mu4e~view-defun-mark-for move)
|
||||
(mu4e~view-defun-mark-for trash)
|
||||
|
||||
Reference in New Issue
Block a user