[PATCH v2] emacs: Fix display of highlighted line in notmuch-search
Dmitry Kurochkin
dmitry.kurochkin at gmail.com
Wed Feb 15 11:27:18 PST 2012
Hi Michal.
On Tue, 14 Feb 2012 18:09:47 +0100, Michal Sojka <sojka at os.inf.tu-dresden.de> wrote:
> When notmuch-search-line-faces is used to set background color in search
> results, the highlight of the current line is not always displayed
> correctly. This patch fixes that by increasing the priority property of
> the highlight overlay.
> ---
How about changing `notmuch-search-color-line' to use text properties
instead of overlays? Then hl-line overlay would take priority over it
without these changes.
See [1] by David Edmondson on why text properties are better in
general. I plan to use text properties here to simplify updating the
face when tags are changed.
Regards,
Dmitry
[1] id:"1328604377-20121-2-git-send-email-dme at dme.org"
> emacs/notmuch.el | 15 +++++++++++----
> 1 files changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/emacs/notmuch.el b/emacs/notmuch.el
> index 5b4f1c5..f851c6f 100644
> --- a/emacs/notmuch.el
> +++ b/emacs/notmuch.el
> @@ -249,10 +249,17 @@ For a mouse binding, return nil."
> (set-buffer-modified-p nil)
> (view-buffer (current-buffer) 'kill-buffer-if-not-modified))))
>
> -(defcustom notmuch-search-hook '(hl-line-mode)
> +(require 'hl-line)
> +
> +(defun notmuch-hl-line-mode ()
> + (prog1 (hl-line-mode)
> + (when hl-line-overlay
> + (overlay-put hl-line-overlay 'priority 1))))
> +
> +(defcustom notmuch-search-hook '(notmuch-hl-line-mode)
> "List of functions to call when notmuch displays the search results."
> :type 'hook
> - :options '(hl-line-mode)
> + :options '(notmuch-hl-line-mode)
> :group 'notmuch-search
> :group 'notmuch-hooks)
>
> @@ -567,7 +574,7 @@ a list of strings of the form \"+TAG\" or \"-TAG\".
> the messages that are about to be tagged"
>
> :type 'hook
> - :options '(hl-line-mode)
> + :options '(notmuch-hl-line-mode)
> :group 'notmuch-hooks)
>
> (defcustom notmuch-after-tag-hook nil
> @@ -578,7 +585,7 @@ a list of strings of the form \"+TAG\" or \"-TAG\".
> 'query' will be a string containing the search query that determines
> the messages that were tagged"
> :type 'hook
> - :options '(hl-line-mode)
> + :options '(notmuch-hl-line-mode)
> :group 'notmuch-hooks)
>
> (defun notmuch-search-set-tags (tags)
> --
> 1.7.7.3
>
> _______________________________________________
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch
More information about the notmuch
mailing list