Re: [PATCH 1/1] emacs: removed 3 duplicate functions from notmuch-show.el
authorMark Walters <markwalters1009@gmail.com>
Mon, 26 Aug 2013 21:27:57 +0000 (22:27 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:56:41 +0000 (09:56 -0800)
b2/5289b86a00101b71b31757e2608d0e4af04554 [new file with mode: 0644]

diff --git a/b2/5289b86a00101b71b31757e2608d0e4af04554 b/b2/5289b86a00101b71b31757e2608d0e4af04554
new file mode 100644 (file)
index 0000000..99089fc
--- /dev/null
@@ -0,0 +1,148 @@
+Return-Path: <m.walters@qmul.ac.uk>\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 3F369431FD4\r
+       for <notmuch@notmuchmail.org>; Mon, 26 Aug 2013 14:28:22 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -1.098\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5\r
+       tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,\r
+       NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] 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 V6rTTRrlsv3B for <notmuch@notmuchmail.org>;\r
+       Mon, 26 Aug 2013 14:28:06 -0700 (PDT)\r
+Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])\r
+       (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 25F5D431FAF\r
+       for <notmuch@notmuchmail.org>; Mon, 26 Aug 2013 14:28:06 -0700 (PDT)\r
+Received: from smtp.qmul.ac.uk ([138.37.6.40])\r
+       by mail2.qmul.ac.uk with esmtp (Exim 4.71)\r
+       (envelope-from <m.walters@qmul.ac.uk>)\r
+       id 1VE4KO-0002OR-6P; Mon, 26 Aug 2013 22:28:02 +0100\r
+Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost)\r
+       by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71)\r
+       (envelope-from <m.walters@qmul.ac.uk>)\r
+       id 1VE4KN-0006LQ-TZ; Mon, 26 Aug 2013 22:28:00 +0100\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: Tomi Ollila <tomi.ollila@iki.fi>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH 1/1] emacs: removed 3 duplicate functions from\r
+       notmuch-show.el\r
+In-Reply-To: <1377548517-17130-1-git-send-email-tomi.ollila@iki.fi>\r
+References: <1377548517-17130-1-git-send-email-tomi.ollila@iki.fi>\r
+User-Agent: Notmuch/0.15.2+269~g01f5508 (http://notmuchmail.org) Emacs/23.4.1\r
+       (x86_64-pc-linux-gnu)\r
+Date: Mon, 26 Aug 2013 22:27:57 +0100\r
+Message-ID: <87mwo4dtwi.fsf@qmul.ac.uk>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-Sender-Host-Address: 93.97.24.31\r
+X-QM-SPAM-Info: Sender has good ham record.  :)\r
+X-QM-Body-MD5: 38821d11b1f0d5101fb0fe214ad2739d (of first 20000 bytes)\r
+X-SpamAssassin-Score: 0.0\r
+X-SpamAssassin-SpamBar: /\r
+X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
+       determine if it is\r
+       spam. We require at least 5.0 points to mark a message as spam.\r
+       This message scored 0.0 points. Summary of the scoring: \r
+       * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\r
+       provider *      (markwalters1009[at]gmail.com)\r
+       *  0.0 AWL AWL: From: address is in the auto white-list\r
+X-QM-Scan-Virus: ClamAV says the message is clean\r
+Cc: tomi.ollila@iki.fi\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: Mon, 26 Aug 2013 21:28:22 -0000\r
+\r
+\r
+This LGTM +1\r
+\r
+Mark\r
+\r
+On Mon, 26 Aug 2013, Tomi Ollila <tomi.ollila@iki.fi> wrote:\r
+> notmuch-show.el and notmuch.el had 3 duplicate, identical functions:\r
+> notmuch-foreach-mime-part, notmuch-count-attachments and\r
+> notmuch-save-attachments. Now these functions in notmuch-show.el\r
+> are replaced with declare-functions pointing to "notmuch"(.el).\r
+> ---\r
+>  emacs/notmuch-show.el | 39 +++------------------------------------\r
+>  1 file changed, 3 insertions(+), 36 deletions(-)\r
+>\r
+> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+> index 82b70ba..2896aae 100644\r
+> --- a/emacs/notmuch-show.el\r
+> +++ b/emacs/notmuch-show.el\r
+> @@ -41,6 +41,9 @@\r
+>  (declare-function notmuch-search-next-thread "notmuch" nil)\r
+>  (declare-function notmuch-search-previous-thread "notmuch" nil)\r
+>  (declare-function notmuch-search-show-thread "notmuch" nil)\r
+> +(declare-function notmuch-foreach-mime-part "notmuch" (function mm-handle))\r
+> +(declare-function notmuch-count-attachments "notmuch" (mm-handle))\r
+> +(declare-function notmuch-save-attachments "notmuch" (mm-handle &optional queryp))\r
+>  \r
+>  (defcustom notmuch-message-headers '("Subject" "To" "Cc" "Date")\r
+>    "Headers that should be shown in a message, in this order.\r
+> @@ -237,42 +240,6 @@ For example, if you wanted to remove an \"unread\" tag and add a\r
+>                               )))\r
+>       (mm-display-parts (mm-dissect-buffer)))))\r
+>  \r
+> -(defun notmuch-foreach-mime-part (function mm-handle)\r
+> -  (cond ((stringp (car mm-handle))\r
+> -         (dolist (part (cdr mm-handle))\r
+> -           (notmuch-foreach-mime-part function part)))\r
+> -        ((bufferp (car mm-handle))\r
+> -         (funcall function mm-handle))\r
+> -        (t (dolist (part mm-handle)\r
+> -             (notmuch-foreach-mime-part function part)))))\r
+> -\r
+> -(defun notmuch-count-attachments (mm-handle)\r
+> -  (let ((count 0))\r
+> -    (notmuch-foreach-mime-part\r
+> -     (lambda (p)\r
+> -       (let ((disposition (mm-handle-disposition p)))\r
+> -         (and (listp disposition)\r
+> -              (or (equal (car disposition) "attachment")\r
+> -                  (and (equal (car disposition) "inline")\r
+> -                       (assq 'filename disposition)))\r
+> -              (incf count))))\r
+> -     mm-handle)\r
+> -    count))\r
+> -\r
+> -(defun notmuch-save-attachments (mm-handle &optional queryp)\r
+> -  (notmuch-foreach-mime-part\r
+> -   (lambda (p)\r
+> -     (let ((disposition (mm-handle-disposition p)))\r
+> -       (and (listp disposition)\r
+> -            (or (equal (car disposition) "attachment")\r
+> -                (and (equal (car disposition) "inline")\r
+> -                     (assq 'filename disposition)))\r
+> -            (or (not queryp)\r
+> -                (y-or-n-p\r
+> -                 (concat "Save '" (cdr (assq 'filename disposition)) "' ")))\r
+> -            (mm-save-part p))))\r
+> -   mm-handle))\r
+> -\r
+>  (defun notmuch-show-save-attachments ()\r
+>    "Save all attachments from the current message."\r
+>    (interactive)\r
+> -- \r
+> 1.8.0\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r