unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] emacs: do not unconditionally set mail-user-agent
@ 2021-05-13 23:28 David Bremner
  2021-05-14 14:34 ` Tomi Ollila
  2021-06-04 23:16 ` [PATCH] emacs: drop setting mail-user-agent, and document how to set it David Bremner
  0 siblings, 2 replies; 8+ messages in thread
From: David Bremner @ 2021-05-13 23:28 UTC (permalink / raw)
  To: notmuch; +Cc: David Bremner

A user that loads notmuch.el does not necessarily want to user
notmuch-message-mode to send mail.
---
 emacs/notmuch.el | 2 --
 1 file changed, 2 deletions(-)

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 6d37c623..3e2713e2 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -1162,8 +1162,6 @@ Point should be at the beginning of the line."
 
 ;;; _
 
-(setq mail-user-agent 'notmuch-user-agent)
-
 (provide 'notmuch)
 
 ;; After provide to avoid loops if notmuch was require'd via notmuch-init-file.
-- 
2.30.2

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] emacs: do not unconditionally set mail-user-agent
  2021-05-13 23:28 [PATCH] emacs: do not unconditionally set mail-user-agent David Bremner
@ 2021-05-14 14:34 ` Tomi Ollila
  2021-05-14 15:22   ` Tory S. Anderson
  2021-05-15 13:11   ` David Bremner
  2021-06-04 23:16 ` [PATCH] emacs: drop setting mail-user-agent, and document how to set it David Bremner
  1 sibling, 2 replies; 8+ messages in thread
From: Tomi Ollila @ 2021-05-14 14:34 UTC (permalink / raw)
  To: David Bremner, notmuch; +Cc: David Bremner

On Thu, May 13 2021, David Bremner wrote:

> A user that loads notmuch.el does not necessarily want to user
> notmuch-message-mode to send mail.

If this does not break anything, could be point release content,
provided it did not ship yet (then to the next sailing ship...).

> ---
>  emacs/notmuch.el | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/emacs/notmuch.el b/emacs/notmuch.el
> index 6d37c623..3e2713e2 100644
> --- a/emacs/notmuch.el
> +++ b/emacs/notmuch.el
> @@ -1162,8 +1162,6 @@ Point should be at the beginning of the line."
>  
>  ;;; _
>  
> -(setq mail-user-agent 'notmuch-user-agent)
> -
>  (provide 'notmuch)
>  
>  ;; After provide to avoid loops if notmuch was require'd via notmuch-init-file.
> -- 
> 2.30.2
> _______________________________________________
> notmuch mailing list -- notmuch@notmuchmail.org
> To unsubscribe send an email to notmuch-leave@notmuchmail.org

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] emacs: do not unconditionally set mail-user-agent
  2021-05-14 14:34 ` Tomi Ollila
@ 2021-05-14 15:22   ` Tory S. Anderson
  2021-05-15 13:21     ` David Bremner
  2021-05-15 13:11   ` David Bremner
  1 sibling, 1 reply; 8+ messages in thread
From: Tory S. Anderson @ 2021-05-14 15:22 UTC (permalink / raw)
  To: Tomi Ollila; +Cc: notmuch

This would be terrific on my account, with that user-agent problem. It seems reasonable to ask Notmuch to NOT mess with global settings unconditionally.

The one thing I wasn't sure about in what I saw of the changes of this patch is where the "conditional" option is. Usually when I've implemented something like this I just create a custom variable and IF that variable is something, then I do the new thing; otherwise do the old thing, thereby maintaining reverse-compatibility. I didn't see that pattern here, I'm not familiar with this medium of code discussion. 

I'm not familiar with how the git process goes here, since it's somewhat different than gitlab/github. Is there something I can do to apply this, or is there a separate notification for master, or should I subscribe to a different branch?

- Tory

Tomi Ollila <tomi.ollila@iki.fi> writes:

> On Thu, May 13 2021, David Bremner wrote:
>
>> A user that loads notmuch.el does not necessarily want to user
>> notmuch-message-mode to send mail.
>
> If this does not break anything, could be point release content,
> provided it did not ship yet (then to the next sailing ship...).
>
>> ---
>>  emacs/notmuch.el | 2 --
>>  1 file changed, 2 deletions(-)
>>
>> diff --git a/emacs/notmuch.el b/emacs/notmuch.el
>> index 6d37c623..3e2713e2 100644
>> --- a/emacs/notmuch.el
>> +++ b/emacs/notmuch.el
>> @@ -1162,8 +1162,6 @@ Point should be at the beginning of the line."
>>  
>>  ;;; _
>>  
>> -(setq mail-user-agent 'notmuch-user-agent)
>> -
>>  (provide 'notmuch)
>>  
>>  ;; After provide to avoid loops if notmuch was require'd via notmuch-init-file.
>> -- 
>> 2.30.2
>> _______________________________________________
>> notmuch mailing list -- notmuch@notmuchmail.org
>> To unsubscribe send an email to notmuch-leave@notmuchmail.org
> _______________________________________________
> notmuch mailing list -- notmuch@notmuchmail.org
> To unsubscribe send an email to notmuch-leave@notmuchmail.org

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] emacs: do not unconditionally set mail-user-agent
  2021-05-14 14:34 ` Tomi Ollila
  2021-05-14 15:22   ` Tory S. Anderson
@ 2021-05-15 13:11   ` David Bremner
  1 sibling, 0 replies; 8+ messages in thread
From: David Bremner @ 2021-05-15 13:11 UTC (permalink / raw)
  To: Tomi Ollila, notmuch

Tomi Ollila <tomi.ollila@iki.fi> writes:

> On Thu, May 13 2021, David Bremner wrote:
>
>> A user that loads notmuch.el does not necessarily want to user
>> notmuch-message-mode to send mail.
>
> If this does not break anything, could be point release content,
> provided it did not ship yet (then to the next sailing ship...).

I'm a bit hesitent to include it in the current point release. I suspect
it will be a breaking change for some people, and there might be a way
to ease that pain. But we'll see, we can always roll another point
release in a few weeks.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] emacs: do not unconditionally set mail-user-agent
  2021-05-14 15:22   ` Tory S. Anderson
@ 2021-05-15 13:21     ` David Bremner
  0 siblings, 0 replies; 8+ messages in thread
From: David Bremner @ 2021-05-15 13:21 UTC (permalink / raw)
  To: Tory S. Anderson, Tomi Ollila; +Cc: notmuch

webdev@toryanderson.com (Tory S. Anderson) writes:

> I'm not familiar with how the git process goes here, since it's
> somewhat different than gitlab/github. Is there something I can do to
> apply this, or is there a separate notification for master, or should
> I subscribe to a different branch?

You'll need a checkout of the source, then you can apply that patch with
"git am".

I use roughly the following workflow

1) 'c i' in notmuch-show-mode to grab the message id

2) Switch to a terminal, run

   $ notmuch show --format=raw <paste-message-id-from-emacs> | git am

If you do this often, then you may want to investigate the package
"mailscripts" by Sean Whitton that includes some utilities that smooth
out some of the rough edges.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] emacs: drop setting mail-user-agent, and document how to set it
  2021-05-13 23:28 [PATCH] emacs: do not unconditionally set mail-user-agent David Bremner
  2021-05-14 14:34 ` Tomi Ollila
@ 2021-06-04 23:16 ` David Bremner
  2021-06-07 15:26   ` Tomi Ollila
  2021-06-07 23:30   ` David Bremner
  1 sibling, 2 replies; 8+ messages in thread
From: David Bremner @ 2021-06-04 23:16 UTC (permalink / raw)
  To: David Bremner, notmuch

After some discussion [1], I decided it is better to make notmuch users
who rely on this behaviour customize mail-user-agent. This is
consistent with the behaviour of other emacs mail packages.

[1]: id:87k0nuhfrk.fsf@toryanderson.com
---
 NEWS                  |  7 +++++++
 doc/notmuch-emacs.rst | 10 ++++++++++
 emacs/notmuch.el      |  2 --
 3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index 35b57cef..538ec168 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,13 @@
 Notmuch 0.33 (UNRELEASED)
 =========================
 
+Emacs
+-----
+
+`notmuch` no longer sets `mail-user-agent` on load. To restore the
+previous behaviour of using notmuch to send mail by default, customize
+`mail-user-agent` to `notmuch-user-agent`.
+
 Vim
 ---
 
diff --git a/doc/notmuch-emacs.rst b/doc/notmuch-emacs.rst
index d9b497a3..7772871b 100644
--- a/doc/notmuch-emacs.rst
+++ b/doc/notmuch-emacs.rst
@@ -366,6 +366,16 @@ Importing Mail
 :index:`notmuch-poll-script`
    |docstring::notmuch-poll-script|
 
+Sending Mail
+------------
+
+:index:`mail-user-agent`
+
+       Emacs consults the variable :ref:`mail-user-agent` to choose a mail
+       sending package for commands like :ref:`report-emacs-bug` and
+       :ref:`compose-mail`.  To use ``notmuch`` for this, customize this
+       variable to the symbol :ref:`notmuch-user-agent`.
+
 Init File
 ---------
 
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 6d37c623..3e2713e2 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -1162,8 +1162,6 @@ Point should be at the beginning of the line."
 
 ;;; _
 
-(setq mail-user-agent 'notmuch-user-agent)
-
 (provide 'notmuch)
 
 ;; After provide to avoid loops if notmuch was require'd via notmuch-init-file.
-- 
2.30.2

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] emacs: drop setting mail-user-agent, and document how to set it
  2021-06-04 23:16 ` [PATCH] emacs: drop setting mail-user-agent, and document how to set it David Bremner
@ 2021-06-07 15:26   ` Tomi Ollila
  2021-06-07 23:30   ` David Bremner
  1 sibling, 0 replies; 8+ messages in thread
From: Tomi Ollila @ 2021-06-07 15:26 UTC (permalink / raw)
  To: David Bremner, David Bremner, notmuch

On Fri, Jun 04 2021, David Bremner wrote:

> After some discussion [1], I decided it is better to make notmuch users
> who rely on this behaviour customize mail-user-agent. This is
> consistent with the behaviour of other emacs mail packages.

LGTM.

Tomi 

>
> [1]: id:87k0nuhfrk.fsf@toryanderson.com
> ---
>  NEWS                  |  7 +++++++
>  doc/notmuch-emacs.rst | 10 ++++++++++
>  emacs/notmuch.el      |  2 --
>  3 files changed, 17 insertions(+), 2 deletions(-)
>
> diff --git a/NEWS b/NEWS
> index 35b57cef..538ec168 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -1,6 +1,13 @@
>  Notmuch 0.33 (UNRELEASED)
>  =========================
>  
> +Emacs
> +-----
> +
> +`notmuch` no longer sets `mail-user-agent` on load. To restore the
> +previous behaviour of using notmuch to send mail by default, customize
> +`mail-user-agent` to `notmuch-user-agent`.
> +
>  Vim
>  ---
>  
> diff --git a/doc/notmuch-emacs.rst b/doc/notmuch-emacs.rst
> index d9b497a3..7772871b 100644
> --- a/doc/notmuch-emacs.rst
> +++ b/doc/notmuch-emacs.rst
> @@ -366,6 +366,16 @@ Importing Mail
>  :index:`notmuch-poll-script`
>     |docstring::notmuch-poll-script|
>  
> +Sending Mail
> +------------
> +
> +:index:`mail-user-agent`
> +
> +       Emacs consults the variable :ref:`mail-user-agent` to choose a mail
> +       sending package for commands like :ref:`report-emacs-bug` and
> +       :ref:`compose-mail`.  To use ``notmuch`` for this, customize this
> +       variable to the symbol :ref:`notmuch-user-agent`.
> +
>  Init File
>  ---------
>  
> diff --git a/emacs/notmuch.el b/emacs/notmuch.el
> index 6d37c623..3e2713e2 100644
> --- a/emacs/notmuch.el
> +++ b/emacs/notmuch.el
> @@ -1162,8 +1162,6 @@ Point should be at the beginning of the line."
>  
>  ;;; _
>  
> -(setq mail-user-agent 'notmuch-user-agent)
> -
>  (provide 'notmuch)
>  
>  ;; After provide to avoid loops if notmuch was require'd via notmuch-init-file.
> -- 
> 2.30.2
> _______________________________________________
> notmuch mailing list -- notmuch@notmuchmail.org
> To unsubscribe send an email to notmuch-leave@notmuchmail.org

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] emacs: drop setting mail-user-agent, and document how to set it
  2021-06-04 23:16 ` [PATCH] emacs: drop setting mail-user-agent, and document how to set it David Bremner
  2021-06-07 15:26   ` Tomi Ollila
@ 2021-06-07 23:30   ` David Bremner
  1 sibling, 0 replies; 8+ messages in thread
From: David Bremner @ 2021-06-07 23:30 UTC (permalink / raw)
  To: notmuch

David Bremner <david@tethera.net> writes:

> After some discussion [1], I decided it is better to make notmuch users
> who rely on this behaviour customize mail-user-agent. This is
> consistent with the behaviour of other emacs mail packages.
>
> [1]: id:87k0nuhfrk.fsf@toryanderson.com

Applied to master. I (still) don't think this is an appropriate change
for a point release, so it will need to wait for the next full release.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-06-07 23:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-13 23:28 [PATCH] emacs: do not unconditionally set mail-user-agent David Bremner
2021-05-14 14:34 ` Tomi Ollila
2021-05-14 15:22   ` Tory S. Anderson
2021-05-15 13:21     ` David Bremner
2021-05-15 13:11   ` David Bremner
2021-06-04 23:16 ` [PATCH] emacs: drop setting mail-user-agent, and document how to set it David Bremner
2021-06-07 15:26   ` Tomi Ollila
2021-06-07 23:30   ` David Bremner

unofficial mirror of notmuch@notmuchmail.org

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/notmuch/0 notmuch/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 notmuch notmuch/ https://yhetil.org/notmuch \
		notmuch@notmuchmail.org
	public-inbox-index notmuch

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.mail.notmuch.general
	nntp://news.gmane.io/gmane.mail.notmuch.general


code repositories for project(s) associated with this inbox:

	notmuch.git.git (no URL configured)

AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git