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 61EF06DE12B0 for ; Sat, 8 Oct 2016 13:05:30 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.009 X-Spam-Level: X-Spam-Status: No, score=0.009 tagged_above=-999 required=5 tests=[AWL=-0.121, 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 sB_yfjGPRID2 for ; Sat, 8 Oct 2016 13:05:29 -0700 (PDT) Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by arlo.cworth.org (Postfix) with ESMTPS id 68FE66DE128E for ; Sat, 8 Oct 2016 13:05:29 -0700 (PDT) Received: by mail-wm0-f67.google.com with SMTP id 123so7999364wmb.3 for ; Sat, 08 Oct 2016 13:05:29 -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=v5q8qB67OA/pyA2+ghc/YoNuFHKcuPhNXVefEIbCmS8=; b=Yo/dkotojVEwH6dpGPwwqL3/n4DLBKiTfCzI0ctV0fCBCnZXnQt01f0bb+J5F8VCag azSmQ14ABzvuvdlc0MFomfZrM0Q35qyA8GuZQYABNjyymK3GhFFAuay22CJsh2q01xZg z7tdxKbz5E13wejOzjBZDLDUXO9Vfc+xZYuZaFHXdU5yVmkORzydS7q7V9nrIovzZEqL jC68ycDhQM+/+4ZrYdTKf/lADBG4LmXOPcbcBhhQX99taJHJ9tH294vlHfeVnqakfQ8s eI+mdxabWGf+nR0oWSjZEnGs59gf8Uja4aQFmQAKFFXApzC/tgebWvM+jZC/8U/iB6ks b/Mg== 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=v5q8qB67OA/pyA2+ghc/YoNuFHKcuPhNXVefEIbCmS8=; b=fBsGlfqWL99evRhVAfhaV8HJWLF4Chav3Rp70p4bIyDlqAGWamQim7ZWKcAtlz5x3H Y9ADUYy8VhQQ1ihaTL/9xRilXajuNxHVuNPf3JFouoKbcBawzUa9TtrhodO91vGMarWY V9tbbgXFbatMjiPd1onaXgR/3mQbQVt4wYDoLxSJj4sU+9P8WorxdZx8xc4qznJsKjbu IU/K8gtgMzxrAMRD0IGSPPJFbzY6fp7hyIeEKY5dUb624aIOBjYVKC2w+Myp+2MfeOXz ezNB28gJmihcFlqY0L0Vl7q4qVN5o/Dj6pk7FwM67wUqeo5Bu1Ha+VxTAir6RoSC8Qz+ LpVg== X-Gm-Message-State: AA6/9RmsDLOb8vAh3OXGyEZWiijsno/970F/rEF8CMtnfMgyltPerlY6bpwyLD5NglMnOg== X-Received: by 10.28.131.149 with SMTP id f143mr3697215wmd.120.1475957127745; Sat, 08 Oct 2016 13:05:27 -0700 (PDT) Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162]) by smtp.gmail.com with ESMTPSA id p9sm8245249wjs.11.2016.10.08.13.05.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 08 Oct 2016 13:05:26 -0700 (PDT) From: Mark Walters To: notmuch@notmuchmail.org Subject: [PATCH v4 1/2] emacs: mua: extract a common message-send function. Date: Sat, 8 Oct 2016 21:05:22 +0100 Message-Id: <1475957123-6920-2-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1475957123-6920-1-git-send-email-markwalters1009@gmail.com> References: <1475957123-6920-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: Sat, 08 Oct 2016 20:05:30 -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-common (arg &optional exit) + (interactive "P") + (letf (((symbol-function 'message-do-fcc) #'notmuch-maildir-message-do-fcc)) + (if exit + (message-send-and-exit arg) + (message-send arg)))) + (defun notmuch-mua-send-and-exit (&optional arg) (interactive "P") - (letf (((symbol-function 'message-do-fcc) #'notmuch-maildir-message-do-fcc)) - (message-send-and-exit arg))) + (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