From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 2E7EF429E26 for ; Mon, 3 Oct 2011 05:04:18 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.1 X-Spam-Level: X-Spam-Status: No, score=-0.1 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KJAKnHXVhrrh for ; Mon, 3 Oct 2011 05:04:14 -0700 (PDT) Received: from ks3536.kimsufi.com (schnouki.net [87.98.217.222]) by olra.theworths.org (Postfix) with ESMTP id 8E8B8429E28 for ; Mon, 3 Oct 2011 05:04:08 -0700 (PDT) Received: from localhost.localdomain (thor.loria.fr [152.81.12.250]) by ks3536.kimsufi.com (Postfix) with ESMTPSA id E71D86A06B0; Mon, 3 Oct 2011 14:04:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=schnouki.net; s=key-schnouki; t=1317643447; bh=GaT7y/WnECehoFlSJZCm83i21iVuRFopbrLt4gsOB9c=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References; b=hnAuz8HJ21YYi+09Lz2UYYyP7NpV4ZR+5deOfryWWWOEKqwKtAEQbq99fsNPpX/h+ N7EknygjjUAazupRFfImX3ev7LDrbXDA6P+2H7nQvYoSbhJUphJDhQK976wIZ8Znzg +fgDhcc7xTwQ5IzBFBiQ4k9JxTr5HbxedaRvNekc= From: Thomas Jost To: notmuch@notmuchmail.org Subject: [PATCH 2/4] emacs: Support a message-mode switch function in notmuch-mua Date: Mon, 3 Oct 2011 14:03:56 +0200 Message-Id: <1317643438-31272-3-git-send-email-schnouki@schnouki.net> X-Mailer: git-send-email 1.7.6.4 In-Reply-To: <1317643438-31272-1-git-send-email-schnouki@schnouki.net> References: <1317643438-31272-1-git-send-email-schnouki@schnouki.net> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 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: Mon, 03 Oct 2011 12:04:18 -0000 --- emacs/notmuch-mua.el | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-) diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el index 8824b08..68c344e 100644 --- a/emacs/notmuch-mua.el +++ b/emacs/notmuch-mua.el @@ -31,6 +31,14 @@ :group 'notmuch :type 'hook) +(defcustom notmuch-mua-switch-function nil + "Function used to switch to and display a new mail buffer." + :group 'notmuch + :type 'function + :options '(nil + switch-to-buffer-other-frame + switch-to-buffer-other-window)) + (defcustom notmuch-mua-user-agent-function 'notmuch-mua-user-agent-full "Function used to generate a `User-Agent:' string. If this is `nil' then no `User-Agent:' will be generated." @@ -99,7 +107,8 @@ list." ((same-window-regexps '("\\*mail .*"))) (notmuch-mua-mail (mail-header 'to headers) (mail-header 'subject headers) - (message-headers-to-generate headers t '(to subject)))) + (message-headers-to-generate headers t '(to subject)) + nil notmuch-mua-switch-function)) ;; insert the message body - but put it in front of the signature ;; if one is present (goto-char (point-max)) @@ -112,6 +121,8 @@ list." (message-goto-body)) (defun notmuch-mua-forward-message () + (when notmuch-mua-switch-function + (funcall notmuch-mua-switch-function (current-buffer))) (message-forward) (when notmuch-mua-user-agent-function @@ -199,7 +210,7 @@ the From: address first." (let ((other-headers (when (or prompt-for-sender notmuch-always-prompt-for-sender) (list (cons 'from (notmuch-mua-prompt-for-sender)))))) - (notmuch-mua-mail nil nil other-headers))) + (notmuch-mua-mail nil nil other-headers nil notmuch-mua-switch-function))) (defun notmuch-mua-new-forward-message (&optional prompt-for-sender) "Invoke the notmuch message forwarding window. -- 1.7.6.4