mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-25 12:28:09 +01:00
make headers locally expandable/collapsable
This is the same as with citations and signatures. I used an ellipsis here for the invisible region, which I think make it more obvious that there are extra headers. MH-e used this for extra long To/CC headers.
This commit is contained in:
parent
f615803932
commit
bde9284064
1 changed files with 15 additions and 3 deletions
16
notmuch.el
16
notmuch.el
|
@ -605,7 +605,8 @@ which this thread was originally shown."
|
||||||
(end-of-line)
|
(end-of-line)
|
||||||
; Inverse video for subject
|
; Inverse video for subject
|
||||||
(overlay-put (make-overlay beg (point)) 'face '(:inverse-video t))
|
(overlay-put (make-overlay beg (point)) 'face '(:inverse-video t))
|
||||||
(forward-line 2)
|
(forward-line 1)
|
||||||
|
(end-of-line)
|
||||||
(let ((beg-hidden (point-marker)))
|
(let ((beg-hidden (point-marker)))
|
||||||
(re-search-forward notmuch-show-header-end-regexp)
|
(re-search-forward notmuch-show-header-end-regexp)
|
||||||
(beginning-of-line)
|
(beginning-of-line)
|
||||||
|
@ -619,8 +620,19 @@ which this thread was originally shown."
|
||||||
(forward-line)
|
(forward-line)
|
||||||
)
|
)
|
||||||
(indent-rigidly beg end depth)
|
(indent-rigidly beg end depth)
|
||||||
|
(let ((invis-spec (make-symbol "notmuch-show-header")))
|
||||||
|
(add-to-invisibility-spec (cons invis-spec t))
|
||||||
(overlay-put (make-overlay beg-hidden end)
|
(overlay-put (make-overlay beg-hidden end)
|
||||||
'invisible 'notmuch-show-header)
|
'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)
|
(goto-char end)
|
||||||
(insert "\n")
|
(insert "\n")
|
||||||
(set-marker beg nil)
|
(set-marker beg nil)
|
||||||
|
|
Loading…
Reference in a new issue