aboutsummaryrefslogtreecommitdiffhomepage
path: root/emacs
diff options
context:
space:
mode:
authorGravatar Dmitry Kurochkin <dmitry.kurochkin@gmail.com>2011-11-06 13:03:59 +0400
committerGravatar David Bremner <bremner@debian.org>2011-11-07 20:38:37 -0400
commit6e6cb68b804de9e5234bfadaeec3e4b7b4075251 (patch)
treed771107c7c7e3f14fa0db9b82e1554edf26e9d78 /emacs
parent968965635197a6646688c0edd759f0c4f74181cb (diff)
emacs: improve hidden signatures handling in notmuch-show-advance-and-archive
Use `previous-single-char-property-change' instead of going through each character by hand and testing it's visibility. This fixes `notmuch-show-advance-and-archive' to work for the last message in thread with hidden signature.
Diffstat (limited to 'emacs')
-rw-r--r--emacs/notmuch-show.el17
1 files changed, 9 insertions, 8 deletions
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 440e089e..b70dbfb2 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -1152,17 +1152,18 @@ thread, (remove the \"inbox\" tag from each message). Also kill
this buffer, and display the next thread from the search from
which this thread was originally shown."
(interactive)
- (let ((end-of-this-message (notmuch-show-message-bottom)))
+ (let* ((end-of-this-message (notmuch-show-message-bottom))
+ (visible-end-of-this-message (1- end-of-this-message)))
+ (while (invisible-p visible-end-of-this-message)
+ (setq visible-end-of-this-message
+ (previous-single-char-property-change visible-end-of-this-message
+ 'invisible)))
(cond
;; Ideally we would test `end-of-this-message' against the result
;; of `window-end', but that doesn't account for the fact that
- ;; the end of the message might be hidden, so we have to actually
- ;; go to the end, walk back over invisible text and then see if
- ;; point is visible.
- ((save-excursion
- (goto-char (- end-of-this-message 1))
- (notmuch-show-move-past-invisible-backward)
- (> (point) (window-end)))
+ ;; the end of the message might be hidden.
+ ((and visible-end-of-this-message
+ (> visible-end-of-this-message (window-end)))
;; The bottom of this message is not visible - scroll.
(scroll-up nil))