[notmuch] [PATCH 2/2] notmuch.el: show some of citation even when hiding.
authordavid <david@tethera.net>
Fri, 25 Dec 2009 20:09:08 +0000 (16:09 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:35:56 +0000 (09:35 -0800)
56/cc3588797005a1190d8b22aa148fd3a59683ff [new file with mode: 0644]

diff --git a/56/cc3588797005a1190d8b22aa148fd3a59683ff b/56/cc3588797005a1190d8b22aa148fd3a59683ff
new file mode 100644 (file)
index 0000000..e0e14f2
--- /dev/null
@@ -0,0 +1,109 @@
+Return-Path: <bremner@pivot.cs.unb.ca>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 8FFA9431FC2\r
+       for <notmuch@notmuchmail.org>; Fri, 25 Dec 2009 12:09:37 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id a6T7w7XiPBgE for <notmuch@notmuchmail.org>;\r
+       Fri, 25 Dec 2009 12:09:36 -0800 (PST)\r
+Received: from pivot.cs.unb.ca (pivot.cs.unb.ca [131.202.240.57])\r
+       by olra.theworths.org (Postfix) with ESMTP id 154CB431FC3\r
+       for <notmuch@notmuchmail.org>; Fri, 25 Dec 2009 12:09:35 -0800 (PST)\r
+Received: from\r
+       fctnnbsc30w-142167182194.pppoe-dynamic.high-speed.nb.bellaliant.net\r
+       ([142.167.182.194] helo=localhost)\r
+       by pivot.cs.unb.ca with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32)\r
+       (Exim 4.69) (envelope-from <bremner@pivot.cs.unb.ca>)\r
+       id 1NOGTe-0004og-Ml; Fri, 25 Dec 2009 16:09:34 -0400\r
+Received: from bremner by localhost with local (Exim 4.71)\r
+       (envelope-from <bremner@pivot.cs.unb.ca>)\r
+       id 1NOGTZ-0006B8-C4; Fri, 25 Dec 2009 16:09:29 -0400\r
+From: david@tethera.net\r
+To: notmuch@notmuchmail.org\r
+Date: Fri, 25 Dec 2009 16:09:08 -0400\r
+Message-Id: <1261771748-23687-3-git-send-email-david@tethera.net>\r
+X-Mailer: git-send-email 1.6.5.7\r
+In-Reply-To: <1261771748-23687-2-git-send-email-david@tethera.net>\r
+References: <87my17965l.fsf@anar.kanru.info>\r
+       <1261771748-23687-1-git-send-email-david@tethera.net>\r
+       <1261771748-23687-2-git-send-email-david@tethera.net>\r
+X-Sender-Verified: bremner@pivot.cs.unb.ca\r
+Cc: David Bremner <bremner@unb.ca>\r
+Subject: [notmuch] [PATCH 2/2] notmuch.el: show some of citation even when\r
+       hiding.\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.12\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Fri, 25 Dec 2009 20:09:38 -0000\r
+\r
+From: David Bremner <bremner@unb.ca>\r
+\r
+- rename notmuch-show-citation-lines-min to n-s-c-l-prefix\r
+- call forward-line with the appropriate parameter to adjust\r
+  region to be hidden.\r
+- change citation button text so that it makes (some) sense when citation is shown\r
+---\r
+ notmuch.el |   18 ++++++++++++------\r
+ 1 files changed, 12 insertions(+), 6 deletions(-)\r
+\r
+diff --git a/notmuch.el b/notmuch.el\r
+index 8a51d27..c280411 100644\r
+--- a/notmuch.el\r
++++ b/notmuch.el\r
+@@ -99,7 +99,7 @@ pattern can still test against the entire line).")\r
+ Can use up to one integer format parameter, i.e. %d")\r
\r
+ (defvar notmuch-show-citation-button-format \r
+-  "[ %d-line hidden citation. Click/Enter to show ]"\r
++  "[ %d more citation lines. Click/Enter to toggle visibility. ]"\r
+   "String used to construct button text for hidden citations.\r
\r
+ Can use up to one integer format parameter, i.e. %d")\r
+@@ -107,8 +107,11 @@ Can use up to one integer format parameter, i.e. %d")\r
+ (defvar notmuch-show-signature-lines-max 12\r
+   "Maximum length of signature that will be hidden by default.")\r
\r
+-(defvar notmuch-show-citation-lines-min 4\r
+-  "Minimum length of citation that will be hidden.")\r
++(defvar notmuch-show-citation-lines-prefix 4\r
++  "Always show at least this many lines of a citation.\r
++\r
++If there is one more line, show that, otherwise collapse\r
++remaining lines into a button.")\r
\r
+ (defvar notmuch-command "notmuch"\r
+   "Command to run the notmuch binary.")\r
+@@ -660,12 +663,15 @@ is what to put on the button."\r
+       (let* ((cite-start (match-beginning 0))\r
+            (cite-end  (match-end 0))\r
+            (cite-lines (count-lines cite-start cite-end)))\r
+-      (if (>= cite-lines notmuch-show-citation-lines-min)\r
++      (when (>  cite-lines (1+ notmuch-show-citation-lines-prefix))\r
++          (goto-char cite-start)\r
++          (forward-line notmuch-show-citation-lines-prefix)\r
+           (notmuch-show-region-to-button \r
+-           cite-start cite-end\r
++           (point) cite-end\r
+            "citation"\r
+            indent\r
+-           (format notmuch-show-citation-button-format cite-lines)\r
++           (format notmuch-show-citation-button-format \r
++                   (- cite-lines notmuch-show-citation-lines-prefix))\r
+            ))))\r
+     (if (and (< (point) end) \r
+            (re-search-forward signature-regexp end t))\r
+-- \r
+1.6.5.7\r
+\r