aboutsummaryrefslogtreecommitdiffhomepage
path: root/notmuch.el
diff options
context:
space:
mode:
authorGravatar Carl Worth <cworth@cworth.org>2009-11-04 10:43:07 -0800
committerGravatar Carl Worth <cworth@cworth.org>2009-11-04 11:02:40 -0800
commitc5672ca12a1694a64376141f1ac9f65312d7ccb0 (patch)
treeb21d834905e2cf16ad54d77ca28296e30117cd6d /notmuch.el
parent3effd82ace9bfb2fa1aa32bfcd054abf849a63c4 (diff)
notmuch.el: Leave a blank line after last thread in search.
This allows for pleasant termination of the "show next thread" magic in notmuch-show mode. Now, it will terminate and show the notmuch-search results rather than continually displaying the last thread over and over.
Diffstat (limited to 'notmuch.el')
-rw-r--r--notmuch.el12
1 files changed, 4 insertions, 8 deletions
diff --git a/notmuch.el b/notmuch.el
index e15921bc..16ca037e 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -428,7 +428,7 @@ thread from that buffer can be show when done with this one)."
"Move point to the last thread in the buffer."
(interactive "^P")
(end-of-buffer arg)
- (beginning-of-line))
+ (forward-line -1))
;;;###autoload
(defun notmuch-search-mode ()
@@ -497,7 +497,9 @@ global search.
(interactive)
(let ((thread-id (notmuch-search-find-thread-id)))
(forward-line)
- (notmuch-show thread-id (current-buffer))))
+ (if (> (length thread-id) 0)
+ (notmuch-show thread-id (current-buffer))
+ (error "End of search results"))))
(defun notmuch-call-notmuch-process (&rest args)
(let ((error-buffer (get-buffer-create "*Notmuch errors*")))
@@ -569,12 +571,6 @@ This function advances point to the next line when finished."
(save-excursion
(call-process "notmuch" nil t nil "search" query)
(notmuch-search-markup-thread-ids)
- ; A well-behaved program ends its output with a newline, but we
- ; don't actually want the blank line at the end of the file.
- (goto-char (point-max))
- (if (looking-at "^$")
- (delete-backward-char 1)
- )
))))
(defun notmuch-search-refresh-view ()