mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-25 12:28:09 +01:00
notmuch.el: Redefine behavior of notmuch-show-previous-message
Now, if the user has manually moved point to somewhere within a message, executing the previous-message command onece will rewind point only to the beginning of the current message. Previously this would go back to the previous message, (which the user can now do easily and naturally by simply executing the command one more time).
This commit is contained in:
parent
253c11b675
commit
446459a5ea
1 changed files with 12 additions and 8 deletions
10
notmuch.el
10
notmuch.el
|
@ -147,15 +147,19 @@ last message in the buffer."
|
||||||
(defun notmuch-show-previous-message ()
|
(defun notmuch-show-previous-message ()
|
||||||
"Backup to the beginning of the previous message in the buffer.
|
"Backup to the beginning of the previous message in the buffer.
|
||||||
|
|
||||||
Moves to the beginning of the current message if already on the
|
If within a message rather than at the beginning of it, then
|
||||||
first message in the buffer."
|
simply move to the beginning of the current message."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
(let ((start (point)))
|
||||||
(notmuch-show-move-to-current-message-summary-line)
|
(notmuch-show-move-to-current-message-summary-line)
|
||||||
|
(if (not (< (point) start))
|
||||||
; Go backward twice to skip the current message's marker
|
; Go backward twice to skip the current message's marker
|
||||||
|
(progn
|
||||||
(re-search-backward notmuch-show-message-begin-regexp nil t)
|
(re-search-backward notmuch-show-message-begin-regexp nil t)
|
||||||
(re-search-backward notmuch-show-message-begin-regexp nil t)
|
(re-search-backward notmuch-show-message-begin-regexp nil t)
|
||||||
(notmuch-show-move-to-current-message-summary-line)
|
(notmuch-show-move-to-current-message-summary-line)
|
||||||
(recenter 0))
|
))
|
||||||
|
(recenter 0)))
|
||||||
|
|
||||||
(defun notmuch-show-mark-read-then-next-message ()
|
(defun notmuch-show-mark-read-then-next-message ()
|
||||||
"Remove uread tag from current message, then advance to next message."
|
"Remove uread tag from current message, then advance to next message."
|
||||||
|
|
Loading…
Reference in a new issue