[notmuch] lots of emacs mode enhancements
authorAlexander Botero-Lowry <alex.boterolowry@gmail.com>
Fri, 20 Nov 2009 08:26:33 +0000 (00:26 +1600)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:35:37 +0000 (09:35 -0800)
4c/6b9f688d2505a69e626d5777f15539f694c161 [new file with mode: 0644]

diff --git a/4c/6b9f688d2505a69e626d5777f15539f694c161 b/4c/6b9f688d2505a69e626d5777f15539f694c161
new file mode 100644 (file)
index 0000000..2691b5a
--- /dev/null
@@ -0,0 +1,205 @@
+Return-Path: <alex.boterolowry@gmail.com>\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 194E8431FBC\r
+       for <notmuch@notmuchmail.org>; Fri, 20 Nov 2009 00:26:36 -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 kqo8Kvv93fUt for <notmuch@notmuchmail.org>;\r
+       Fri, 20 Nov 2009 00:26:35 -0800 (PST)\r
+Received: from mail-gx0-f221.google.com (mail-gx0-f221.google.com\r
+       [209.85.217.221])\r
+       by olra.theworths.org (Postfix) with ESMTP id 08BE0431FAE\r
+       for <notmuch@notmuchmail.org>; Fri, 20 Nov 2009 00:26:34 -0800 (PST)\r
+Received: by gxk21 with SMTP id 21so2777245gxk.10\r
+       for <notmuch@notmuchmail.org>; Fri, 20 Nov 2009 00:26:34 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
+       h=domainkey-signature:received:received:received:from:to:subject:date\r
+       :message-id:mime-version:content-type;\r
+       bh=iHTsHuix2LBK8/vR0wCnp53HdBz5w3m9zkRqaLQlnhc=;\r
+       b=LlthhjX8MWk9Qa+J+FrL67iUED+wp7/OTF7vyh/FQjDrZ3rs1beu1Z5iKbF6oSG94I\r
+       6VHYSiVc6ydhAbL0iNjFvrigWKYnFkaRI2fHDbGJH6vClR+AMtVXc8Z0fNCi+BPSxaRm\r
+       kDn98mEFB3tAmxJsw6U97eEgGBV6KLXZA/05o=\r
+DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;\r
+       h=from:to:subject:date:message-id:mime-version:content-type;\r
+       b=JOPk3uNbWB49ldjee15FlKQVVLVTti5rwSzdSveL0rzN/BNokX7zaXcW5oKp0+ZAVy\r
+       4+abbImyVf6g9kE1dC4UF8+uOnivYNyoMEJg/YIohTMiOJJGztQ94/91Y/5bwhbMRQZt\r
+       X8Pu9glA3xwF+g+7W/7lchEl08DJoseay/Qdc=\r
+Received: by 10.150.19.5 with SMTP id 5mr2098693ybs.103.1258705594592;\r
+       Fri, 20 Nov 2009 00:26:34 -0800 (PST)\r
+Received: from fortitudo (70-36-144-85.dsl.dynamic.sonic.net [70.36.144.85])\r
+       by mx.google.com with ESMTPS id 14sm695028gxk.6.2009.11.20.00.26.32\r
+       (version=TLSv1/SSLv3 cipher=RC4-MD5);\r
+       Fri, 20 Nov 2009 00:26:33 -0800 (PST)\r
+Received: from alexbl (uid 1001) (envelope-from\r
+       alexbl@fortitudo.i-did-not-set--mail-host-address--so-tickle-me)\r
+       id 7053 by fortitudo (DragonFly Mail Agent)\r
+       Fri, 20 Nov 2009 00:26:33 -0800\r
+From: Alexander Botero-Lowry <alex.boterolowry@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Date: Fri, 20 Nov 2009 00:26:33 -0800\r
+Message-ID:\r
+ <86ws1lioue.fsf@fortitudo.i-did-not-set--mail-host-address--so-tickle-me>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Subject: [notmuch] lots of emacs mode enhancements\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, 20 Nov 2009 08:26:36 -0000\r
+\r
+I've just been diving into the elisp, and have added a bunch of useful\r
+features.\r
+\r
+1) buttonized citation and signature expanders and made them locally\r
+collapsable instead of globally (this could take some cleanup to remove\r
+the global key-map binding or make it work again)\r
+2) fixed an annoying warning about cons not being a face name\r
+3) made header names bold to make it easier to distingush them from\r
+their value\r
+\r
+My next target is to carry the buttonization through to threads and\r
+headers, and then I'm going to look into doing better mime-handling in\r
+general.\r
+\r
+also, RFP includes a -p argument that gives a patch :)\r
+\r
+alex\r
+\r
+----\r
+The following changes since commit 9b560fb3eb87b2a4f9d092bc1b124ccb6d11c975:\r
+  Alexander Botero-Lowry (1):\r
+        Checkin some command-only tcsh completions\r
+\r
+are available in the git repository at:\r
+\r
+  git://alexbl.net/notmuch.git master\r
+\r
+Alexander Botero-Lowry (5):\r
+      Buttonize citation expander.\r
+      buttonize signatures as well\r
+      fix the message about cons not being a valid face attribute\r
+      Make expanding/collapsing signatures and citations local to them\r
+      make header names bold in show-mode\r
+\r
+ notmuch.el |   72 +++++++++++++++++++++++++++++++++++++++++++++++------------\r
+ 1 files changed, 57 insertions(+), 15 deletions(-)\r
+\r
+diff --git a/notmuch.el b/notmuch.el\r
+index 1fc54c3..bb69aa3 100644\r
+--- a/notmuch.el\r
++++ b/notmuch.el\r
+@@ -440,6 +440,14 @@ which this thread was originally shown."\r
+       (if last\r
+           (notmuch-show-archive-thread))))))\r
\r
++(defun notmuch-toggle-invisible-action (cite-button)\r
++  (let ((invis-spec (button-get button 'invisibility-spec)))\r
++        (if (invisible-p invis-spec)\r
++            (remove-from-invisibility-spec invis-spec)\r
++          (add-to-invisibility-spec invis-spec)\r
++          ))\r
++  (goto-char (button-end cite-button)))\r
++\r
+ (defun notmuch-show-markup-citations-region (beg end depth)\r
+   (goto-char beg)\r
+   (beginning-of-line)\r
+@@ -451,25 +459,51 @@ which this thread was originally shown."\r
+         (progn\r
+           (while (looking-at citation)\r
+             (forward-line))\r
+-          (let ((overlay (make-overlay beg-sub (point))))\r
+-            (overlay-put overlay 'invisible 'notmuch-show-citation)\r
+-            (overlay-put overlay 'before-string\r
+-                         (concat indent\r
+-                                 "[" (number-to-string (count-lines beg-sub (point)))\r
+-                                 "-line citation. Press 'c' to show.]\n")))))\r
++          (let ((overlay (make-overlay beg-sub (point)))\r
++                  (invis-spec (make-symbol "notmuch-citation-region")))\r
++              (add-to-invisibility-spec invis-spec)\r
++            (overlay-put overlay 'invisible invis-spec)\r
++              (let (\r
++                    (p (point))\r
++                    (cite-button-text\r
++                     (concat "["  (number-to-string (count-lines beg-sub (point)))\r
++                             "-line citation.]"))\r
++                    )\r
++                (goto-char (- beg-sub 1))\r
++                (insert (concat "\n" indent))\r
++                (let ((cite-button (insert-button cite-button-text)))\r
++                  (button-put cite-button 'invisibility-spec invis-spec)\r
++                  (button-put cite-button 'action 'notmuch-toggle-invisible-action)\r
++                  (button-put cite-button 'help-echo\r
++                              "mouse-2, RET: Show citation")\r
++\r
++                  )\r
++                (insert "\n")\r
++                (goto-char (+ (length cite-button-text) p))\r
++              ))))\r
+       (move-to-column depth)\r
+       (if (looking-at notmuch-show-signature-regexp)\r
+         (let ((sig-lines (- (count-lines beg-sub end) 1)))\r
+           (if (<= sig-lines notmuch-show-signature-lines-max)\r
+               (progn\r
+-                (overlay-put (make-overlay beg-sub end)\r
+-                             'invisible 'notmuch-show-signature)\r
+-                (overlay-put (make-overlay beg (- beg-sub 1))\r
+-                             'after-string\r
+-                             (concat "\n" indent\r
+-                                     "[" (number-to-string sig-lines)\r
+-                                     "-line signature. Press 's' to show.]"))\r
+-                (goto-char end)))))\r
++                  (let ((invis-spec (make-symbol "notmuch-signature-region")))\r
++                    (add-to-invisibility-spec invis-spec)\r
++                    (overlay-put (make-overlay beg-sub end)\r
++                                 'invisible invis-spec)\r
++                  \r
++                    (goto-char (- beg-sub 1))\r
++                    (insert (concat "\n" indent))\r
++                    (let ((sig-button (insert-button \r
++                                       (concat "[" (number-to-string sig-lines)\r
++                                         "-line signature.]"))))\r
++                      (button-put sig-button 'invisibility-spec invis-spec)\r
++                      (button-put sig-button 'action\r
++                                  'notmuch-toggle-invisible-action)\r
++                      (button-put sig-button 'help-echo\r
++                                  "mouse-2, RET: Show signature")\r
++                      )\r
++                    (insert "\n")\r
++                    (goto-char end))))))\r
+       (forward-line))))\r
\r
+ (defun notmuch-show-markup-part (beg end depth)\r
+@@ -516,12 +550,20 @@ which this thread was originally shown."\r
+   (let ((beg (point-marker)))\r
+     (end-of-line)\r
+     ; Inverse video for subject\r
+-    (overlay-put (make-overlay beg (point)) 'face '((cons :inverse-video t)))\r
++    (overlay-put (make-overlay beg (point)) 'face '(:inverse-video t))\r
+     (forward-line 2)\r
+     (let ((beg-hidden (point-marker)))\r
+       (re-search-forward notmuch-show-header-end-regexp)\r
+       (beginning-of-line)\r
+       (let ((end (point-marker)))\r
++        (goto-char beg)\r
++        (forward-line)\r
++        (while (looking-at "[A-Za-z][-A-Za-z0-9]*:")\r
++          (beginning-of-line)\r
++          (overlay-put (make-overlay (point) (re-search-forward ":"))\r
++                       'face 'bold)\r
++          (forward-line)\r
++          )\r
+       (indent-rigidly beg end depth)\r
+       (overlay-put (make-overlay beg-hidden end)\r
+                    'invisible 'notmuch-show-header)\r