Re: [PATCH] emacs: PATCH [1/2] mail user agent

2021-06-03 Thread Tomi Ollila
On Thu, Jun 03 2021, Tory S. Anderson wrote:

> Nice follow-upabout what other browsers do!
>
> David Bremner  writes:
>
>> Tomi Ollila  writes:
>>
>>> On Mon, May 31 2021, David Bremner wrote:
>>>
 Tomi Ollila  writes:
>
> I am for 'ripping the bandage off' and not configure mail-user-agent
> outside of notmuch use (and just require 'notmuch would not set 
> anything...)
>
> Could we have some 'compose-mail' variant (different name, of course;
> I had one in mind but then came off-by one problem... >;) which 
> configures mail-user-agent just for that use (or something).
>

 Are you thinking about notmuch-mua-mail (which exists)?

 Tory, did you try the eval-after-load trick I mentioned btw? That seemed
 to work in my testing, and I'm just not sure that customizing a
 notmuch-* variable is much less annoying than adding an eval-after-load to
 reset the variable after notmuch messes with it.
>
> No, I'm guilty here. I used my patch instead and haven't looked back
> since. I think having to add code lines to an init file is much more
> annoying (and less transparent) than simply having something for which I
> can add a =:custom= line in my use-package statements, or new users just
> use the customizer to explore to. Maybe that's just me, but I feel much
> more comfortable about sharing that config or that suggestion with
> others, too. Explorability is what customizer's big benefit to emacs is,
> so it seems to me a real advantage to have this in there.
>

mail-user-agent is defcustom in simple.el, starting:

  (defcustom mail-user-agent 'message-user-agent
"Your preference for a mail composition package.
  Various Emacs Lisp packages (e.g. Reporter) require you to compose an
  outgoing email message.  This variable lets you specify which
  mail-sending package you prefer.

  Valid values include:

`message-user-agent'  -- use the Message package.
 See Info node `(message)'.
`sendmail-user-agent' -- use the Mail package.
 See Info node `(emacs)Sending Mail'.
`mh-e-user-agent' -- use the Emacs interface to the MH mail system.
 See Info node `(mh-e)'.
`gnus-user-agent' -- like `message-user-agent', but with Gnus
 paraphernalia if Gnus is running, particularly
 the Gcc: header for archiving.

  Additional valid symbols may be available; check with the author of
  your package for details.  The function should return non-nil if it
  succeeds.
  ...

Currently if one uses/used customizer to change to something else, which
is saved to .emacs (or somewhere else where custom-file points to), and
then loads notmuch, it suddenly changes to 'notmuch-user-agent.

AFAIU the change your patch did does not change that, one just has to
customize notmuch-mail-user-agent.

IMO that makes things messy.

If there were option to somehow magically add more values to the
mail-user-agent customize menu while loading notmuch.el then one
could just directly choose notmuch-user-agent from that menu.

Otherwise I don't see other options than document how to do that
configuration (and drop that setq and add NEWS entry).

Tomi


 Still waiting for feedback from notmuch users that actually use M-x
 compose-mail or other similar generic entry points.
>>>
>>> Does anyone know how compose-mail behaves when one has loaded any other
>>> emacs mua (mh, vm, gnus, mu, ...) ?
>>>
>>
>> As far as I can tell
>>
>>vm: only locally binds mail-user-agent
>>mh-e: used to have a setq mail-user-agent, removed in 2003-ish
>>mu4e: documents how to set mail-user-agent
>>rmail: reads mail-user-agent, but does not set
>>gnus: only locally binds mail-user-agent
>>wanderlust: tells you how how to set mail-user-agent (and oddly, how
>>to define conditionaly define a user agent)
>>
>> So I think notmuch is the odd one out here.
>> ___
>> notmuch mailing list -- notmuch@notmuchmail.org
>> To unsubscribe send an email to notmuch-le...@notmuchmail.org
> ___
> notmuch mailing list -- notmuch@notmuchmail.org
> To unsubscribe send an email to notmuch-le...@notmuchmail.org
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [PATCH] emacs: PATCH [1/2] mail user agent

2021-06-03 Thread Tory S. Anderson
Nice follow-upabout what other browsers do!

David Bremner  writes:

> Tomi Ollila  writes:
>
>> On Mon, May 31 2021, David Bremner wrote:
>>
>>> Tomi Ollila  writes:

 I am for 'ripping the bandage off' and not configure mail-user-agent
 outside of notmuch use (and just require 'notmuch would not set 
 anything...)

 Could we have some 'compose-mail' variant (different name, of course;
 I had one in mind but then came off-by one problem... >;) which 
 configures mail-user-agent just for that use (or something).

>>>
>>> Are you thinking about notmuch-mua-mail (which exists)?
>>>
>>> Tory, did you try the eval-after-load trick I mentioned btw? That seemed
>>> to work in my testing, and I'm just not sure that customizing a
>>> notmuch-* variable is much less annoying than adding an eval-after-load to
>>> reset the variable after notmuch messes with it.

No, I'm guilty here. I used my patch instead and haven't looked back since. I 
think having to add code lines to an init file is much more annoying (and less 
transparent) than simply having something for which I can add a =:custom= line 
in my use-package statements, or new users just use the customizer to explore 
to. Maybe that's just me, but I feel much more comfortable about sharing that 
config or that suggestion with others, too. Explorability is what customizer's 
big benefit to emacs is, so it seems to me a real advantage to have this in 
there. 

>>>
>>> Still waiting for feedback from notmuch users that actually use M-x
>>> compose-mail or other similar generic entry points.
>>
>> Does anyone know how compose-mail behaves when one has loaded any other
>> emacs mua (mh, vm, gnus, mu, ...) ?
>>
>
> As far as I can tell
>
>vm: only locally binds mail-user-agent
>mh-e: used to have a setq mail-user-agent, removed in 2003-ish
>mu4e: documents how to set mail-user-agent
>rmail: reads mail-user-agent, but does not set
>gnus: only locally binds mail-user-agent
>wanderlust: tells you how how to set mail-user-agent (and oddly, how
>to define conditionaly define a user agent)
>
> So I think notmuch is the odd one out here.
> ___
> notmuch mailing list -- notmuch@notmuchmail.org
> To unsubscribe send an email to notmuch-le...@notmuchmail.org
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [PATCH] emacs: PATCH [1/2] mail user agent

2021-06-03 Thread David Bremner
Tomi Ollila  writes:

> On Mon, May 31 2021, David Bremner wrote:
>
>> Tomi Ollila  writes:
>>>
>>> I am for 'ripping the bandage off' and not configure mail-user-agent
>>> outside of notmuch use (and just require 'notmuch would not set anything...)
>>>
>>> Could we have some 'compose-mail' variant (different name, of course;
>>> I had one in mind but then came off-by one problem... >;) which 
>>> configures mail-user-agent just for that use (or something).
>>>
>>
>> Are you thinking about notmuch-mua-mail (which exists)?
>>
>> Tory, did you try the eval-after-load trick I mentioned btw? That seemed
>> to work in my testing, and I'm just not sure that customizing a
>> notmuch-* variable is much less annoying than adding an eval-after-load to
>> reset the variable after notmuch messes with it.
>>
>> Still waiting for feedback from notmuch users that actually use M-x
>> compose-mail or other similar generic entry points.
>
> Does anyone know how compose-mail behaves when one has loaded any other
> emacs mua (mh, vm, gnus, mu, ...) ?
>

As far as I can tell

   vm: only locally binds mail-user-agent
   mh-e: used to have a setq mail-user-agent, removed in 2003-ish
   mu4e: documents how to set mail-user-agent
   rmail: reads mail-user-agent, but does not set
   gnus: only locally binds mail-user-agent
   wanderlust: tells you how how to set mail-user-agent (and oddly, how
   to define conditionaly define a user agent)

So I think notmuch is the odd one out here.
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [PATCH] emacs: PATCH [1/2] mail user agent

2021-06-02 Thread Tomi Ollila
On Mon, May 31 2021, David Bremner wrote:

> Tomi Ollila  writes:
>>
>> I am for 'ripping the bandage off' and not configure mail-user-agent
>> outside of notmuch use (and just require 'notmuch would not set anything...)
>>
>> Could we have some 'compose-mail' variant (different name, of course;
>> I had one in mind but then came off-by one problem... >;) which 
>> configures mail-user-agent just for that use (or something).
>>
>
> Are you thinking about notmuch-mua-mail (which exists)?
>
> Tory, did you try the eval-after-load trick I mentioned btw? That seemed
> to work in my testing, and I'm just not sure that customizing a
> notmuch-* variable is much less annoying than adding an eval-after-load to
> reset the variable after notmuch messes with it.
>
> Still waiting for feedback from notmuch users that actually use M-x
> compose-mail or other similar generic entry points.

Does anyone know how compose-mail behaves when one has loaded any other
emacs mua (mh, vm, gnus, mu, ...) ?

>
> d

Tomi
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [PATCH] emacs: PATCH [1/2] mail user agent

2021-05-31 Thread David Bremner
Tomi Ollila  writes:
>
> I am for 'ripping the bandage off' and not configure mail-user-agent
> outside of notmuch use (and just require 'notmuch would not set anything...)
>
> Could we have some 'compose-mail' variant (different name, of course;
> I had one in mind but then came off-by one problem... >;) which 
> configures mail-user-agent just for that use (or something).
>

Are you thinking about notmuch-mua-mail (which exists)?

Tory, did you try the eval-after-load trick I mentioned btw? That seemed
to work in my testing, and I'm just not sure that customizing a
notmuch-* variable is much less annoying than adding an eval-after-load to
reset the variable after notmuch messes with it.

Still waiting for feedback from notmuch users that actually use M-x
compose-mail or other similar generic entry points.

d
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [PATCH] emacs: PATCH [1/2] mail user agent

2021-05-22 Thread Tory S. Anderson
I'm coming from very limited experience here -- gnus is the only MUA I've used 
-- but I'd be surprised if it's common practice to hijack a setting to set the 
MUA to something.

As far as ripping the bandage off, I've followed that strategy many times in my 
professional life, but have come to dislike it; I'm in line with the Clojure 
paradigm to never break stuff. Sometimes that means namespacing, but in this 
case putting in the var with a default to preserve reverse compatibility is an 
easy thing, if a little kludgy. "Why was it ever doing this?" is a legitimate 
question, and it's no skin off my back if we simply chopped it out. But for a 
program as old and well-used as Notmuch, I would hate to break something that 
many users may not even realize they depended upon.

Isn't it a good idea to make the fix available for those who want it, but 
non-breaking for those who have no idea?

I suppose the docstring could be improved, and some options provided for those 
who don't know their MUAs. Trouble with options is, I don't know them, either 
-- only the notmuch MUA and 'gnus-user-agent. I'm not sure about others like 
mutt or muse or wanderlust or anything else. I'm not even sure if all of those 
have MUAs...

- Tory

Tomi Ollila  writes:

> On Sat, May 22 2021, David Bremner wrote:
>
>> web...@toryanderson.com (Tory S. Anderson) writes:
>>
>>>  
>>> +(defcustom notmuch-mail-user-agent 'notmuch-user-agent
>>> +  "The mail user-agent to use when creating mail after using Notmuch. For 
>>> historical purposes, the default is 'notmuch-user-agent"
>>> +  :group 'notmuch)
>>>  ;;; Mime Utilities
>>>  
>>>  (defun notmuch-foreach-mime-part (function mm-handle)
>>> @@ -1162,7 +1165,7 @@ Point should be at the beginning of the line."
>>>  
>>>  ;;; _
>>>  
>>> -(setq mail-user-agent 'notmuch-user-agent)
>>> +(setq mail-user-agent notmuch-mail-user-agent)
>>
>> OK, I appreciate idea of a smooth upgrade for existing notmuch users. I
>> wonder though if other emacs MUAs do this? I did not see e.g. a
>> gnus-mail-user-agent variable. I'm probably biased because I never use
>> compose-mail to send mail, but I'm wondering if we're better off to just
>> rip the bandage off and let users who want to use notmuch via generic
>> emacs mail sending commands configure that.
>
> I am for 'ripping the bandage off' and not configure mail-user-agent
> outside of notmuch use (and just require 'notmuch would not set anything...)
>
> Could we have some 'compose-mail' variant (different name, of course;
> I had one in mind but then came off-by one problem... >;) which 
> configures mail-user-agent just for that use (or something).
>
> Tomi
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [PATCH] emacs: PATCH [1/2] mail user agent

2021-05-22 Thread Tomi Ollila
On Sat, May 22 2021, David Bremner wrote:

> web...@toryanderson.com (Tory S. Anderson) writes:
>
>>  
>> +(defcustom notmuch-mail-user-agent 'notmuch-user-agent
>> +  "The mail user-agent to use when creating mail after using Notmuch. For 
>> historical purposes, the default is 'notmuch-user-agent"
>> +  :group 'notmuch)
>>  ;;; Mime Utilities
>>  
>>  (defun notmuch-foreach-mime-part (function mm-handle)
>> @@ -1162,7 +1165,7 @@ Point should be at the beginning of the line."
>>  
>>  ;;; _
>>  
>> -(setq mail-user-agent 'notmuch-user-agent)
>> +(setq mail-user-agent notmuch-mail-user-agent)
>
> OK, I appreciate idea of a smooth upgrade for existing notmuch users. I
> wonder though if other emacs MUAs do this? I did not see e.g. a
> gnus-mail-user-agent variable. I'm probably biased because I never use
> compose-mail to send mail, but I'm wondering if we're better off to just
> rip the bandage off and let users who want to use notmuch via generic
> emacs mail sending commands configure that.

I am for 'ripping the bandage off' and not configure mail-user-agent
outside of notmuch use (and just require 'notmuch would not set anything...)

Could we have some 'compose-mail' variant (different name, of course;
I had one in mind but then came off-by one problem... >;) which 
configures mail-user-agent just for that use (or something).

Tomi
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [PATCH] emacs: PATCH [1/2] mail user agent

2021-05-22 Thread David Bremner
web...@toryanderson.com (Tory S. Anderson) writes:

>  
> +(defcustom notmuch-mail-user-agent 'notmuch-user-agent
> +  "The mail user-agent to use when creating mail after using Notmuch. For 
> historical purposes, the default is 'notmuch-user-agent"
> +  :group 'notmuch)
>  ;;; Mime Utilities
>  
>  (defun notmuch-foreach-mime-part (function mm-handle)
> @@ -1162,7 +1165,7 @@ Point should be at the beginning of the line."
>  
>  ;;; _
>  
> -(setq mail-user-agent 'notmuch-user-agent)
> +(setq mail-user-agent notmuch-mail-user-agent)

OK, I appreciate idea of a smooth upgrade for existing notmuch users. I
wonder though if other emacs MUAs do this? I did not see e.g. a
gnus-mail-user-agent variable. I'm probably biased because I never use
compose-mail to send mail, but I'm wondering if we're better off to just
rip the bandage off and let users who want to use notmuch via generic
emacs mail sending commands configure that.
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org