Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 166CE431FAF for ; Thu, 19 Jan 2012 21:53:46 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.699 X-Spam-Level: X-Spam-Status: No, score=-0.699 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, 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 TYEKiBC1cMSL for ; Thu, 19 Jan 2012 21:53:45 -0800 (PST) Received: from mail-qw0-f53.google.com (mail-qw0-f53.google.com [209.85.216.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 2AEA7431FAE for ; Thu, 19 Jan 2012 21:53:45 -0800 (PST) Received: by qabg24 with SMTP id g24so166088qab.5 for ; Thu, 19 Jan 2012 21:53:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-type:content-transfer-encoding; bh=NbEpseEEe7zp5nzdDM0oUUsuEPMKK8i2g4oaPpEzbq8=; b=a5pt8su5b7iwg00Id+QXLIT83FUf9wz3VmxPmtbf4MdhmuwXf9ux7eAJmwa4DyZQtq 5zVQ4upbllHh6S53MN3DKus3Pyvj+NDbOjpCoJSyIlpv6rBH/GZB5UvDWokrHZwSQflM H8EzkzF/OrGy3FQB1CND5TxLfFly9wIGTwpR4= Received: by 10.224.108.202 with SMTP id g10mr31176908qap.24.1327038823429; Thu, 19 Jan 2012 21:53:43 -0800 (PST) Received: from localhost (c-68-80-94-73.hsd1.pa.comcast.net. [68.80.94.73]) by mx.google.com with ESMTPS id f12sm4390740qad.15.2012.01.19.21.53.41 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 19 Jan 2012 21:53:42 -0800 (PST) Sender: Aaron Ecay From: Aaron Ecay To: Adam Wolfe Gordon Subject: Re: [PATCH v3 5/5] emacs: Use message-citation-line-format in reply In-Reply-To: References: <1326995217-27423-1-git-send-email-awg+notmuch@xvx.ca> <1326995217-27423-6-git-send-email-awg+notmuch@xvx.ca> User-Agent: Notmuch/0.11+73~gd51b784 (http://notmuchmail.org) Emacs/24.0.92.2 (i386-apple-darwin10.8.0) Date: Fri, 20 Jan 2012 00:53:39 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: Fri, 20 Jan 2012 05:53:46 -0000 On Thu, 19 Jan 2012 21:46:46 -0700, Adam Wolfe Gordon = wrote: > On Thu, Jan 19, 2012 at 11:45, Aaron Ecay wrote: > > Shouldn=E2=80=99t this just use message-insert-formatted-citation-line? >=20 > Yes, good idea. I just tried this and it almost works. The only > issue is that the default message-mode-citation-line-format has a > newline at the end, and this function inserts an *additional* newline, > so we end up with a blank line before the beginning of the quoted > text. This is fixable by the user, of course, but it means the > default out-of-the-box setup will create funny-looking replies, which > is probably bad. Thoughts? (let ((message-citation-line-format (remove ?\n message-citation-line-format))) ...) (Or, if you think someone might have a newline other than at the end of the string, you could do something a little more complicated to remove only a newline at the end.) Or you could introduce a new defcustom =E2=80=98notmuch-message-citation-line-format=E2=80=99 (with newline-less d= efault), and let-bind m-l-c-f to that value. But that is pretty ugly =E2=80=93 we don= =E2=80=99t want to have to =E2=80=9Cwrap=E2=80=9D every variable whose default we don=E2=80= =99t like. > I've also tried using message-cite-original to create the reply body, > and it also almost works. The issue, again, is one of defaults. In > addition to the blank line I mentioned above, the default > message-citation-line-function inserts the "plain" citation line "Foo > writes:" instead of the formatted one. This is a big > change from the current notmuch default. >=20 > If everyone's OK with this and willing to customize it themselves, > then I'm happy to go with this solution, but I'm pretty reluctant to > change the default in such a significant way. I=E2=80=99m personally of the opinion that notmuch should just say =E2=80= =9Cthe mail composition facility is provided by message mode (here is the documentation on customizing it)=E2=80=9D. Message mode is 8,000 lines of elisp. We have the choice to: - write our own message composition mode - wrap (as explained above) the default message-mode variables we don=E2=80= =99t like in notmuch-prefixed variants, with suitable let-bindings. - use only the parts of message-mode that we like - pass composition off to message mode The first option just doesn=E2=80=99t make sense. The second is also a lit= tle nuts. The third is what we are trying now, but it=E2=80=99s painful =E2=80= =93 the message mode code has its own structure and its own defaults, which don=E2=80=99t always agree with notmuch=E2=80=99s. I am in favor of the fo= urth =E2=80=93 notmuch=E2=80=99s elisp code should pass data to message mode in the most l= ow level form it can, and let message mode do any extra work in the way it already does. And users should customize message composition via message mode, not notmuch. There=E2=80=99s a tradeoff to this approach =E2= =80=93 by controlling more within notmuch, we can have nicer defaults at the expense of more brittle code and/or fewer user-visible customizations. This is not in any way a criticism of your work (which is great) =E2=80=93 you=E2=80=99re right that you need =E2=80=9Cpermission=E2=80=9D to uproot t= he defaults, and I=E2=80=99m advocating for it to be given. One possible step that might ease the transition pain could be for notmuch=E2=80=99s emacs interface to have a configuration file (similar to Wanderlust=E2=80=99s ~/.wl; I believe Gnus also uses a ~/.gnus). The idea = is that this file contains elisp code, and is loaded by notmuch the first time any notmuch-related commands are invoked by the user. If the file does not exist, notmuch could create it with default content that sets message-citation-function, message-citation-line-format, message-yank-prefix (to get rid of the ugly default whereby message-mode indents the original message by four spaces instead of inserting =E2=80=9C>= =E2=80=9D), etc. If there is interest in this approach, I=E2=80=99d be happy to work o= n a patch for it. I=E2=80=99ve sort of stumped for this idea before (id:"m239bgcd1d.fsf@gmail.com") and it didn=E2=80=99t exactly get rave revi= ews. So I=E2=80=99ll shut up if it=E2=80=99s really not something people want to= see. I=E2=80=99ll close with an example of a nice feature that message mode has (which I=E2=80=99ve been really wanting since the reply keybindings changed) that notmuch would get for free if it hooked into message mode better: the function message-widen-reply takes a reply-to-sender message and makes it reply-to-all. --=20 Aaron Ecay