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 A8B196DE19CB for ; Sat, 2 Jan 2016 08:48:02 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -1.61 X-Spam-Level: X-Spam-Status: No, score=-1.61 tagged_above=-999 required=5 tests=[AWL=1.240, 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 FC-srW3xjxo1 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 80A0A6DE191A 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 F311019F48F6 for ; Sat, 2 Jan 2016 17:47:55 +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 1JkxRsIzWXnD 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 821E919F48E1 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-0007BN-8F; Sat, 02 Jan 2016 17:47:52 +0100 From: Michal Sojka To: notmuch@notmuchmail.org Subject: [PATCH 3/3] emacs: Handle switch-function argument of notmuch-mua-mail Date: Sat, 2 Jan 2016 17:47:45 +0100 Message-Id: <1451753265-26713-4-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:02 -0000 notmuch-mua-mail ignored the switch-function argument and always used the function returned by notmuch-mua-get-switch-function instead. In order to support standard emacs interfaces (compose-mail in this case), this commit changes notmuch-mua-mail to use the switch-function argument if it is non-nil and notmuch-mua-get-switch-function otherwise. --- emacs/notmuch-mua.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el index 2d6825d..45a6daa 100644 --- a/emacs/notmuch-mua.el +++ b/emacs/notmuch-mua.el @@ -278,7 +278,7 @@ Note that these functions use `mail-citation-hook' if that is non-nil." (define-key notmuch-message-mode-map (kbd "C-c C-c") #'notmuch-mua-send-and-exit) (define-key notmuch-message-mode-map (kbd "C-c C-s") #'notmuch-mua-send) -(defun notmuch-mua-pop-to-buffer (name) +(defun notmuch-mua-pop-to-buffer (name switch-function) "Pop to buffer NAME, and warn if it already exists and is modified. This function is notmuch addaptation of `message-pop-to-buffer'." @@ -291,7 +291,7 @@ modified. This function is notmuch addaptation of (progn (gnus-select-frame-set-input-focus (window-frame window)) (select-window window)) - (funcall (notmuch-mua-get-switch-function) buffer) + (funcall switch-function buffer) (set-buffer buffer)) (when (and (buffer-modified-p) (not (prog1 @@ -299,7 +299,7 @@ modified. This function is notmuch addaptation of "Message already being composed; erase? ") (message nil)))) (error "Message being composed"))) - (funcall (notmuch-mua-get-switch-function) name) + (funcall switch-function name) (set-buffer name)) (erase-buffer) (notmuch-message-mode))) @@ -319,7 +319,8 @@ modified. This function is notmuch addaptation of (push (cons 'From (concat (notmuch-user-name) " <" (notmuch-user-primary-email) ">")) other-headers)) - (notmuch-mua-pop-to-buffer (message-buffer-name "mail" to)) + (notmuch-mua-pop-to-buffer (message-buffer-name "mail" to) + (or switch-function (notmuch-mua-get-switch-function))) (let ((headers ;; The following sexp is copied from `message-mail' (nconc -- 2.6.4