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