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 7201E429E50 for ; Wed, 25 May 2011 15:10:25 -0700 (PDT) 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 bKf9xc6RwFsO for ; Wed, 25 May 2011 15:10:23 -0700 (PDT) Received: from mail-fx0-f53.google.com (mail-fx0-f53.google.com [209.85.161.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id E7B0A429E47 for ; Wed, 25 May 2011 15:10:19 -0700 (PDT) Received: by mail-fx0-f53.google.com with SMTP id 8so217139fxm.26 for ; Wed, 25 May 2011 15:10:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=SUqsr2PZ54+4OFQA4U0jC9+4gUE7loqubWtdQ9cJ3hI=; b=wgFXpPyw2wFDROL8qSRKUSh/WGX4rMzAu+3U6Nwc9SRbx1CKlOfXtXIPriYu1RNJB6 QI9iZXHXptka41JNHr/GD4aJf7oCLcj+9HoBWgX1zVF5KulE1VEwov0LaF3F/5qj+Jhd oO5nxsmsEYFGQujFujYKe1ThjZdaskxGvmRF8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=ikaN+pHXEvX3l4zuUV5zCiwhWzJX3rnE0sm9uvxJw6Vx8iRbJLjbSPuv14qHycnPSK VvOGFNj1krfeGI3IkTBB3PP0HpNVUmmIGCRMeLb4PtQMwUcJcFWFlBia5PPlhlR/RDkN cPAbBK0yq79YezPxYg1DCfhKG0Shryka2pTbg= Received: by 10.223.25.201 with SMTP id a9mr90080fac.141.1306361419625; Wed, 25 May 2011 15:10:19 -0700 (PDT) Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id g8sm31681fai.44.2011.05.25.15.10.18 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 25 May 2011 15:10:19 -0700 (PDT) From: Dmitry Kurochkin To: notmuch@notmuchmail.org Subject: [PATCH 4/5] Set higher priority for headers and hidden citation overlays. Date: Thu, 26 May 2011 02:10:15 +0400 Message-Id: <1306361416-5019-5-git-send-email-dmitry.kurochkin@gmail.com> X-Mailer: git-send-email 1.7.5.1 In-Reply-To: <1306361416-5019-1-git-send-email-dmitry.kurochkin@gmail.com> References: <1306361416-5019-1-git-send-email-dmitry.kurochkin@gmail.com> 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, 25 May 2011 22:10:25 -0000 Before the patch, message, headers and hidden citation overlays had zero priority. All these overlay have `invisible' property. Emacs documentation says that we should not make assumptions about which overlay will prevail when they have the same priority [1]. It happens to work as we need, but we should not rely on undocumented behavior. [1] http://www.gnu.org/s/emacs/manual/html_node/elisp/Overlay-Properties.html --- emacs/notmuch-show.el | 4 +++- emacs/notmuch-wash.el | 1 + 2 files changed, 4 insertions(+), 1 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 34c0b79..e1846bc 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -733,7 +733,9 @@ current buffer, if possible." ;; message. (put-text-property message-start message-end :notmuch-message-extent (cons message-start message-end)) - (overlay-put (make-overlay headers-start headers-end) 'invisible headers-invis-spec) + (let ((headers-overlay (make-overlay headers-start headers-end))) + (overlay-put headers-overlay 'invisible headers-invis-spec) + (overlay-put headers-overlay 'priority 10)) (overlay-put (make-overlay body-start body-end) 'invisible message-invis-spec) ;; Save the properties for this message. Currently this saves the diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el index bd521ba..992fa8f 100644 --- a/emacs/notmuch-wash.el +++ b/emacs/notmuch-wash.el @@ -139,6 +139,7 @@ insert before the button, probably for indentation." (add-to-invisibility-spec invis-spec) (overlay-put overlay 'invisible (list invis-spec message-invis-spec)) (overlay-put overlay 'isearch-open-invisible #'notmuch-wash-region-isearch-show) + (overlay-put overlay 'priority 10) (overlay-put overlay 'type type) (goto-char (1+ end)) (save-excursion -- 1.7.5.1