From 0720815573a879fd44ba8732fee91f6d2bad887b Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Sat, 2 Jan 2016 17:47:43 +0100 Subject: [PATCH] [PATCH 1/3] emacs: Fix mail composition under Emacs 23 --- 78/796de7c53a824de68a254c2e2ffe95d8b844f1 | 110 ++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 78/796de7c53a824de68a254c2e2ffe95d8b844f1 diff --git a/78/796de7c53a824de68a254c2e2ffe95d8b844f1 b/78/796de7c53a824de68a254c2e2ffe95d8b844f1 new file mode 100644 index 000000000..494b2225b --- /dev/null +++ b/78/796de7c53a824de68a254c2e2ffe95d8b844f1 @@ -0,0 +1,110 @@ +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 A0D9E6DE191A + for ; Sat, 2 Jan 2016 08:48:03 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: -1.614 +X-Spam-Level: +X-Spam-Status: No, score=-1.614 tagged_above=-999 required=5 tests=[AWL=1.236, + RCVD_IN_DNSWL_MED=-2.3, RP_MATCHES_RCVD=-0.55] 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 iekFImv3hjQf for ; + Sat, 2 Jan 2016 08:48:01 -0800 (PST) +Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36]) + by arlo.cworth.org (Postfix) with ESMTP id 830D86DE1926 + for ; Sat, 2 Jan 2016 08:47:58 -0800 (PST) +Received: from localhost (unknown [192.168.200.7]) + by max.feld.cvut.cz (Postfix) with ESMTP id 4953719F4167 + for ; Sat, 2 Jan 2016 17:47:56 +0100 (CET) +X-Virus-Scanned: IMAP STYX AMAVIS +Received: from max.feld.cvut.cz ([192.168.200.1]) + by localhost (styx.feld.cvut.cz [192.168.200.7]) (amavisd-new, port 10044) + with ESMTP id 69wjx29IaTDu for ; + Sat, 2 Jan 2016 17:47:54 +0100 (CET) +Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34]) + by max.feld.cvut.cz (Postfix) with ESMTP id 7CCC719F48CD + for ; Sat, 2 Jan 2016 17:47:53 +0100 (CET) +Received: from wsh by steelpick.2x.cz with local (Exim 4.86) + (envelope-from ) + id 1aFPLM-0007BF-61; Sat, 02 Jan 2016 17:47:52 +0100 +From: Michal Sojka +To: notmuch@notmuchmail.org +Subject: [PATCH 1/3] emacs: Fix mail composition under Emacs 23 +Date: Sat, 2 Jan 2016 17:47:43 +0100 +Message-Id: <1451753265-26713-2-git-send-email-sojkam1@fel.cvut.cz> +X-Mailer: git-send-email 2.6.4 +In-Reply-To: <1451753265-26713-1-git-send-email-sojkam1@fel.cvut.cz> +References: <1451753265-26713-1-git-send-email-sojkam1@fel.cvut.cz> +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: Sat, 02 Jan 2016 16:48:03 -0000 + +Commit 570c0aeb40bd0c3af8174624a55e968f62c44f09 reworked +notmuch-mua-mail function in a way that worked only under Emacs 24. +The reason was that message-setup-1 took one argument less in Emacs +23. + +We fix this by only supplying the return-action argument when it is +actually set by the caller. +--- + emacs/notmuch-mua.el | 30 ++++++++++++++++++------------ + 1 file changed, 18 insertions(+), 12 deletions(-) + +diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el +index a66a306..d4950cb 100644 +--- a/emacs/notmuch-mua.el ++++ b/emacs/notmuch-mua.el +@@ -320,18 +320,24 @@ modified. This function is notmuch addaptation of + (notmuch-user-name) " <" (notmuch-user-primary-email) ">")) other-headers)) + + (notmuch-mua-pop-to-buffer (message-buffer-name "mail" to)) +- (message-setup-1 +- ;; The following sexp is copied from `message-mail' +- (nconc +- `((To . ,(or to "")) (Subject . ,(or subject ""))) +- ;; C-h f compose-mail says that headers should be specified as +- ;; (string . value); however all the rest of message expects +- ;; headers to be symbols, not strings (eg message-header-format-alist). +- ;; http://lists.gnu.org/archive/html/emacs-devel/2011-01/msg00337.html +- ;; We need to convert any string input, eg from rmail-start-mail. +- (dolist (h other-headers other-headers) +- (if (stringp (car h)) (setcar h (intern (capitalize (car h))))))) +- yank-action send-actions return-action) ++ (let ((args (list yank-action send-actions))) ++ ;; message-setup-1 in Emacs 23 does not accept return-action ++ ;; argument. Pass it only if it is supplied by the caller. This ++ ;; will never be the case when we're called by `compose-mail' in ++ ;; Emacs 23. ++ (when return-action (nconc args '(return-action))) ++ (apply 'message-setup-1 ++ ;; The following sexp is copied from `message-mail' ++ (nconc ++ `((To . ,(or to "")) (Subject . ,(or subject ""))) ++ ;; C-h f compose-mail says that headers should be specified as ++ ;; (string . value); however all the rest of message expects ++ ;; headers to be symbols, not strings (eg message-header-format-alist). ++ ;; http://lists.gnu.org/archive/html/emacs-devel/2011-01/msg00337.html ++ ;; We need to convert any string input, eg from rmail-start-mail. ++ (dolist (h other-headers other-headers) ++ (if (stringp (car h)) (setcar h (intern (capitalize (car h))))))) ++ args)) + (notmuch-fcc-header-setup) + (message-sort-headers) + (message-hide-headers) +-- +2.6.4 + -- 2.26.2