unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH v2] emacs: Add customization group for replying
       [not found] <Date: Wed, 05 Sep 2012 09:48:58 +0300>
@ 2012-09-06  8:23 ` Michal Sojka
  2012-09-06  8:57   ` Tomi Ollila
  0 siblings, 1 reply; 5+ messages in thread
From: Michal Sojka @ 2012-09-06  8:23 UTC (permalink / raw)
  To: notmuch

When one wants to customize the format of reply message, there is nothing
to tell the user how to do it.  Without knowing that construction of
reply buffer is actually implemented in the message package, it seems
that replying cannot be customized.

Because I was getting annoyed by the empty line the between the citation
line and the quoted message, I figured out that changing this is fairly
easy when one knows what to customize.

This patch adds notmuch-reply customization group that contains
references to the relevant customization options. The new group is easy
to find as it is shown as a result of running "M-x customize-group RET
notmuch RET".
---
 emacs/notmuch-lib.el |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 900235b..c045a32 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -45,6 +45,16 @@
   "Showing messages and threads."
   :group 'notmuch)
 
+(defgroup notmuch-reply
+  '((message-insertion custom-group)
+    (notmuch-message-replied-tags custom-variable))
+  "Replying to messages.
+
+Most of the reply customization settings can be found in `Message
+insertion' group. Notmuch specific settings is included directly
+here."
+  :group 'notmuch)
+
 (defgroup notmuch-send nil
   "Sending messages from Notmuch."
   :group 'notmuch)
-- 
1.7.10.4

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

* Re: [PATCH v2] emacs: Add customization group for replying
  2012-09-06  8:23 ` [PATCH v2] emacs: Add customization group for replying Michal Sojka
@ 2012-09-06  8:57   ` Tomi Ollila
  2012-09-06 12:39     ` Michal Sojka
  0 siblings, 1 reply; 5+ messages in thread
From: Tomi Ollila @ 2012-09-06  8:57 UTC (permalink / raw)
  To: Michal Sojka, notmuch

On Thu, Sep 06 2012, Michal Sojka <sojkam1@fel.cvut.cz> wrote:

> When one wants to customize the format of reply message, there is nothing
> to tell the user how to do it.  Without knowing that construction of
> reply buffer is actually implemented in the message package, it seems
> that replying cannot be customized.
>
> Because I was getting annoyed by the empty line the between the citation
> line and the quoted message, I figured out that changing this is fairly
> easy when one knows what to customize.
>
> This patch adds notmuch-reply customization group that contains
> references to the relevant customization options. The new group is easy
> to find as it is shown as a result of running "M-x customize-group RET
> notmuch RET".
> ---

So far good, but...

You forgot to handle the current group setting for 
notmuch-message-replied-tags -- currently notmuch-message.el has this:

(defcustom notmuch-message-replied-tags '("replied")
  "Tags to be automatically added to or removed from a message when it is
  replied to.
Any tag in the list will be added to a replied message or,
if it is prefaced with a \"-\", removed.

For example, if you wanted to add a \"replied\" tag and remove
the \"inbox\" and \"todo\", you would set
    (\"replied\" \"-inbox\" \"-todo\"\)"
  :type 'list
  :group 'notmuch-send)

If the above was changed to 'normuch-send, (require 'notmuch-lib)
was added to the beginning of notmuch-message.el and the defgroup
below was written as

(defgroup notmuch-reply
  '((message-insertion custom-group)))
   "Replying to messages.
    ...

would that work as expected ?

Tomi


>  emacs/notmuch-lib.el |   10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
> index 900235b..c045a32 100644
> --- a/emacs/notmuch-lib.el
> +++ b/emacs/notmuch-lib.el
> @@ -45,6 +45,16 @@
>    "Showing messages and threads."
>    :group 'notmuch)
>  
> +(defgroup notmuch-reply
> +  '((message-insertion custom-group)
> +    (notmuch-message-replied-tags custom-variable))
> +  "Replying to messages.
> +
> +Most of the reply customization settings can be found in `Message
> +insertion' group. Notmuch specific settings is included directly
> +here."
> +  :group 'notmuch)
> +
>  (defgroup notmuch-send nil
>    "Sending messages from Notmuch."
>    :group 'notmuch)
> -- 
> 1.7.10.4
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

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

* Re: [PATCH v2] emacs: Add customization group for replying
  2012-09-06  8:57   ` Tomi Ollila
@ 2012-09-06 12:39     ` Michal Sojka
  2012-09-06 14:00       ` Tomi Ollila
  0 siblings, 1 reply; 5+ messages in thread
From: Michal Sojka @ 2012-09-06 12:39 UTC (permalink / raw)
  To: Tomi Ollila, notmuch

On Thu, Sep 06 2012, Tomi Ollila wrote:
> On Thu, Sep 06 2012, Michal Sojka <sojkam1@fel.cvut.cz> wrote:
>
>> When one wants to customize the format of reply message, there is nothing
>> to tell the user how to do it.  Without knowing that construction of
>> reply buffer is actually implemented in the message package, it seems
>> that replying cannot be customized.
>>
>> Because I was getting annoyed by the empty line the between the citation
>> line and the quoted message, I figured out that changing this is fairly
>> easy when one knows what to customize.
>>
>> This patch adds notmuch-reply customization group that contains
>> references to the relevant customization options. The new group is easy
>> to find as it is shown as a result of running "M-x customize-group RET
>> notmuch RET".
>> ---
>
> So far good, but...
>
> You forgot to handle the current group setting for 
> notmuch-message-replied-tags -- currently notmuch-message.el has this:
>
> (defcustom notmuch-message-replied-tags '("replied")
>   "Tags to be automatically added to or removed from a message when it is
>   replied to.
> Any tag in the list will be added to a replied message or,
> if it is prefaced with a \"-\", removed.
>
> For example, if you wanted to add a \"replied\" tag and remove
> the \"inbox\" and \"todo\", you would set
>     (\"replied\" \"-inbox\" \"-todo\"\)"
>   :type 'list
>   :group 'notmuch-send)
>
> If the above was changed to 'normuch-send, (require 'notmuch-lib)
> was added to the beginning of notmuch-message.el and the defgroup
> below was written as
>
> (defgroup notmuch-reply
>   '((message-insertion custom-group)))
>    "Replying to messages.
>     ...
>
> would that work as expected ?

Hi Tomi,

I don't really get what are you trying to say. Do you mean that
notmuch-message-replied-tags is referenced from notmuch-lib.el without
(require 'notmuch-message)? I'm not sure whether it is required, but it
works here without problems.

Running M-x customize-variable RET notmuch-message-replied-tags RET
shows the following. Note that both groups are mentioned at the bottom.
No warning or errors are produced.

-Michal

--8<---------------cut here---------------start------------->8---
To apply changes, use the Save or Set buttons.
For details, see Saving Customizations in the Emacs manual.

                                          Search 

 Operate on all settings in this buffer:
  Set for current session   Save for future sessions 
  Undo edits   Reset to saved   Erase customizations     Exit 

Hide notmuch-message-replied-tags: '("replied")
    State : STANDARD. (mismatch)
   Tags to be automatically added to or removed from a message when it is replied to. Hide   
   Any tag in the list will be added to a replied message or,
   if it is prefaced with a "-", removed.
   
   For example, if you wanted to add a "replied" tag and remove
   the "inbox" and "todo", you would set
       ("replied" "-inbox" "-todo")
Groups: Notmuch Send Notmuch Reply
--8<---------------cut here---------------end--------------->8---

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

* Re: [PATCH v2] emacs: Add customization group for replying
  2012-09-06 12:39     ` Michal Sojka
@ 2012-09-06 14:00       ` Tomi Ollila
  2012-09-06 14:12         ` Michal Sojka
  0 siblings, 1 reply; 5+ messages in thread
From: Tomi Ollila @ 2012-09-06 14:00 UTC (permalink / raw)
  To: Michal Sojka, notmuch

On Thu, Sep 06 2012, Michal Sojka <sojkam1@fel.cvut.cz> wrote:

>> So far good, but...
>>
>> You forgot to handle the current group setting for 
>> notmuch-message-replied-tags -- currently notmuch-message.el has this:
>>
>> (defcustom notmuch-message-replied-tags '("replied")
>>   "Tags to be automatically added to or removed from a message when it is
>>   replied to.
>> Any tag in the list will be added to a replied message or,
>> if it is prefaced with a \"-\", removed.
>>
>> For example, if you wanted to add a \"replied\" tag and remove
>> the \"inbox\" and \"todo\", you would set
>>     (\"replied\" \"-inbox\" \"-todo\"\)"
>>   :type 'list
>>   :group 'notmuch-send)
>>
>> If the above was changed to 'normuch-send, (require 'notmuch-lib)
>> was added to the beginning of notmuch-message.el and the defgroup
>> below was written as
>>
>> (defgroup notmuch-reply
>>   '((message-insertion custom-group)))
>>    "Replying to messages.
>>     ...
>>
>> would that work as expected ?
>
> Hi Tomi,
>
> I don't really get what are you trying to say. Do you mean that
> notmuch-message-replied-tags is referenced from notmuch-lib.el without
> (require 'notmuch-message)? I'm not sure whether it is required, but it
> works here without problems.

Ok, some sillines in my part and something I did not check well
enough before replying...

First, notmuch-lib.el defines notmuch-send group, yet 
(defcustom notmuch-message-replied-tags ...) is defined 
in notmuch-message.el which is not requiring notmuch-lib...
and all of this works now...

Actually, notmuch-lib.el defines all defgroups (except coolj).

Then, I found the following: notmuch-mua-send-hook is defined 
both in notmuch-hooks and notmuch-send groups (having a precedent
helps a bit there when choosing alternatives below)


All the defgroups are defined using pattern:

(defgroup notmuch-<group> nil ...)

We should follow this pattern unless there is good reason not to 
do so here: notmuch-send is written as:

  (defgroup notmuch-send nil
    "Sending messages from Notmuch."
    :group 'notmuch)

  (custom-add-to-group 'notmuch-send 'message 'custom-group)

But, as the documentation in this notmuch-reply definition references
'Message insertion' group, doing

  (defgroup notmuch-reply 
    '((message-insertion custom-group))'
    "Replying to messages.

  Most of the reply customization settings can be found in `Message
  insertion' group. Notmuch specific settings are included directly
  here."
  :group 'notmuch)

could be good thing to do here; definition matches doc from the beginning
(just not adding any of the custom variables, yet).


Now, currently notmuch-message.el defines notmuch-message-replied-tags
and puts that to :group 'notmuch-send

There are 2 alternatives:

1) change that to :group 'notmuch-reply

2) add (custom-add-to-group 'notmuch-reply 'notmuch-message-replied-tags 'custom-variable)
   to notmuch-message.el (or notmuch-lib.el)

2b) change :group 'notmuch-send -> :group 'notmuch-reply and
   add (custom-add-to-group 'notmuch-send 'notmuch-message-replied-tags 'custom-variable)
   to notmuch-message.el (or notmuch-lib.el)


I personally would slightly lean to option 1 but if 2 gets more 
supporters then 2b (so that the spesific group is in the group definition).

On other words; 1 or 2b gets LGTM from me :)

Understood ? :D


Tomi


> Running M-x customize-variable RET notmuch-message-replied-tags RET
> shows the following. Note that both groups are mentioned at the bottom.
> No warning or errors are produced.

Yes, I tested that missing group-thing with:

(defgroup foo '((bar-group custom-group)) "test")

It seems the nonexisting bar-group is created on-the-fly (but
exist temporarily). No warnings nor errors :).

>
> -Michal

Tomi

>
> --8<---------------cut here---------------start------------->8---
> To apply changes, use the Save or Set buttons.
> For details, see Saving Customizations in the Emacs manual.
>
>                                           Search 
>
>  Operate on all settings in this buffer:
>   Set for current session   Save for future sessions 
>   Undo edits   Reset to saved   Erase customizations     Exit 
>
> Hide notmuch-message-replied-tags: '("replied")
>     State : STANDARD. (mismatch)
>    Tags to be automatically added to or removed from a message when it is replied to. Hide   
>    Any tag in the list will be added to a replied message or,
>    if it is prefaced with a "-", removed.
>    
>    For example, if you wanted to add a "replied" tag and remove
>    the "inbox" and "todo", you would set
>        ("replied" "-inbox" "-todo")
> Groups: Notmuch Send Notmuch Reply
> --8<---------------cut here---------------end--------------->8---

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

* Re: [PATCH v2] emacs: Add customization group for replying
  2012-09-06 14:00       ` Tomi Ollila
@ 2012-09-06 14:12         ` Michal Sojka
  0 siblings, 0 replies; 5+ messages in thread
From: Michal Sojka @ 2012-09-06 14:12 UTC (permalink / raw)
  To: Tomi Ollila, notmuch

On Thu, Sep 06 2012, Tomi Ollila wrote:
> On Thu, Sep 06 2012, Michal Sojka <sojkam1@fel.cvut.cz> wrote:
>
>>> So far good, but...
>>>
>>> You forgot to handle the current group setting for 
>>> notmuch-message-replied-tags -- currently notmuch-message.el has this:
>>>
>>> (defcustom notmuch-message-replied-tags '("replied")
>>>   "Tags to be automatically added to or removed from a message when it is
>>>   replied to.
>>> Any tag in the list will be added to a replied message or,
>>> if it is prefaced with a \"-\", removed.
>>>
>>> For example, if you wanted to add a \"replied\" tag and remove
>>> the \"inbox\" and \"todo\", you would set
>>>     (\"replied\" \"-inbox\" \"-todo\"\)"
>>>   :type 'list
>>>   :group 'notmuch-send)
>>>
>>> If the above was changed to 'normuch-send, (require 'notmuch-lib)
>>> was added to the beginning of notmuch-message.el and the defgroup
>>> below was written as
>>>
>>> (defgroup notmuch-reply
>>>   '((message-insertion custom-group)))
>>>    "Replying to messages.
>>>     ...
>>>
>>> would that work as expected ?
>>
>> Hi Tomi,
>>
>> I don't really get what are you trying to say. Do you mean that
>> notmuch-message-replied-tags is referenced from notmuch-lib.el without
>> (require 'notmuch-message)? I'm not sure whether it is required, but it
>> works here without problems.
>
> Ok, some sillines in my part and something I did not check well
> enough before replying...
>
> First, notmuch-lib.el defines notmuch-send group, yet 
> (defcustom notmuch-message-replied-tags ...) is defined 
> in notmuch-message.el which is not requiring notmuch-lib...
> and all of this works now...
>
> Actually, notmuch-lib.el defines all defgroups (except coolj).
>
> Then, I found the following: notmuch-mua-send-hook is defined 
> both in notmuch-hooks and notmuch-send groups (having a precedent
> helps a bit there when choosing alternatives below)
>
>
> All the defgroups are defined using pattern:
>
> (defgroup notmuch-<group> nil ...)
>
> We should follow this pattern unless there is good reason not to 
> do so here: notmuch-send is written as:
>
>   (defgroup notmuch-send nil
>     "Sending messages from Notmuch."
>     :group 'notmuch)
>
>   (custom-add-to-group 'notmuch-send 'message 'custom-group)
>
> But, as the documentation in this notmuch-reply definition references
> 'Message insertion' group, doing
>
>   (defgroup notmuch-reply 
>     '((message-insertion custom-group))'
>     "Replying to messages.
>
>   Most of the reply customization settings can be found in `Message
>   insertion' group. Notmuch specific settings are included directly
>   here."
>   :group 'notmuch)
>
> could be good thing to do here; definition matches doc from the beginning
> (just not adding any of the custom variables, yet).
>
>
> Now, currently notmuch-message.el defines notmuch-message-replied-tags
> and puts that to :group 'notmuch-send
>
> There are 2 alternatives:
>
> 1) change that to :group 'notmuch-reply

Now I understand. I think that 1) would be a good solution. I'll wait a
bit for other comments and than I'll send a new patch.

-Michal

>
> 2) add (custom-add-to-group 'notmuch-reply 'notmuch-message-replied-tags 'custom-variable)
>    to notmuch-message.el (or notmuch-lib.el)
>
> 2b) change :group 'notmuch-send -> :group 'notmuch-reply and
>    add (custom-add-to-group 'notmuch-send 'notmuch-message-replied-tags 'custom-variable)
>    to notmuch-message.el (or notmuch-lib.el)
>
>
> I personally would slightly lean to option 1 but if 2 gets more 
> supporters then 2b (so that the spesific group is in the group definition).
>
> On other words; 1 or 2b gets LGTM from me :)

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

end of thread, other threads:[~2012-09-06 14:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <Date: Wed, 05 Sep 2012 09:48:58 +0300>
2012-09-06  8:23 ` [PATCH v2] emacs: Add customization group for replying Michal Sojka
2012-09-06  8:57   ` Tomi Ollila
2012-09-06 12:39     ` Michal Sojka
2012-09-06 14:00       ` Tomi Ollila
2012-09-06 14:12         ` Michal Sojka

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).