--- /dev/null
+Return-Path: <jani@nikula.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id D0AB7431FC2\r
+ for <notmuch@notmuchmail.org>; Sun, 14 Dec 2014 01:46:48 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id UETCA3V8q4dO for <notmuch@notmuchmail.org>;\r
+ Sun, 14 Dec 2014 01:46:45 -0800 (PST)\r
+Received: from mail-wg0-f42.google.com (mail-wg0-f42.google.com\r
+ [74.125.82.42]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client\r
+ certificate requested) by olra.theworths.org (Postfix) with ESMTPS id\r
+ 4C358431FB6 for <notmuch@notmuchmail.org>; Sun, 14 Dec 2014 01:46:45 -0800\r
+ (PST)\r
+Received: by mail-wg0-f42.google.com with SMTP id z12so12446263wgg.15\r
+ for <notmuch@notmuchmail.org>; Sun, 14 Dec 2014 01:46:44 -0800 (PST)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=1e100.net; s=20130820;\r
+ h=x-gm-message-state:from:to:subject:in-reply-to:references\r
+ :user-agent:date:message-id:mime-version:content-type\r
+ :content-transfer-encoding;\r
+ bh=OLtu8CEAEpqqosmiKq6GBHdamS9eQqwoLrjLyCMCx9A=;\r
+ b=Ky+22ZpTyXRLEuaBoMjJTQSAS43rAzDIM86N5//ENJjvn+FAxxrN7BfoAsIV2WUlLz\r
+ MMs+ybe5i12L+8D9aX/uQ3vOxsI1JCbAxxDz3wu61E634zADJV/dt00wVjgnVJr8YZ3S\r
+ FheqBM003X7uhgJrO2JV4vdzktATJoQcyhwZBCvJ8whZm6ULqR+mojz4wjcOgUDV6h3P\r
+ y1KRgmcE8Pus4t8eE621LjLd2UqH4ohqA2pQWe52Q5hP+X9dNzhv4SEAkhrRcwNHEkew\r
+ k0ynQVBgcOqlLxGbSmB4fOhUW0jWcGjx/WncmDBcEn+j30VbDQMr+I86Fih/+MYKfCSN\r
+ jPpA==\r
+X-Gm-Message-State:\r
+ ALoCoQkEiO3ChZSpwwBYFuSfR79kfmvgAQm6TJDKzuc+RzZSePqJgynnUfqNENtuItlD5TE77UT8\r
+X-Received: by 10.194.48.109 with SMTP id k13mr43426136wjn.7.1418550404131;\r
+ Sun, 14 Dec 2014 01:46:44 -0800 (PST)\r
+Received: from localhost (dsl-hkibrasgw2-58c37d-174.dhcp.inet.fi.\r
+ [88.195.125.174])\r
+ by mx.google.com with ESMTPSA id f7sm8771928wiz.13.2014.12.14.01.46.43\r
+ for <multiple recipients>\r
+ (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+ Sun, 14 Dec 2014 01:46:43 -0800 (PST)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: Lukasz Stelmach <stlman@poczta.fm>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] emacs: do not change users' mail agent configuration\r
+In-Reply-To: <548CB582.4040807@poczta.fm>\r
+References: <1418410466-26604-1-git-send-email-stlman@poczta.fm>\r
+ <87k31vqn1h.fsf@nikula.org> <548CB582.4040807@poczta.fm>\r
+User-Agent: Notmuch/0.19+3~g7585e8c (http://notmuchmail.org) Emacs/24.4.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Sun, 14 Dec 2014 11:46:48 +0200\r
+Message-ID: <87h9wyr2bb.fsf@nikula.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=utf-8\r
+Content-Transfer-Encoding: quoted-printable\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 14 Dec 2014 09:46:49 -0000\r
+\r
+On Sat, 13 Dec 2014, Lukasz Stelmach <stlman@poczta.fm> wrote:\r
+> On 13.12.2014 22:04, Jani Nikula wrote:\r
+>> On Fri, 12 Dec 2014, =C5=81ukasz Stelmach <stlman@poczta.fm> wrote:\r
+>>> `mail-user-agent' is defined with defcustom and may be customised\r
+>>> by users. It should not be set to arbitrary values in modules.\r
+>>=20\r
+>> Point taken.\r
+>>=20\r
+>>> To make use of that configuration value call `compose-mail' which\r
+>>> starts user's preferred mail composition package as selected with\r
+>>> the variable `mail-user-agent' instead of notmuch's hardcoded\r
+>>> `message-mail'.\r
+>>=20\r
+>> So your proposed change is that `notmuch-mua-mail` should start\r
+>> whichever mua the user has configured in `mail-user-agent` instead of\r
+>> the notmuch mail composition window, as described in the function\r
+>> documentation? I don't think I like that either.\r
+>>=20\r
+>> Maybe we should let bind `mail-user-agent` instead?\r
+>\r
+>\r
+> Actually `message-mail` isn't a "notmuch mail composition window" but\r
+> rather a "mail composition window" implemented in message.el which is a\r
+> part of Emacs. Even more, it is the default "mail composition window"\r
+> in Emacs because the default value of `mail-user-agent`, as defined in\r
+> simple.el, is `message-user-agent` (since Emacs 23.3 as described in a\r
+> comment in `compose-mail` function therein) which causes to be launched by\r
+> `compose-mail`.\r
+\r
+Basically notmuch layers its own stuff on top of message mode.\r
+\r
+> TL;DR with the mail-user-agent variable set to the default value nothing\r
+> changes for a notmuch user.\r
+\r
+Except `message-user-agent` gets used instead of `notmuch-user-agent`\r
+which does the layering on top. We currently don't do much more, but\r
+might in the future. As an example, `notmuch-mua-send-hook` won't get\r
+called.\r
+\r
+Another question open to debate is, if the user is using the notmuch\r
+interface, and calls a function named `notmuch-mua-new-mail` to compose\r
+mail, should the function respect `mail-user-agent` and pop up a\r
+non-notmuch interface? Basically what we do is tested to work on top of\r
+message mode only, so all bets would be off anyway.\r
+\r
+BR,\r
+Jani.\r
+\r
+\r
+>\r
+>>> ---\r
+>>> NEWS | 10 ++++++++++\r
+>>> emacs/notmuch-mua.el | 2 +-\r
+>>> emacs/notmuch.el | 2 --\r
+>>> 3 files changed, 11 insertions(+), 3 deletions(-)\r
+>>>\r
+>>> diff --git a/NEWS b/NEWS\r
+>>> index 44e8d05..cf5b3c3 100644\r
+>>> --- a/NEWS\r
+>>> +++ b/NEWS\r
+>>> @@ -64,6 +64,16 @@ Added `notmuch address` subcommand\r
+>>> Emacs Interface\r
+>>> ---------------\r
+>>>=20=20\r
+>>> +Fixed `mail-user-agent` handling\r
+>>> +\r
+>>> + The value of the mail-user-agent variable is not forcibly set to\r
+>>> + `notmuch-user-agent`, regardles of how a user has customised it,\r
+>>> + everytime notmuch.el is loaded. This way, someone who used for examp=\r
+le\r
+>>> + Gnus has her MUA and notmuch just as a search engine, doesn't have h=\r
+er\r
+>>> + configuration broken everytime notmuch.el is loaded. The user can now\r
+>>> + use her favourite mail composing package when replying messages in\r
+>>> + notmuch too.\r
+>>=20\r
+>> I understand you're annoyed at the current behaviour, but please don't\r
+>> pour that annoyance into notmuch NEWS. Thank you.\r
+>\r
+> It wasn't my intention. I wasn't even sure I should add to NEWS anything\r
+> at all but the "Contributing" page says to update NEWS if a change is\r
+> user visible. Considering what I wrote above, do you think it is visible?\r
+>\r
+>=20=20\r
+>> BR,\r
+>> Jani.\r
+>>=20\r
+>>=20\r
+>>> +\r
+>>> Use the `j` key to access saved searches from anywhere in notmuch\r
+>>>=20=20\r
+>>> `j` is now globally bound to `notmuch-jump`, which provides fast,\r
+>>> diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
+>>> index 2c58886..f02c7b5 100644\r
+>>> --- a/emacs/notmuch-mua.el\r
+>>> +++ b/emacs/notmuch-mua.el\r
+>>> @@ -263,7 +263,7 @@ OTHER-ARGS are passed through to `message-mail'."\r
+>>> (push (cons 'From (concat\r
+>>> (notmuch-user-name) " <" (notmuch-user-primary-email) ">")) o=\r
+ther-headers))\r
+>>>=20=20\r
+>>> - (apply #'message-mail to subject other-headers other-args)\r
+>>> + (apply #'compose-mail to subject other-headers other-args)\r
+>>> (message-sort-headers)\r
+>>> (message-hide-headers)\r
+>>> (set-buffer-modified-p nil)\r
+>>> diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
+>>> index 218486a..80cab57 100644\r
+>>> --- a/emacs/notmuch.el\r
+>>> +++ b/emacs/notmuch.el\r
+>>> @@ -1037,8 +1037,6 @@ notmuch buffers exist, run `notmuch'."\r
+>>> (switch-to-buffer first))\r
+>>> (notmuch))))\r
+>>>=20=20\r
+>>> -(setq mail-user-agent 'notmuch-user-agent)\r
+>>> -\r
+>>> (provide 'notmuch)\r
+>>>=20=20\r
+>>> ;; After provide to avoid loops if notmuch was require'd via notmuch-i=\r
+nit-file.\r
+>>> --=20\r
+>>> 2.0.4\r
+>>>\r
+>>> _______________________________________________\r
+>>> notmuch mailing list\r
+>>> notmuch@notmuchmail.org\r
+>>> http://notmuchmail.org/mailman/listinfo/notmuch\r
+>>=20\r
+>\r
+>\r
+> --=20\r
+> By=C5=82o mi bardzo mi=C5=82o. Twoje oczy lubi=C4=85 mn=\r
+ie\r
+>>=C5=81ukasz< i to mnie zgubi (c)SNL\r
+>\r
+> REKLAMA: http://ars-fabrica.eu/ sklep z r=C4=99kodzie=C5=82em\r