mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-25 10:54:52 +01:00
emacs: Make message-summary button begin at beginning of line.
Otherwise, RET is unreliable for opening/closing messages when navigating through messages with 'n' and 'p'.
This commit is contained in:
parent
6945e7e103
commit
fcc36df1fa
1 changed files with 32 additions and 32 deletions
64
notmuch.el
64
notmuch.el
|
@ -695,8 +695,11 @@ which this thread was originally shown."
|
|||
(set-marker beg nil)
|
||||
(set-marker end nil)
|
||||
)))
|
||||
|
||||
(defun notmuch-fontify-headers ()
|
||||
(progn
|
||||
(while (looking-at "[[:space:]]")
|
||||
(forward-char))
|
||||
(if (looking-at "[Tt]o:")
|
||||
(progn
|
||||
(overlay-put (make-overlay (point) (re-search-forward ":"))
|
||||
|
@ -727,39 +730,36 @@ which this thread was originally shown."
|
|||
(forward-line)
|
||||
(let ((beg (point-marker))
|
||||
(summary-end (copy-marker (line-beginning-position 2)))
|
||||
(subject-end (copy-marker (line-end-position 2)))
|
||||
(invis-spec (make-symbol "notmuch-show-header"))
|
||||
(btn nil))
|
||||
(overlay-put (make-overlay beg summary-end) 'face 'notmuch-message-summary-face)
|
||||
(setq btn (make-button beg summary-end :type 'notmuch-button-body-toggle-type))
|
||||
(forward-line 1)
|
||||
(end-of-line)
|
||||
(let ((beg-hidden (point-marker)))
|
||||
(re-search-forward notmuch-show-header-end-regexp)
|
||||
(beginning-of-line)
|
||||
(let ((end (point-marker)))
|
||||
(goto-char beg)
|
||||
(forward-line)
|
||||
(while (looking-at "[A-Za-z][-A-Za-z0-9]*:")
|
||||
(beginning-of-line)
|
||||
(notmuch-fontify-headers)
|
||||
(forward-line)
|
||||
)
|
||||
(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)
|
||||
'invisible invis-spec)
|
||||
(goto-char beg)
|
||||
(forward-line)
|
||||
(make-button (line-beginning-position) (line-end-position)
|
||||
'invisibility-spec (cons invis-spec t)
|
||||
:type 'notmuch-button-headers-toggle-type))
|
||||
(goto-char end)
|
||||
(insert "\n")
|
||||
(set-marker beg nil)
|
||||
(set-marker beg-hidden nil)
|
||||
(set-marker end nil)
|
||||
))
|
||||
btn))
|
||||
(re-search-forward notmuch-show-header-end-regexp)
|
||||
(beginning-of-line)
|
||||
(let ((end (point-marker)))
|
||||
(indent-rigidly beg end depth)
|
||||
(goto-char beg)
|
||||
(overlay-put (make-overlay (line-beginning-position) summary-end) 'face 'notmuch-message-summary-face)
|
||||
(setq btn (make-button (line-beginning-position) summary-end :type 'notmuch-button-body-toggle-type))
|
||||
(forward-line)
|
||||
(add-to-invisibility-spec invis-spec)
|
||||
(overlay-put (make-overlay subject-end end)
|
||||
'invisible invis-spec)
|
||||
(make-button (line-beginning-position) subject-end
|
||||
'invisibility-spec invis-spec
|
||||
:type 'notmuch-button-headers-toggle-type)
|
||||
(while (looking-at "[[:space:]]*[A-Za-z][-A-Za-z0-9]*:")
|
||||
(beginning-of-line)
|
||||
(notmuch-fontify-headers)
|
||||
(forward-line)
|
||||
)
|
||||
(goto-char end)
|
||||
(insert "\n")
|
||||
(set-marker beg nil)
|
||||
(set-marker summary-end nil)
|
||||
(set-marker subject-end nil)
|
||||
(set-marker end nil)
|
||||
)
|
||||
btn))
|
||||
|
||||
(defun notmuch-show-markup-message ()
|
||||
(if (re-search-forward notmuch-show-message-begin-regexp nil t)
|
||||
|
|
Loading…
Reference in a new issue