aboutsummaryrefslogtreecommitdiffhomepage
path: root/emacs/notmuch.el
diff options
context:
space:
mode:
authorGravatar Pieter Praet <pieter@praet.org>2012-02-01 14:50:00 +0100
committerGravatar David Bremner <bremner@debian.org>2012-02-01 21:29:17 -0400
commit2dcd1e7234f9dd50ec41c7b09297f002c6572a86 (patch)
treeaee4f1951f6da19acf52f47ced526670f2751be6 /emacs/notmuch.el
parent7cd907b69c3134b00f8766571b17b669bd8a80c2 (diff)
emacs: globally replace non-branching "(if COND (progn ..." with "(when ..."
Less code, same results, without sacrificing readability.
Diffstat (limited to 'emacs/notmuch.el')
-rw-r--r--emacs/notmuch.el28
1 files changed, 13 insertions, 15 deletions
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 72f78edc..5fa239af 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -673,17 +673,16 @@ This function advances the next thread when finished."
(goto-char (point-max))
(if (eq status 'signal)
(insert "Incomplete search results (search process was killed).\n"))
- (if (eq status 'exit)
- (progn
- (if notmuch-search-process-filter-data
- (insert (concat "Error: Unexpected output from notmuch search:\n" notmuch-search-process-filter-data)))
- (insert "End of search results.")
- (unless (= exit-status 0)
- (insert (format " (process returned %d)" exit-status)))
- (insert "\n")
- (if (and atbob
- (not (string= notmuch-search-target-thread "found")))
- (set 'never-found-target-thread t))))))
+ (when (eq status 'exit)
+ (if notmuch-search-process-filter-data
+ (insert (concat "Error: Unexpected output from notmuch search:\n" notmuch-search-process-filter-data)))
+ (insert "End of search results.")
+ (unless (= exit-status 0)
+ (insert (format " (process returned %d)" exit-status)))
+ (insert "\n")
+ (if (and atbob
+ (not (string= notmuch-search-target-thread "found")))
+ (set 'never-found-target-thread t)))))
(when (and never-found-target-thread
notmuch-search-target-line)
(goto-char (point-min))
@@ -861,10 +860,9 @@ non-authors is found, assume that all of the authors match."
(put-text-property beg (point) 'notmuch-search-thread-id thread-id)
(put-text-property beg (point) 'notmuch-search-authors authors)
(put-text-property beg (point) 'notmuch-search-subject subject)
- (if (string= thread-id notmuch-search-target-thread)
- (progn
- (set 'found-target beg)
- (set 'notmuch-search-target-thread "found"))))
+ (when (string= thread-id notmuch-search-target-thread)
+ (set 'found-target beg)
+ (set 'notmuch-search-target-thread "found")))
(set 'line (match-end 0)))
(set 'more nil)
(while (and (< line (length string)) (= (elt string line) ?\n))