unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH 1/5] make headers locally expandable/collapsable
@ 2009-11-24  7:45 Alexander Botero-Lowry
  2009-11-24  7:45 ` [PATCH 2/5] cleanup a lot of left-overs from the global invis Alexander Botero-Lowry
  2009-11-24 19:40 ` [PATCH 1/5] make headers locally expandable/collapsable Carl Worth
  0 siblings, 2 replies; 8+ messages in thread
From: Alexander Botero-Lowry @ 2009-11-24  7:45 UTC (permalink / raw)
  To: notmuch

---
 notmuch.el |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index fa6e7de..8aee286 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -605,7 +605,8 @@ which this thread was originally shown."
     (end-of-line)
     ; Inverse video for subject
     (overlay-put (make-overlay beg (point)) 'face '(:inverse-video t))
-    (forward-line 2)
+    (forward-line 1)
+    (end-of-line)
     (let ((beg-hidden (point-marker)))
       (re-search-forward notmuch-show-header-end-regexp)
       (beginning-of-line)
@@ -619,8 +620,19 @@ which this thread was originally shown."
           (forward-line)
           )
 	(indent-rigidly beg end depth)
-	(overlay-put (make-overlay beg-hidden end)
-		     'invisible 'notmuch-show-header)
+        (let ((invis-spec (make-symbol "notmuch-show-header")))
+          (add-to-invisibility-spec (cons invis-spec t))
+          (overlay-put (make-overlay beg-hidden end)
+                       'invisible invis-spec)
+          (goto-char beg)
+          (forward-line)
+          (let ((header-button (make-button (line-beginning-position) (line-end-position))))
+            (button-put header-button 'invisibility-spec (cons invis-spec t))
+            (button-put header-button 'action 'notmuch-toggle-invisible-action)
+            (button-put header-button 'follow-link t)
+            (button-put header-button 'help-echo
+                        "mouse-1, RET: Show headers")
+          ))
         (goto-char end)
         (insert "\n")
 	(set-marker beg nil)
-- 
1.6.5.2

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-11-27 13:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-24  7:45 [PATCH 1/5] make headers locally expandable/collapsable Alexander Botero-Lowry
2009-11-24  7:45 ` [PATCH 2/5] cleanup a lot of left-overs from the global invis Alexander Botero-Lowry
2009-11-24  7:45   ` [PATCH 3/5] make a nice function for generating invisibility toggle buttons Alexander Botero-Lowry
2009-11-24  7:45     ` [PATCH 4/5] Make bodies locally toggleable Alexander Botero-Lowry
2009-11-24  7:45       ` [PATCH 5/5] Remove the global expand body keymapping Alexander Botero-Lowry
2009-11-24 19:40 ` [PATCH 1/5] make headers locally expandable/collapsable Carl Worth
2009-11-24 19:49   ` Alexander Botero-Lowry
2009-11-27 13:43     ` Carl Worth

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).