--- /dev/null
+Return-Path: <pieter@praet.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id DEA0C431E64\r
+ for <notmuch@notmuchmail.org>; Wed, 1 Feb 2012 05:52:17 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id pf5JMIuSfMIz for <notmuch@notmuchmail.org>;\r
+ Wed, 1 Feb 2012 05:52:17 -0800 (PST)\r
+Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com\r
+ [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client\r
+ certificate requested) by olra.theworths.org (Postfix) with ESMTPS id\r
+ 1E345431FAF for <notmuch@notmuchmail.org>; Wed, 1 Feb 2012 05:52:16 -0800\r
+ (PST)\r
+Received: by wgbdt12 with SMTP id dt12so1145428wgb.2\r
+ for <notmuch@notmuchmail.org>; Wed, 01 Feb 2012 05:52:15 -0800 (PST)\r
+Received: by 10.180.106.33 with SMTP id gr1mr41774252wib.6.1328104335813;\r
+ Wed, 01 Feb 2012 05:52:15 -0800 (PST)\r
+Received: from localhost ([109.131.39.11])\r
+ by mx.google.com with ESMTPS id n3sm73881488wiz.9.2012.02.01.05.52.14\r
+ (version=TLSv1/SSLv3 cipher=OTHER);\r
+ Wed, 01 Feb 2012 05:52:15 -0800 (PST)\r
+From: Pieter Praet <pieter@praet.org>\r
+To: David Bremner <david@tethera.net>\r
+Subject: [PATCH v2] emacs: globally replace non-branching "(if COND (progn\r
+ ..." with "(when ..."\r
+Date: Wed, 1 Feb 2012 14:50:00 +0100\r
+Message-Id: <1328104200-13458-1-git-send-email-pieter@praet.org>\r
+X-Mailer: git-send-email 1.7.8.1\r
+In-Reply-To: <87y5sm64y1.fsf@praet.org>\r
+References: <87y5sm64y1.fsf@praet.org>\r
+Cc: Notmuch Mail <notmuch@notmuchmail.org>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 01 Feb 2012 13:52:18 -0000\r
+\r
+Less code, same results, without sacrificing readability.\r
+\r
+---\r
+\r
+Rebased to current master.\r
+\r
+ emacs/notmuch-show.el | 9 ++++-----\r
+ emacs/notmuch-wash.el | 47 +++++++++++++++++++++++------------------------\r
+ emacs/notmuch.el | 28 +++++++++++++---------------\r
+ 3 files changed, 40 insertions(+), 44 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+index de9421e..0a945ea 100644\r
+--- a/emacs/notmuch-show.el\r
++++ b/emacs/notmuch-show.el\r
+@@ -1364,11 +1364,10 @@ any effects from previous calls to\r
+ ;; If a small number of lines from the previous message are\r
+ ;; visible, realign so that the top of the current message is at\r
+ ;; the top of the screen.\r
+- (if (<= (count-screen-lines (window-start) start-of-message)\r
+- next-screen-context-lines)\r
+- (progn\r
+- (goto-char (notmuch-show-message-top))\r
+- (notmuch-show-message-adjust)))\r
++ (when (<= (count-screen-lines (window-start) start-of-message)\r
++ next-screen-context-lines)\r
++ (goto-char (notmuch-show-message-top))\r
++ (notmuch-show-message-adjust))\r
+ ;; Move to the top left of the window.\r
+ (goto-char (window-start)))\r
+ (t\r
+diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el\r
+index 5c1e830..67143e5 100644\r
+--- a/emacs/notmuch-wash.el\r
++++ b/emacs/notmuch-wash.el\r
+@@ -336,30 +336,29 @@ patch and then guesses the extent of the patch, there is scope\r
+ for error."\r
+ \r
+ (goto-char (point-min))\r
+- (if (re-search-forward diff-file-header-re nil t)\r
+- (progn\r
+- (beginning-of-line -1)\r
+- (let ((patch-start (point))\r
+- (patch-end (point-max))\r
+- part)\r
+- (goto-char patch-start)\r
+- (if (or\r
+- ;; Patch ends with signature.\r
+- (re-search-forward notmuch-wash-signature-regexp nil t)\r
+- ;; Patch ends with bugtraq comment.\r
+- (re-search-forward "^\\*\\*\\* " nil t))\r
+- (setq patch-end (match-beginning 0)))\r
+- (save-restriction\r
+- (narrow-to-region patch-start patch-end)\r
+- (setq part (plist-put part :content-type "inline-patch-fake-part"))\r
+- (setq part (plist-put part :content (buffer-string)))\r
+- (setq part (plist-put part :id -1))\r
+- (setq part (plist-put part :filename\r
+- (notmuch-wash-subject-to-patch-filename\r
+- (plist-get\r
+- (plist-get msg :headers) :Subject))))\r
+- (delete-region (point-min) (point-max))\r
+- (notmuch-show-insert-bodypart nil part depth))))))\r
++ (when (re-search-forward diff-file-header-re nil t)\r
++ (beginning-of-line -1)\r
++ (let ((patch-start (point))\r
++ (patch-end (point-max))\r
++ part)\r
++ (goto-char patch-start)\r
++ (if (or\r
++ ;; Patch ends with signature.\r
++ (re-search-forward notmuch-wash-signature-regexp nil t)\r
++ ;; Patch ends with bugtraq comment.\r
++ (re-search-forward "^\\*\\*\\* " nil t))\r
++ (setq patch-end (match-beginning 0)))\r
++ (save-restriction\r
++ (narrow-to-region patch-start patch-end)\r
++ (setq part (plist-put part :content-type "inline-patch-fake-part"))\r
++ (setq part (plist-put part :content (buffer-string)))\r
++ (setq part (plist-put part :id -1))\r
++ (setq part (plist-put part :filename\r
++ (notmuch-wash-subject-to-patch-filename\r
++ (plist-get\r
++ (plist-get msg :headers) :Subject))))\r
++ (delete-region (point-min) (point-max))\r
++ (notmuch-show-insert-bodypart nil part depth)))))\r
+ \r
+ ;;\r
+ \r
+diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
+index 72f78ed..5fa239a 100644\r
+--- a/emacs/notmuch.el\r
++++ b/emacs/notmuch.el\r
+@@ -673,17 +673,16 @@ This function advances the next thread when finished."\r
+ (goto-char (point-max))\r
+ (if (eq status 'signal)\r
+ (insert "Incomplete search results (search process was killed).\n"))\r
+- (if (eq status 'exit)\r
+- (progn\r
+- (if notmuch-search-process-filter-data\r
+- (insert (concat "Error: Unexpected output from notmuch search:\n" notmuch-search-process-filter-data)))\r
+- (insert "End of search results.")\r
+- (unless (= exit-status 0)\r
+- (insert (format " (process returned %d)" exit-status)))\r
+- (insert "\n")\r
+- (if (and atbob\r
+- (not (string= notmuch-search-target-thread "found")))\r
+- (set 'never-found-target-thread t))))))\r
++ (when (eq status 'exit)\r
++ (if notmuch-search-process-filter-data\r
++ (insert (concat "Error: Unexpected output from notmuch search:\n" notmuch-search-process-filter-data)))\r
++ (insert "End of search results.")\r
++ (unless (= exit-status 0)\r
++ (insert (format " (process returned %d)" exit-status)))\r
++ (insert "\n")\r
++ (if (and atbob\r
++ (not (string= notmuch-search-target-thread "found")))\r
++ (set 'never-found-target-thread t)))))\r
+ (when (and never-found-target-thread\r
+ notmuch-search-target-line)\r
+ (goto-char (point-min))\r
+@@ -861,10 +860,9 @@ non-authors is found, assume that all of the authors match."\r
+ (put-text-property beg (point) 'notmuch-search-thread-id thread-id)\r
+ (put-text-property beg (point) 'notmuch-search-authors authors)\r
+ (put-text-property beg (point) 'notmuch-search-subject subject)\r
+- (if (string= thread-id notmuch-search-target-thread)\r
+- (progn\r
+- (set 'found-target beg)\r
+- (set 'notmuch-search-target-thread "found"))))\r
++ (when (string= thread-id notmuch-search-target-thread)\r
++ (set 'found-target beg)\r
++ (set 'notmuch-search-target-thread "found")))\r
+ (set 'line (match-end 0)))\r
+ (set 'more nil)\r
+ (while (and (< line (length string)) (= (elt string line) ?\n))\r
+-- \r
+1.7.8.1\r
+\r