aboutsummaryrefslogtreecommitdiffhomepage
path: root/emacs/notmuch-wash.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-wash.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-wash.el')
-rw-r--r--emacs/notmuch-wash.el47
1 files changed, 23 insertions, 24 deletions
diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el
index 5c1e8300..67143e53 100644
--- a/emacs/notmuch-wash.el
+++ b/emacs/notmuch-wash.el
@@ -336,30 +336,29 @@ patch and then guesses the extent of the patch, there is scope
for error."
(goto-char (point-min))
- (if (re-search-forward diff-file-header-re nil t)
- (progn
- (beginning-of-line -1)
- (let ((patch-start (point))
- (patch-end (point-max))
- part)
- (goto-char patch-start)
- (if (or
- ;; Patch ends with signature.
- (re-search-forward notmuch-wash-signature-regexp nil t)
- ;; Patch ends with bugtraq comment.
- (re-search-forward "^\\*\\*\\* " nil t))
- (setq patch-end (match-beginning 0)))
- (save-restriction
- (narrow-to-region patch-start patch-end)
- (setq part (plist-put part :content-type "inline-patch-fake-part"))
- (setq part (plist-put part :content (buffer-string)))
- (setq part (plist-put part :id -1))
- (setq part (plist-put part :filename
- (notmuch-wash-subject-to-patch-filename
- (plist-get
- (plist-get msg :headers) :Subject))))
- (delete-region (point-min) (point-max))
- (notmuch-show-insert-bodypart nil part depth))))))
+ (when (re-search-forward diff-file-header-re nil t)
+ (beginning-of-line -1)
+ (let ((patch-start (point))
+ (patch-end (point-max))
+ part)
+ (goto-char patch-start)
+ (if (or
+ ;; Patch ends with signature.
+ (re-search-forward notmuch-wash-signature-regexp nil t)
+ ;; Patch ends with bugtraq comment.
+ (re-search-forward "^\\*\\*\\* " nil t))
+ (setq patch-end (match-beginning 0)))
+ (save-restriction
+ (narrow-to-region patch-start patch-end)
+ (setq part (plist-put part :content-type "inline-patch-fake-part"))
+ (setq part (plist-put part :content (buffer-string)))
+ (setq part (plist-put part :id -1))
+ (setq part (plist-put part :filename
+ (notmuch-wash-subject-to-patch-filename
+ (plist-get
+ (plist-get msg :headers) :Subject))))
+ (delete-region (point-min) (point-max))
+ (notmuch-show-insert-bodypart nil part depth)))))
;;