From 93889b020e98113beeb7f7b19517a10dc8659a74 Mon Sep 17 00:00:00 2001 From: Jonas Bernoulli Date: Sat, 10 Nov 2012 10:40:41 +0100 Subject: [PATCH 1/3] * mu4e-header-highlight-face: inherit region This should make it more intuitive to see that actions are performed on the region as well as the current line (which usually is not part of the region). --- mu4e/mu4e-vars.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mu4e/mu4e-vars.el b/mu4e/mu4e-vars.el index 467c0524..2cff734f 100644 --- a/mu4e/mu4e-vars.el +++ b/mu4e/mu4e-vars.el @@ -344,7 +344,7 @@ flag set)." :group 'mu4e-faces) (defface mu4e-header-highlight-face - '((t :inherit default :weight bold :underline t)) + '((t :inherit region :weight bold :underline t)) "Face for the header at point." :group 'mu4e-faces) From 247ebfad3aec15f18e37899717a1c5018c6eff38 Mon Sep 17 00:00:00 2001 From: Jonas Bernoulli Date: Sat, 10 Nov 2012 16:34:17 +0100 Subject: [PATCH 2/3] mu4e~header-line-format: use same font as in buffer Use face `bold' for the sorted column but leave the face unspecified for other columns. This is how tabulated-list does it to; it only uses fixed-pitch for whitespace between columns. The problem with using fixed-pitch is that uses "Monospace" which might be a different monospace font than what is used for `default'. These fonts might have a different width causing columns in the header and the buffer not to be aligned. Inheriting `fixed-pitch' from `default' instead of specifying the font does not work as that causes the `fixed-pitch'ed parts of the header-line not to be raised like the rest anymore. One (that is every user) could also manually copy the font family from `default'. Simply not specifying the font fixes all that. --- mu4e/mu4e-headers.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mu4e/mu4e-headers.el b/mu4e/mu4e-headers.el index 8bf51ea9..4f582498 100644 --- a/mu4e/mu4e-headers.el +++ b/mu4e/mu4e-headers.el @@ -638,7 +638,7 @@ after the end of the search results." (if width (truncate-string-to-width name width 0 ?\s t) name) - 'face (if arrow 'bold 'fixed-pitch) + 'face (when arrow 'bold) 'help-echo help 'mouse-face (when sortable 'highlight) 'keymap (when sortable map) From 626d2afdc850a72b4d8bf92b0dcc5718ad94cfc7 Mon Sep 17 00:00:00 2001 From: Jonas Bernoulli Date: Sun, 11 Nov 2012 14:39:02 +0100 Subject: [PATCH 3/3] 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. --- mu4e/mu4e-headers.el | 15 +++++++-------- mu4e/mu4e-view.el | 20 ++++++++------------ 2 files changed, 15 insertions(+), 20 deletions(-) diff --git a/mu4e/mu4e-headers.el b/mu4e/mu4e-headers.el index 8bf51ea9..a0ca00d3 100644 --- a/mu4e/mu4e-headers.el +++ b/mu4e/mu4e-headers.el @@ -422,15 +422,14 @@ after the end of the search results." (defmacro mu4e~headers-defun-mark-for (mark) "Define a function mu4e~headers-mark-MARK." - (let ((funcname (intern (concat "mu4e-headers-mark-for-" (symbol-name mark)))) - (docstring (concat "Mark header at point with " (symbol-name mark) "."))) - `(defun ,funcname () ,docstring - (interactive) - (mu4e-headers-mark-and-next (quote ,mark))))) + (let ((funcname (intern (format "mu4e-headers-mark-for-%s" mark))) + (docstring (format "Mark header at point with %s." mark))) + `(progn + (defun ,funcname () ,docstring + (interactive) + (mu4e-headers-mark-and-next ',mark)) + (put ',funcname 'definition-name ',mark)))) -;; define our mark functions; there must be some way to do this in a loop but -;; since `mu4e~headers-defun-mark-func' is a macro, the argument must be a -;; literal value. (mu4e~headers-defun-mark-for refile) (mu4e~headers-defun-mark-for something) (mu4e~headers-defun-mark-for delete) diff --git a/mu4e/mu4e-view.el b/mu4e/mu4e-view.el index 68d896ee..e1992c4e 100644 --- a/mu4e/mu4e-view.el +++ b/mu4e/mu4e-view.el @@ -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)