From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id A20996DE0BA5 for ; Sun, 18 Jun 2017 03:04:54 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.105 X-Spam-Level: X-Spam-Status: No, score=0.105 tagged_above=-999 required=5 tests=[AWL=0.206, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HtHMQLWu9okL for ; Sun, 18 Jun 2017 03:04:53 -0700 (PDT) Received: from mail.choca.pics (mail.choca.pics [62.210.108.126]) by arlo.cworth.org (Postfix) with ESMTPS id 455D36DE0BA2 for ; Sun, 18 Jun 2017 03:04:52 -0700 (PDT) Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id 7D876232ADEB for ; Sun, 18 Jun 2017 12:04:49 +0200 (CEST) Received: from mail.choca.pics ([IPv6:::1]) by localhost (mail.choca.pics [IPv6:::1]) (amavisd-new, port 10032) with ESMTP id amIDV4pwSBCW; Sun, 18 Jun 2017 12:04:48 +0200 (CEST) Received: from localhost (localhost.localdomain [IPv6:::1]) by mail.choca.pics (Postfix) with ESMTP id 1C8B7232ADBD; Sun, 18 Jun 2017 12:04:48 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.choca.pics 1C8B7232ADBD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cassou.me; s=9EA44F5C-DEF4-11E6-A83F-A08DF322D8FB; t=1497780288; bh=NiGC7uGY9EFhVJww7bLRncysJiB3nQ4JTJdYwQzsqdU=; h=From:To:Date:Message-Id; b=F8pxPsThLgq1KrCTEC4BrR7ck+CnVU6lJ1ZigeoKVbfhgXfZrRIoCcEcf7mEIB/G5 1nhjNrPasDdTkxZgoJad3LhXWWONILWWjRsQzIaeE5m3MMRIE4CK6Dper1H8DQ/T6m htRCFs9lkrPUe4WFIfg/EYGxS15SxmvptqhFwJlnd6ci/Rb7WeWFQYAecm0iHCxsNz J20SkjnIoCqz78hekDQsSDTwMeCoSwnOZHvLCdU+2XkSRw8tWwi4fAGXJf0bJj7C5h VJTw+AuazkQtNWJgxQ5GRDmhIk/THLsUhLbvnqFrJTwlxqcvOXNyWBefrgvfzvoBm2 OdmFKpEhw1vDg== X-Virus-Scanned: amavisd-new at choca.pics Received: from mail.choca.pics ([IPv6:::1]) by localhost (mail.choca.pics [IPv6:::1]) (amavisd-new, port 10026) with ESMTP id ELaqCxXAlRjI; Sun, 18 Jun 2017 12:04:48 +0200 (CEST) Received: from localhost.localdomain (c80-216-198-172.bredband.comhem.se [80.216.198.172]) by mail.choca.pics (Postfix) with ESMTPSA id BC31D232ACE4; Sun, 18 Jun 2017 12:04:47 +0200 (CEST) From: Damien Cassou To: notmuch@notmuchmail.org Cc: Damien Cassou Subject: [PATCH] Add indentation to imenu in notmuch-show Date: Sun, 18 Jun 2017 12:04:35 +0200 Message-Id: <20170618100435.7052-1-damien@cassou.me> X-Mailer: git-send-email 2.9.4 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.23 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: Sun, 18 Jun 2017 10:04:54 -0000 --- emacs/notmuch-show.el | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 0f157ec..a4399ab 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -247,6 +247,19 @@ every user interaction with notmuch." :type 'function :group 'notmuch-show) +(defcustom notmuch-show-imenu-indent nil + "Should Imenu display messages indented. + +By default, Imenu (see Info node `(emacs) Imenu') in a +notmuch-show buffer displays all messages straight. This is +because the default Emacs frontend for Imenu makes it difficult +to select an Imenu entry with spaces in front. Other imenu +frontends such as counsel-imenu does not have this limitation. +In these cases, Imenu entries can be indented to reflect the +position of the message in the thread." + :type 'boolean + :group 'notmuch-show) + (defmacro with-current-notmuch-show-message (&rest body) "Evaluate body with current buffer set to the text of current message" `(save-excursion @@ -2484,7 +2497,10 @@ This function is used as a value for `imenu-extract-index-name-function'. Point should be at the beginning of the line." (back-to-indentation) - (buffer-substring-no-properties (point) (line-end-position))) + (buffer-substring-no-properties (if notmuch-show-imenu-indent + (line-beginning-position) + (point)) + (line-end-position))) (provide 'notmuch-show) -- 2.9.4