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 02586431E82 for ; Wed, 15 Feb 2012 11:28:51 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.799 X-Spam-Level: X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] 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 6zqbPSZgnwtZ for ; Wed, 15 Feb 2012 11:28:46 -0800 (PST) Received: from mail-bk0-f53.google.com (mail-bk0-f53.google.com [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 37FBA431E62 for ; Wed, 15 Feb 2012 11:28:46 -0800 (PST) Received: by bkcit16 with SMTP id it16so1404927bkc.26 for ; Wed, 15 Feb 2012 11:28:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:in-reply-to:references:user-agent:date:message-id :mime-version:content-type; bh=uiRhPGALUfVeSBcPZrQhRCN8YjgKsnzO0Newk3NUU4o=; b=NsB2xxyeCsBmI2LrToArcJ2yXvcmrym0C7UbUHjbZsgWalHtarWmxnhh9cc/rHKOtH 6ywLKy3nINnO6libx3iAIF3wwNehGLsOcU8Z0ooXT8MffYE9GcJSd5s1N9G847QhVxyL JmN4I7SZfIVp7npZ7pbfDavRlbtju2fJUADyA= Received: by 10.204.10.80 with SMTP id o16mr11966953bko.50.1329334120190; Wed, 15 Feb 2012 11:28:40 -0800 (PST) Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id x22sm8400017bkw.11.2012.02.15.11.28.38 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 15 Feb 2012 11:28:39 -0800 (PST) From: Dmitry Kurochkin To: Michal Sojka , notmuch@notmuchmail.org Subject: Re: [PATCH v2] emacs: Fix display of highlighted line in notmuch-search In-Reply-To: <1329239387-6300-1-git-send-email-sojka@os.inf.tu-dresden.de> References: <87mx8lpd5o.fsf@nikula.org> <1329239387-6300-1-git-send-email-sojka@os.inf.tu-dresden.de> User-Agent: Notmuch/0.11.1+188~ga5674c2 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Wed, 15 Feb 2012 23:27:18 +0400 Message-ID: <87wr7ngand.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: Wed, 15 Feb 2012 19:28:51 -0000 Hi Michal. On Tue, 14 Feb 2012 18:09:47 +0100, Michal Sojka 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@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@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch