unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Michal Sojka <sojka@os.inf.tu-dresden.de>
To: notmuch@notmuchmail.org
Cc: Michal Sojka <sojka@os.inf.tu-dresden.de>
Subject: [PATCH v2] emacs: Fix display of highlighted line in notmuch-search
Date: Tue, 14 Feb 2012 18:09:47 +0100	[thread overview]
Message-ID: <1329239387-6300-1-git-send-email-sojka@os.inf.tu-dresden.de> (raw)
In-Reply-To: <87mx8lpd5o.fsf@nikula.org>

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.
---
 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

  reply	other threads:[~2012-02-14 17:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-14 10:24 [PATCH] emacs: Fix display of highlighted line in notmuch-show Michal Sojka
2012-02-14 15:27 ` Austin Clements
2012-02-14 16:56 ` Jani Nikula
2012-02-14 17:09   ` Michal Sojka [this message]
2012-02-15 10:23     ` [PATCH v2] emacs: Fix display of highlighted line in notmuch-search Tomi Ollila
2012-02-15 19:27     ` Dmitry Kurochkin
2012-02-15 23:18       ` Michal Sojka
2012-02-15 23:25         ` Dmitry Kurochkin
2012-02-17 12:09     ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1329239387-6300-1-git-send-email-sojka@os.inf.tu-dresden.de \
    --to=sojka@os.inf.tu-dresden.de \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).