From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id F0B1D6DE0944 for ; Sun, 2 Oct 2016 07:05:42 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.002 X-Spam-Level: X-Spam-Status: No, score=-0.002 tagged_above=-999 required=5 tests=[AWL=-0.132, 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_NONE=-0.0001, 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 XmS1IUZw3_F6 for ; Sun, 2 Oct 2016 07:05:42 -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 17CBB6DE0931 for ; Sun, 2 Oct 2016 07:05:42 -0700 (PDT) Received: by mail-wm0-f65.google.com with SMTP id p138so10648082wmb.0 for ; Sun, 02 Oct 2016 07:05:42 -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=jtfU4r2JjYT+3GM6uniKXBnsRN3CjYpZMxTJ4Cnq18c=; b=iBlOJl2uqq57d3gz0YffF4hKbMgClwSQ5wb4iBAj99Uof+HcsoMwpKEJORJOHVkGE7 b5hh2+QH0qSCjblJmkJovxnICyiva2iexT7sfEx5H1DSnosEt2u3ZPgUdOYSbawzdC17 IcLmTsKkXc6dPwEhD2po82bs2ZKtSUwd4UJCtelJ3GNEX3Kv22RSYC3U42Q2KqAxBrBj M3p6FYAbDJl0V34DLTvuIlr+uy8WCVmmHI/tkhS5QwJ8R0R6FlTTY7g+ctRKaL4/W3y1 1k1uKOJ0yI9Fno8Zfa4XGQcSGpW4pN2UjfmQ2q+VSl0ywh1ruSQzQwW6dzSuF6v7yuWG nxNw== 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=jtfU4r2JjYT+3GM6uniKXBnsRN3CjYpZMxTJ4Cnq18c=; b=hltrzOkgvT/zHu3RjDCpqh9I22AXkfLGccKO6wucDS6xuemOnPcevHjsMIsX6VwUhC S9Hx1Wd5TL719iryWmY4c+Hc+witgx8yD9zF0DpVMXmwXIDzJTKvrg41DxKNk36Pu1vy 4m3Mm7SexrgYZer+rzOSd1W/jKFCy45DEJXFZuM+PMastHmhnQ2aBi7jIHmqHf4x2A/m HuXiW9uS44zXU9MKipz9uc9Oal7u76o9ejfN6531eLWXmmzkTmG5kA4na/RZpn9lXhFj qm7v5mHW6CcrAiLzA5tMj3aqlGdKSgav98dgy+aiFoQg4yoktqop+nidGWhNMQ3UvP5Y mF3w== X-Gm-Message-State: AA6/9RkJ4KUouJ4BFMtpcTbg2ZPtAK6/329Uq7c8QJ5VLrjHO02EPs17zzxGbFgGB9ywqw== X-Received: by 10.194.238.42 with SMTP id vh10mr13192825wjc.111.1475417140150; Sun, 02 Oct 2016 07:05:40 -0700 (PDT) Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162]) by smtp.gmail.com with ESMTPSA id xy4sm29547181wjc.2.2016.10.02.07.05.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Oct 2016 07:05:39 -0700 (PDT) From: Mark Walters To: notmuch@notmuchmail.org Subject: [PATCH 1/2] emacs: mua: extract a common message-send function. Date: Sun, 2 Oct 2016 15:05:30 +0100 Message-Id: <1475417131-24915-2-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1475417131-24915-1-git-send-email-markwalters1009@gmail.com> References: <1475417131-24915-1-git-send-email-markwalters1009@gmail.com> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 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: Sun, 02 Oct 2016 14:05:43 -0000 This commit adds a common message-send function for message-send and message-send-and-exit. At the moment the overlap is small, but the message-send function will get more complex. --- emacs/notmuch-mua.el | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el index 55bc267..72fb770 100644 --- a/emacs/notmuch-mua.el +++ b/emacs/notmuch-mua.el @@ -490,15 +490,20 @@ will be addressed to all recipients of the source message." (notmuch-mua-reply query-string sender reply-all) (deactivate-mark))) -(defun notmuch-mua-send-and-exit (&optional arg) +(defun notmuch-mua-send-common (arg &optional exit) (interactive "P") (letf (((symbol-function 'message-do-fcc) #'notmuch-maildir-message-do-fcc)) - (message-send-and-exit arg))) + (if exit + (message-send-and-exit arg) + (message-send arg)))) + +(defun notmuch-mua-send-and-exit (&optional arg) + (interactive "P") + (notmuch-mua-send-common arg 't)) (defun notmuch-mua-send (&optional arg) (interactive "P") - (letf (((symbol-function 'message-do-fcc) #'notmuch-maildir-message-do-fcc)) - (message-send arg))) + (notmuch-mua-send-common arg)) (defun notmuch-mua-kill-buffer () (interactive) -- 2.1.4