From 9f1102702b79eb96a1fcb6bf61edf1ef52265989 Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Sat, 11 Jun 2016 00:02:50 +0100 Subject: [PATCH] [PATCH 4/6] emacs: simplify our local copy of message-do-fcc --- df/cb6612c6ae7a26024ae57895b775bce24d4665 | 150 ++++++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 df/cb6612c6ae7a26024ae57895b775bce24d4665 diff --git a/df/cb6612c6ae7a26024ae57895b775bce24d4665 b/df/cb6612c6ae7a26024ae57895b775bce24d4665 new file mode 100644 index 000000000..a55a365ed --- /dev/null +++ b/df/cb6612c6ae7a26024ae57895b775bce24d4665 @@ -0,0 +1,150 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by arlo.cworth.org (Postfix) with ESMTP id 32E306DE091C + for ; Fri, 10 Jun 2016 16:03:26 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: -0.336 +X-Spam-Level: +X-Spam-Status: No, score=-0.336 tagged_above=-999 required=5 tests=[AWL=0.234, + DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, + RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] + autolearn=disabled +Received: from arlo.cworth.org ([127.0.0.1]) + by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id c3BpuX6F3tyZ for ; + Fri, 10 Jun 2016 16:03:18 -0700 (PDT) +Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com + [74.125.82.65]) by arlo.cworth.org (Postfix) with ESMTPS id 0E8756DE02A6 for + ; Fri, 10 Jun 2016 16:03:09 -0700 (PDT) +Received: by mail-wm0-f65.google.com with SMTP id n184so1714048wmn.1 + for ; Fri, 10 Jun 2016 16:03:08 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:cc:subject:date:message-id:in-reply-to:references; + bh=gIV8dyppNyBRHkA9oCDL0xDKLJiIaJGjgz13raDHHBc=; + b=jp/A76npHBe6wFSWzub/14XDa5fj5c+7ZJd8bJ8Qnoy0kz/Y2j1ZPwn4FQmHxgCKNH + 1cn/p7VcDQPGt6LQvrD724yK7ySX4HheJ9gywnJVFxW2jIXXHp9zXLIwN/3cHUy8HcRe + BCZhcSv6DnznJvnsLeRL9YjSyhsy4Mjpp1+FiCrVmc+i3VXxkY0zYpe9SKiQhTfMed6n + TfKLHhW+PTYL1Dgt/2bOWnDpx3d/IfuPadRb2M+y1vpJ7nra7bq4XiY/AEP9eUtIQElc + LuCcqs7VxYQ7E/v/B1oVz4+agT6DBZNI9FwKT7YP/dIEqKCwDGpjbDa+7T9xxY9kWfu0 + jKcw== +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20130820; + h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to + :references; + bh=gIV8dyppNyBRHkA9oCDL0xDKLJiIaJGjgz13raDHHBc=; + b=hrPBoLziuDt2zv3f189QQDZP/Ohol6xQcw5kNGcCIBR+dYDMwNKQZwQ6AnJzjCqI37 + yYWAEFaqwhdgo8q/8Oxr6FZkzJRokoIdCA3w/YzOQHUGJch5XdbY7nsNi4MhS+SR8HA5 + nCCvDzZxDAs2ZltRQjuF0xb2/nB+FZfSGqkzgE28j824YZmytZ1NkZPgY/gFZj5tBQ9W + c1BQgGE0mM0nmwPUFbkwsxf/Z5okT868ZPIaOAnaAPR3r3Agdotby1DEw3buCUGWgFud + h89I2nxhrvv+H5AlQb6583npVQjnmvgGWYWobxi8z3SMA9aE5JlNMed9d9k23TKwt/Lr + Yf2A== +X-Gm-Message-State: + ALyK8tJuQ7ilkx82S2M44UhF7NIwXldQMpq08oU0eYK+rM8SNX/Qe5tyCTKmjlY40ryS9Q== +X-Received: by 10.28.228.86 with SMTP id b83mr981664wmh.11.1465599787650; + Fri, 10 Jun 2016 16:03:07 -0700 (PDT) +Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162]) + by smtp.gmail.com with ESMTPSA id r129sm1255989wmr.20.2016.06.10.16.03.06 + (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); + Fri, 10 Jun 2016 16:03:06 -0700 (PDT) +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: [PATCH 4/6] emacs: simplify our local copy of message-do-fcc +Date: Sat, 11 Jun 2016 00:02:50 +0100 +Message-Id: <1465599772-10297-5-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 2.1.4 +In-Reply-To: <1465599772-10297-1-git-send-email-markwalters1009@gmail.com> +References: <1465599772-10297-1-git-send-email-markwalters1009@gmail.com> +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.20 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Fri, 10 Jun 2016 23:03:26 -0000 + +message-do-fcc has lots of functionality we don't need, so remove it. +--- + emacs/notmuch-maildir-fcc.el | 24 +----------------------- + emacs/notmuch-mua.el | 11 ++++------- + 2 files changed, 5 insertions(+), 30 deletions(-) + +diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el +index 6fed11f..7b3f232 100644 +--- a/emacs/notmuch-maildir-fcc.el ++++ b/emacs/notmuch-maildir-fcc.el +@@ -159,29 +159,7 @@ This is a direct copy from message-mode's message-do-fcc." + ;; Process FCC operations. + (while list + (setq file (pop list)) +- (if (string-match "^[ \t]*|[ \t]*\\(.*\\)[ \t]*$" file) +- ;; Pipe the article to the program in question. +- (call-process-region (point-min) (point-max) shell-file-name +- nil nil nil shell-command-switch +- (match-string 1 file)) +- ;; Save the article. +- (setq file (expand-file-name file)) +- (unless (file-exists-p (file-name-directory file)) +- (make-directory (file-name-directory file) t)) +- (if (and message-fcc-handler-function +- (not (eq message-fcc-handler-function 'rmail-output))) +- (funcall message-fcc-handler-function file) +- ;; FIXME this option, rmail-output (also used if +- ;; message-fcc-handler-function is nil) is not +- ;; documented anywhere AFAICS. It should work in Emacs +- ;; 23; I suspect it does not work in Emacs 22. +- ;; FIXME I don't see the need for the two different cases here. +- ;; mail-use-rfc822 makes no difference (in Emacs 23),and +- ;; the third argument just controls \"Wrote file\" message. +- (if (and (file-readable-p file) (mail-file-babyl-p file)) +- (rmail-output file 1 nil t) +- (let ((mail-use-rfc822 t)) +- (rmail-output file 1 t t)))))) ++ (notmuch-fcc-handler file)) + (kill-buffer (current-buffer)))))) + + (defun notmuch-fcc-handler (fcc-header) +diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el +index 3c1c046..60ad6c3 100644 +--- a/emacs/notmuch-mua.el ++++ b/emacs/notmuch-mua.el +@@ -32,7 +32,6 @@ + + (declare-function notmuch-show-insert-body "notmuch-show" (msg body depth)) + (declare-function notmuch-fcc-header-setup "notmuch-maildir-fcc" ()) +-(declare-function notmuch-fcc-handler "notmuch-maildir-fcc" (destdir)) + (declare-function notmuch-maildir-message-do-fcc "notmuch-maildir-fcc" ()) + + ;; +@@ -491,15 +490,13 @@ will be addressed to all recipients of the source message." + + (defun notmuch-mua-send-and-exit (&optional arg) + (interactive "P") +- (let ((message-fcc-handler-function #'notmuch-fcc-handler)) +- (letf (((symbol-function 'message-do-fcc) #'notmuch-maildir-message-do-fcc)) +- (message-send-and-exit arg)))) ++ (letf (((symbol-function 'message-do-fcc) #'notmuch-maildir-message-do-fcc)) ++ (message-send-and-exit arg))) + + (defun notmuch-mua-send (&optional arg) + (interactive "P") +- (let ((message-fcc-handler-function #'notmuch-fcc-handler)) +- (letf (((symbol-function 'message-do-fcc) #'notmuch-maildir-message-do-fcc)) +- (message-send arg)))) ++ (letf (((symbol-function 'message-do-fcc) #'notmuch-maildir-message-do-fcc)) ++ (message-send arg))) + + (defun notmuch-mua-kill-buffer () + (interactive) +-- +2.1.4 + -- 2.26.2