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 288FE429E26 for ; Tue, 18 Oct 2011 11:58:10 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 pR0asbpmO1zx for ; Tue, 18 Oct 2011 11:58:09 -0700 (PDT) Received: from mail-vx0-f181.google.com (mail-vx0-f181.google.com [209.85.220.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 71EDD429E25 for ; Tue, 18 Oct 2011 11:58:09 -0700 (PDT) Received: by vcbfk14 with SMTP id fk14so953285vcb.26 for ; Tue, 18 Oct 2011 11:58:07 -0700 (PDT) Received: by 10.52.38.4 with SMTP id c4mr3779705vdk.123.1318964287613; Tue, 18 Oct 2011 11:58:07 -0700 (PDT) Received: from doommachine (bensakone.com. [92.243.29.139]) by mx.google.com with ESMTPS id hl5sm2840795vdb.18.2011.10.18.11.58.04 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 18 Oct 2011 11:58:05 -0700 (PDT) Date: Tue, 18 Oct 2011 21:58:02 +0300 (EEST) From: Jani Nikula To: Thomas Jost Subject: Re: [PATCH v2] emacs: Support a message-mode switch function in notmuch-mua In-Reply-To: <1318362674-17652-1-git-send-email-schnouki@schnouki.net> Message-ID: References: <8739eztijn.fsf@schnouki.net> <1318362674-17652-1-git-send-email-schnouki@schnouki.net> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: notmuch@notmuchmail.org 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: Tue, 18 Oct 2011 18:58:10 -0000 Hi Thomas - AFAICT :options is not meaningful for a function type. I think you should use choice type for this instead. This allows sensible documentation for the choices in the customization interface too. I sent a patch earlier to fix a similar issue [1], please have a look at that for an example. (Unfortunately, it hasn't been applied, like many other emacs patches by me and others. I hope yours will make it. I've given up trying until I see some progress in that front.) [1] http://permalink.gmane.org/gmane.mail.notmuch.general/5602 BR, Jani. On Tue, 11 Oct 2011, Thomas Jost wrote: > --- > emacs/notmuch-mua.el | 21 +++++++++++++++++++-- > 1 files changed, 19 insertions(+), 2 deletions(-) > > diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el > index 8824b08..639407f 100644 > --- a/emacs/notmuch-mua.el > +++ b/emacs/notmuch-mua.el > @@ -31,6 +31,20 @@ > :group 'notmuch > :type 'hook) > > +(defcustom notmuch-mua-switch-function nil > + "Function used to switch to and display a new mail buffer. If > +this is `nil' then the buffer will be displayed in the current > +window. Other common values are `switch-to-buffer-other-frame' > +and `switch-to-buffer-other-window'. If you change this, you may > +also want to change `message-sent-hook' accordingly: > + (setq notmuch-muas-witch-function 'switch-to-buffer-other-frame) > + (add-hook 'message-sent-hook '(delete-frame))" > + :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 +113,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 +127,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 +216,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. >