[PATCH] emacs: do not change users' mail agent configuration

2014-12-15 Thread Lukasz Stelmach
On 14.12.2014 10:46, Jani Nikula wrote:
> On Sat, 13 Dec 2014, Lukasz Stelmach  wrote:
>> On 13.12.2014 22:04, Jani Nikula wrote:
>>> On Fri, 12 Dec 2014, ?ukasz 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.
>>>
>>> Point taken.
>>>
 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'.
>>>
>>> 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.
>>>
>>> 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.

I need to dig into notmuch-mua a little bit deeper but at the first
glance it doesn't seem that what I want is impossible. What I want is:

- keep notmuch working as it is for everyone who uses it now,

- enable clean integration with other MUAs for those who don't use it
  yet.

The second point is very important for me because I use Gnus for
incoming mail but notmuch is definitely better for browsing archives
and I'd love to use it.

>> 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.

Indeed I need to sit down and draw it all.

> 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.

And that should be kept as default. I, on the other hand have tested,
replying from notmuch with Gnus (which is also works on top of message)
and as far as I can tell it works fine. I don't say notmuch has to work
with all possible user agents, I just want it to be able to work with
more than one.

I will keep investigating the issue.

BTW There is also the `read-mail-command` variable in simple.el which
which might need some of our attention.

Kind regards,
-- 
By?o mi bardzo mi?o.   Twoje oczy lubi? mnie
>?ukasz< i to mnie zgubi  (c)SNL

-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 538 bytes
Desc: OpenPGP digital signature
URL: 



[PATCH] emacs: do not change users' mail agent configuration

2014-12-14 Thread Jani Nikula
On Sat, 13 Dec 2014, Lukasz Stelmach  wrote:
> On 13.12.2014 22:04, Jani Nikula wrote:
>> On Fri, 12 Dec 2014, ?ukasz 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.
>> 
>> Point taken.
>> 
>>> 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'.
>> 
>> 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.
>> 
>> 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
>>>  ---
>>>  
>>> +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 example
>>> +  Gnus has her MUA and notmuch just as a search engine, doesn't have her
>>> +  configuration broken everytime notmuch.el is loaded. The user can now
>>> +  use her favourite mail composing package when replying messages in
>>> +  notmuch too.
>> 
>> 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?
>
>  
>> BR,
>> Jani.
>> 
>> 
>>> +
>>>  Use the `j` key to access saved searches from anywhere in notmuch
>>>  
>>>`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) 
>>> ">")) other-headers))
>>>  
>>> -  (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
>>>  
>>> -(setq mail-user-agent 'notmuch-user-agent)
>>> -
>>>  (provide 'notmuch)
>>>  
>>>  ;; After provide to avoid loops if notmuch was require'd via 
>>> notmuch-init-file.
>>> -- 
>>> 2.0.4
>>>
>>> ___
>>> notmuch mailing list
>>> notmuch at notmuchmail.org
>>> http://notmuchmail.org/mailman/listinfo/notmuch
>> 
>
>
> -- 
> By?o mi bardzo mi?o.   Twoje oczy lubi? mnie
>>?ukasz< i to mnie zgubi  (c)SNL
>
> REKLAMA: http://ars-fabrica.eu/ sklep z r?kodzie?em


Re: [PATCH] emacs: do not change users' mail agent configuration

2014-12-14 Thread Jani Nikula
On Sat, 13 Dec 2014, Lukasz Stelmach stl...@poczta.fm wrote:
 On 13.12.2014 22:04, Jani Nikula wrote:
 On Fri, 12 Dec 2014, Łukasz Stelmach stl...@poczta.fm wrote:
 `mail-user-agent' is defined with defcustom and may be customised
 by users. It should not be set to arbitrary values in modules.
 
 Point taken.
 
 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'.
 
 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.
 
 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
  ---
  
 +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 example
 +  Gnus has her MUA and notmuch just as a search engine, doesn't have her
 +  configuration broken everytime notmuch.el is loaded. The user can now
 +  use her favourite mail composing package when replying messages in
 +  notmuch too.
 
 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?

  
 BR,
 Jani.
 
 
 +
  Use the `j` key to access saved searches from anywhere in notmuch
  
`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) 
 )) other-headers))
  
 -  (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
  
 -(setq mail-user-agent 'notmuch-user-agent)
 -
  (provide 'notmuch)
  
  ;; After provide to avoid loops if notmuch was require'd via 
 notmuch-init-file.
 -- 
 2.0.4

 ___
 notmuch mailing list
 notmuch@notmuchmail.org
 http://notmuchmail.org/mailman/listinfo/notmuch
 


 -- 
 Było mi bardzo miło.   Twoje oczy lubią mnie
Łukasz i to mnie zgubi  (c)SNL

 REKLAMA: http://ars-fabrica.eu/ sklep z rękodziełem
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] emacs: do not change users' mail agent configuration

2014-12-14 Thread Lukasz Stelmach
On 13.12.2014 22:04, Jani Nikula wrote:
 On Fri, 12 Dec 2014, Łukasz Stelmach stl...@poczta.fm wrote:
 `mail-user-agent' is defined with defcustom and may be customised
 by users. It should not be set to arbitrary values in modules.
 
 Point taken.
 
 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'.
 
 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.
 
 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`.

TL;DR with the mail-user-agent variable set to the default value nothing
  changes for a notmuch user.

 ---
  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
  ---
  
 +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 example
 +  Gnus has her MUA and notmuch just as a search engine, doesn't have her
 +  configuration broken everytime notmuch.el is loaded. The user can now
 +  use her favourite mail composing package when replying messages in
 +  notmuch too.
 
 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?

 
 BR,
 Jani.
 
 
 +
  Use the `j` key to access saved searches from anywhere in notmuch
  
`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) 
 )) other-headers))
  
 -  (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
  
 -(setq mail-user-agent 'notmuch-user-agent)
 -
  (provide 'notmuch)
  
  ;; After provide to avoid loops if notmuch was require'd via 
 notmuch-init-file.
 -- 
 2.0.4

 ___
 notmuch mailing list
 notmuch@notmuchmail.org
 http://notmuchmail.org/mailman/listinfo/notmuch
 


-- 
Było mi bardzo miło.   Twoje oczy lubią mnie
Łukasz i to mnie zgubi  (c)SNL

REKLAMA: http://ars-fabrica.eu/ sklep z rękodziełem



signature.asc
Description: OpenPGP digital signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] emacs: do not change users' mail agent configuration

2014-12-14 Thread Lukasz Stelmach
On 14.12.2014 10:46, Jani Nikula wrote:
 On Sat, 13 Dec 2014, Lukasz Stelmach stl...@poczta.fm wrote:
 On 13.12.2014 22:04, Jani Nikula wrote:
 On Fri, 12 Dec 2014, Łukasz Stelmach stl...@poczta.fm wrote:
 `mail-user-agent' is defined with defcustom and may be customised
 by users. It should not be set to arbitrary values in modules.

 Point taken.

 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'.

 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.

 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.

I need to dig into notmuch-mua a little bit deeper but at the first
glance it doesn't seem that what I want is impossible. What I want is:

- keep notmuch working as it is for everyone who uses it now,

- enable clean integration with other MUAs for those who don't use it
  yet.

The second point is very important for me because I use Gnus for
incoming mail but notmuch is definitely better for browsing archives
and I'd love to use it.

 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.

Indeed I need to sit down and draw it all.

 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.

And that should be kept as default. I, on the other hand have tested,
replying from notmuch with Gnus (which is also works on top of message)
and as far as I can tell it works fine. I don't say notmuch has to work
with all possible user agents, I just want it to be able to work with
more than one.

I will keep investigating the issue.

BTW There is also the `read-mail-command` variable in simple.el which
which might need some of our attention.

Kind regards,
-- 
Było mi bardzo miło.   Twoje oczy lubią mnie
Łukasz i to mnie zgubi  (c)SNL



signature.asc
Description: OpenPGP digital signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] emacs: do not change users' mail agent configuration

2014-12-13 Thread Jani Nikula
On Fri, 12 Dec 2014, ?ukasz 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.

Point taken.

> 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'.

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.

Maybe we should let bind `mail-user-agent` instead?

> ---
>  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
>  ---
>  
> +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 example
> +  Gnus has her MUA and notmuch just as a search engine, doesn't have her
> +  configuration broken everytime notmuch.el is loaded. The user can now
> +  use her favourite mail composing package when replying messages in
> +  notmuch too.

I understand you're annoyed at the current behaviour, but please don't
pour that annoyance into notmuch NEWS. Thank you.

BR,
Jani.


> +
>  Use the `j` key to access saved searches from anywhere in notmuch
>  
>`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) 
> ">")) other-headers))
>  
> -  (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
>  
> -(setq mail-user-agent 'notmuch-user-agent)
> -
>  (provide 'notmuch)
>  
>  ;; After provide to avoid loops if notmuch was require'd via 
> notmuch-init-file.
> -- 
> 2.0.4
>
> ___
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] emacs: do not change users' mail agent configuration

2014-12-13 Thread Lukasz Stelmach
On 13.12.2014 22:04, Jani Nikula wrote:
> On Fri, 12 Dec 2014, ?ukasz 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.
> 
> Point taken.
> 
>> 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'.
> 
> 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.
> 
> 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`.

TL;DR with the mail-user-agent variable set to the default value nothing
  changes for a notmuch user.

>> ---
>>  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
>>  ---
>>  
>> +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 example
>> +  Gnus has her MUA and notmuch just as a search engine, doesn't have her
>> +  configuration broken everytime notmuch.el is loaded. The user can now
>> +  use her favourite mail composing package when replying messages in
>> +  notmuch too.
> 
> 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?


> BR,
> Jani.
> 
> 
>> +
>>  Use the `j` key to access saved searches from anywhere in notmuch
>>  
>>`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) 
>> ">")) other-headers))
>>  
>> -  (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
>>  
>> -(setq mail-user-agent 'notmuch-user-agent)
>> -
>>  (provide 'notmuch)
>>  
>>  ;; After provide to avoid loops if notmuch was require'd via 
>> notmuch-init-file.
>> -- 
>> 2.0.4
>>
>> ___
>> notmuch mailing list
>> notmuch at notmuchmail.org
>> http://notmuchmail.org/mailman/listinfo/notmuch
> 


-- 
By?o mi bardzo mi?o.   Twoje oczy lubi? mnie
>?ukasz< i to mnie zgubi  (c)SNL

REKLAMA: http://ars-fabrica.eu/ sklep z r?kodzie?em

-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 538 bytes
Desc: OpenPGP digital signature
URL: 



[PATCH] emacs: do not change users' mail agent configuration

2014-12-13 Thread Łukasz Stelmach
`mail-user-agent' is defined with defcustom and may be customised
by users. It should not be set to arbitrary values in modules.

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'.
---
 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
 ---
 
+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 example
+  Gnus has her MUA and notmuch just as a search engine, doesn't have her
+  configuration broken everytime notmuch.el is loaded. The user can now
+  use her favourite mail composing package when replying messages in
+  notmuch too.
+
 Use the `j` key to access saved searches from anywhere in notmuch
 
   `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) 
)) other-headers))
 
-  (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
 
-(setq mail-user-agent 'notmuch-user-agent)
-
 (provide 'notmuch)
 
 ;; After provide to avoid loops if notmuch was require'd via notmuch-init-file.
-- 
2.0.4

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] emacs: do not change users' mail agent configuration

2014-12-13 Thread Jani Nikula
On Fri, 12 Dec 2014, Łukasz Stelmach stl...@poczta.fm wrote:
 `mail-user-agent' is defined with defcustom and may be customised
 by users. It should not be set to arbitrary values in modules.

Point taken.

 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'.

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.

Maybe we should let bind `mail-user-agent` instead?

 ---
  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
  ---
  
 +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 example
 +  Gnus has her MUA and notmuch just as a search engine, doesn't have her
 +  configuration broken everytime notmuch.el is loaded. The user can now
 +  use her favourite mail composing package when replying messages in
 +  notmuch too.

I understand you're annoyed at the current behaviour, but please don't
pour that annoyance into notmuch NEWS. Thank you.

BR,
Jani.


 +
  Use the `j` key to access saved searches from anywhere in notmuch
  
`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) 
 )) other-headers))
  
 -  (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
  
 -(setq mail-user-agent 'notmuch-user-agent)
 -
  (provide 'notmuch)
  
  ;; After provide to avoid loops if notmuch was require'd via 
 notmuch-init-file.
 -- 
 2.0.4

 ___
 notmuch mailing list
 notmuch@notmuchmail.org
 http://notmuchmail.org/mailman/listinfo/notmuch
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] emacs: do not change users' mail agent configuration

2014-12-12 Thread Łukasz Stelmach
`mail-user-agent' is defined with defcustom and may be customised
by users. It should not be set to arbitrary values in modules.

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'.
---
 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
 ---

+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 example
+  Gnus has her MUA and notmuch just as a search engine, doesn't have her
+  configuration broken everytime notmuch.el is loaded. The user can now
+  use her favourite mail composing package when replying messages in
+  notmuch too.
+
 Use the `j` key to access saved searches from anywhere in notmuch

   `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) 
">")) other-headers))

-  (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

-(setq mail-user-agent 'notmuch-user-agent)
-
 (provide 'notmuch)

 ;; After provide to avoid loops if notmuch was require'd via notmuch-init-file.
-- 
2.0.4