mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-28 13:44:12 +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 beg nil)
|
||||||
(set-marker end nil)
|
(set-marker end nil)
|
||||||
)))
|
)))
|
||||||
|
|
||||||
(defun notmuch-fontify-headers ()
|
(defun notmuch-fontify-headers ()
|
||||||
(progn
|
(progn
|
||||||
|
(while (looking-at "[[:space:]]")
|
||||||
|
(forward-char))
|
||||||
(if (looking-at "[Tt]o:")
|
(if (looking-at "[Tt]o:")
|
||||||
(progn
|
(progn
|
||||||
(overlay-put (make-overlay (point) (re-search-forward ":"))
|
(overlay-put (make-overlay (point) (re-search-forward ":"))
|
||||||
|
@ -727,39 +730,36 @@ which this thread was originally shown."
|
||||||
(forward-line)
|
(forward-line)
|
||||||
(let ((beg (point-marker))
|
(let ((beg (point-marker))
|
||||||
(summary-end (copy-marker (line-beginning-position 2)))
|
(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))
|
(btn nil))
|
||||||
(overlay-put (make-overlay beg summary-end) 'face 'notmuch-message-summary-face)
|
(re-search-forward notmuch-show-header-end-regexp)
|
||||||
(setq btn (make-button beg summary-end :type 'notmuch-button-body-toggle-type))
|
(beginning-of-line)
|
||||||
(forward-line 1)
|
(let ((end (point-marker)))
|
||||||
(end-of-line)
|
(indent-rigidly beg end depth)
|
||||||
(let ((beg-hidden (point-marker)))
|
(goto-char beg)
|
||||||
(re-search-forward notmuch-show-header-end-regexp)
|
(overlay-put (make-overlay (line-beginning-position) summary-end) 'face 'notmuch-message-summary-face)
|
||||||
(beginning-of-line)
|
(setq btn (make-button (line-beginning-position) summary-end :type 'notmuch-button-body-toggle-type))
|
||||||
(let ((end (point-marker)))
|
(forward-line)
|
||||||
(goto-char beg)
|
(add-to-invisibility-spec invis-spec)
|
||||||
(forward-line)
|
(overlay-put (make-overlay subject-end end)
|
||||||
(while (looking-at "[A-Za-z][-A-Za-z0-9]*:")
|
'invisible invis-spec)
|
||||||
(beginning-of-line)
|
(make-button (line-beginning-position) subject-end
|
||||||
(notmuch-fontify-headers)
|
'invisibility-spec invis-spec
|
||||||
(forward-line)
|
:type 'notmuch-button-headers-toggle-type)
|
||||||
)
|
(while (looking-at "[[:space:]]*[A-Za-z][-A-Za-z0-9]*:")
|
||||||
(indent-rigidly beg end depth)
|
(beginning-of-line)
|
||||||
(let ((invis-spec (make-symbol "notmuch-show-header")))
|
(notmuch-fontify-headers)
|
||||||
(add-to-invisibility-spec (cons invis-spec t))
|
(forward-line)
|
||||||
(overlay-put (make-overlay beg-hidden end)
|
)
|
||||||
'invisible invis-spec)
|
(goto-char end)
|
||||||
(goto-char beg)
|
(insert "\n")
|
||||||
(forward-line)
|
(set-marker beg nil)
|
||||||
(make-button (line-beginning-position) (line-end-position)
|
(set-marker summary-end nil)
|
||||||
'invisibility-spec (cons invis-spec t)
|
(set-marker subject-end nil)
|
||||||
:type 'notmuch-button-headers-toggle-type))
|
(set-marker end nil)
|
||||||
(goto-char end)
|
)
|
||||||
(insert "\n")
|
btn))
|
||||||
(set-marker beg nil)
|
|
||||||
(set-marker beg-hidden nil)
|
|
||||||
(set-marker end nil)
|
|
||||||
))
|
|
||||||
btn))
|
|
||||||
|
|
||||||
(defun notmuch-show-markup-message ()
|
(defun notmuch-show-markup-message ()
|
||||||
(if (re-search-forward notmuch-show-message-begin-regexp nil t)
|
(if (re-search-forward notmuch-show-message-begin-regexp nil t)
|
||||||
|
|
Loading…
Reference in a new issue