From 80e19193492aba7087552921e834db34ca4abb69 Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Tue, 14 Feb 2012 18:09:47 +0100 Subject: [PATCH] [PATCH v2] emacs: Fix display of highlighted line in notmuch-search --- 65/9a96ad0eaedb70f9954c1e8759a209208abfa1 | 113 ++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 65/9a96ad0eaedb70f9954c1e8759a209208abfa1 diff --git a/65/9a96ad0eaedb70f9954c1e8759a209208abfa1 b/65/9a96ad0eaedb70f9954c1e8759a209208abfa1 new file mode 100644 index 000000000..2599fbcd6 --- /dev/null +++ b/65/9a96ad0eaedb70f9954c1e8759a209208abfa1 @@ -0,0 +1,113 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 18EA5431FBC + for ; Tue, 14 Feb 2012 09:10:17 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -2.3 +X-Spam-Level: +X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id izw-zVCDOD-M for ; + Tue, 14 Feb 2012 09:10:16 -0800 (PST) +Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36]) + by olra.theworths.org (Postfix) with ESMTP id 4D0D1431FAF + for ; Tue, 14 Feb 2012 09:10:16 -0800 (PST) +Received: from localhost (unknown [192.168.200.4]) + by max.feld.cvut.cz (Postfix) with ESMTP id 45AE53CFE81; + Tue, 14 Feb 2012 18:10:15 +0100 (CET) +X-Virus-Scanned: IMAP AMAVIS +Received: from max.feld.cvut.cz ([192.168.200.1]) + by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new, + port 10044) + with ESMTP id bHZU3-R4mE6N; Tue, 14 Feb 2012 18:10:11 +0100 (CET) +Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34]) + by max.feld.cvut.cz (Postfix) with ESMTP id 4D3303CFE77; + Tue, 14 Feb 2012 18:10:11 +0100 (CET) +Received: from steelpick.2x.cz (unknown [141.76.49.23]) + (Authenticated sender: sojkam1) + by imap.feld.cvut.cz (Postfix) with ESMTPSA id 3B7A9660968; + Tue, 14 Feb 2012 18:10:11 +0100 (CET) +Received: from wsh by steelpick.2x.cz with local (Exim 4.77) + (envelope-from ) + id 1RxLtK-0001fk-Uu; Tue, 14 Feb 2012 18:10:10 +0100 +From: Michal Sojka +To: notmuch@notmuchmail.org +Subject: [PATCH v2] emacs: Fix display of highlighted line in notmuch-search +Date: Tue, 14 Feb 2012 18:09:47 +0100 +Message-Id: <1329239387-6300-1-git-send-email-sojka@os.inf.tu-dresden.de> +X-Mailer: git-send-email 1.7.7.3 +In-Reply-To: <87mx8lpd5o.fsf@nikula.org> +References: <87mx8lpd5o.fsf@nikula.org> +Cc: Michal Sojka +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Tue, 14 Feb 2012 17:10:17 -0000 + +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 + -- 2.26.2