Merge pull request #94 from tarsius/definition-name

* mu4e: set symbol prop definition-name in defun macros
This commit is contained in:
Dirk-Jan C. Binnema
2012-11-11 07:21:27 -08:00
2 changed files with 15 additions and 20 deletions

View File

@ -1105,18 +1105,14 @@ 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)