unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* precedence in `notmuch-search-line-faces'
@ 2014-05-02 11:14 David Edmondson
  2014-05-04  7:31 ` Mark Walters
  0 siblings, 1 reply; 9+ messages in thread
From: David Edmondson @ 2014-05-02 11:14 UTC (permalink / raw)
  To: notmuch

[-- Attachment #1: Type: text/plain, Size: 786 bytes --]

The documentation for `notmuch-search-line-faces' says:

> The attributes defined for matching tags are merged, with later
> attributes overriding earlier.

A comment in `notmuch-search-color-line', which implements this, says:

> ;; Reverse the list so earlier entries take precedence

Clearly these two are at odds. The implementation of
`notmuch-search-color-line' follows the comment. That is, earlier
entries in the list take precedence.

The original implementation of `notmuch-search-color-line' followed the
documentation of the user-visible variable, but this was changed by
commit 60ebc849 in July 2012.

I'm inclined to go with the documentation and change the implementation,
but this could obviously ruin things for some users until they reorder
their settings.

Thoughts?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 310 bytes --]

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

* Re: precedence in `notmuch-search-line-faces'
  2014-05-02 11:14 precedence in `notmuch-search-line-faces' David Edmondson
@ 2014-05-04  7:31 ` Mark Walters
  2014-05-06  9:40   ` David Edmondson
  0 siblings, 1 reply; 9+ messages in thread
From: Mark Walters @ 2014-05-04  7:31 UTC (permalink / raw)
  To: David Edmondson, notmuch


I have a slight preference for making it do the comment (ie reverse the
list). My reason is that we have some other cases such as
notmuch-tag-format that apply the first match, so users might be used to
having the specific first and the more general later.

It also has a small advantage of being less disruptive but, given that I
don't think any of us realised it changed, I guess most people aren't
using multiple matches.

Best wishes

Mark



On Fri, 02 May 2014, David Edmondson <dme@dme.org> wrote:
> The documentation for `notmuch-search-line-faces' says:
>
>> The attributes defined for matching tags are merged, with later
>> attributes overriding earlier.
>
> A comment in `notmuch-search-color-line', which implements this, says:
>
>> ;; Reverse the list so earlier entries take precedence
>
> Clearly these two are at odds. The implementation of
> `notmuch-search-color-line' follows the comment. That is, earlier
> entries in the list take precedence.
>
> The original implementation of `notmuch-search-color-line' followed the
> documentation of the user-visible variable, but this was changed by
> commit 60ebc849 in July 2012.
>
> I'm inclined to go with the documentation and change the implementation,
> but this could obviously ruin things for some users until they reorder
> their settings.
>
> Thoughts?
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

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

* Re: precedence in `notmuch-search-line-faces'
  2014-05-04  7:31 ` Mark Walters
@ 2014-05-06  9:40   ` David Edmondson
  2014-05-06  9:42     ` [PATCH] emacs: Correct the documentation for `notmuch-search-line-faces' David Edmondson
  2014-05-06 10:03     ` David Edmondson
  0 siblings, 2 replies; 9+ messages in thread
From: David Edmondson @ 2014-05-06  9:40 UTC (permalink / raw)
  To: Mark Walters, notmuch

[-- Attachment #1: Type: text/plain, Size: 340 bytes --]

On Sun, May 04 2014, Mark Walters wrote:
> I have a slight preference for making it do the comment (ie reverse the
> list). My reason is that we have some other cases such as
> notmuch-tag-format that apply the first match, so users might be used to
> having the specific first and the more general later.

That makes sense. Patch follows.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 310 bytes --]

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

* [PATCH] emacs: Correct the documentation for `notmuch-search-line-faces'.
  2014-05-06  9:40   ` David Edmondson
@ 2014-05-06  9:42     ` David Edmondson
  2014-05-06 10:03     ` David Edmondson
  1 sibling, 0 replies; 9+ messages in thread
From: David Edmondson @ 2014-05-06  9:42 UTC (permalink / raw)
  To: notmuch

The implementation and documentation for `notmuch-search-line-faces'
disagreed in how elements in the list were merged. Correct the
documentation to match the implementation (that is, the earlier
elements in the list have precedence over later elements).
---
 emacs/notmuch.el | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 6c0bc1b..8aa0104 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -647,12 +647,12 @@ of the result."
 Here is an example of how to color search results based on tags.
  (the following text would be placed in your ~/.emacs file):
 
- (setq notmuch-search-line-faces '((\"deleted\" . (:foreground \"red\"
-						  :background \"blue\"))
-                                   (\"unread\" . (:foreground \"green\"))))
+ (setq notmuch-search-line-faces '((\"unread\" . (:foreground \"green\"))
+                                   (\"deleted\" . (:foreground \"red\"
+						  :background \"blue\"))))
 
-The attributes defined for matching tags are merged, with later
-attributes overriding earlier. A message having both \"deleted\"
+The attributes defined for matching tags are merged, with earlier
+attributes overriding later. A message having both \"deleted\"
 and \"unread\" tags with the above settings would have a green
 foreground and blue background."
   :type '(alist :key-type (string) :value-type (custom-face-edit))
-- 
2.0.0.rc0

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

* [PATCH] emacs: Correct the documentation for `notmuch-search-line-faces'.
  2014-05-06  9:40   ` David Edmondson
  2014-05-06  9:42     ` [PATCH] emacs: Correct the documentation for `notmuch-search-line-faces' David Edmondson
@ 2014-05-06 10:03     ` David Edmondson
  2014-05-06 10:09       ` David Edmondson
                         ` (2 more replies)
  1 sibling, 3 replies; 9+ messages in thread
From: David Edmondson @ 2014-05-06 10:03 UTC (permalink / raw)
  To: notmuch

The implementation and documentation for `notmuch-search-line-faces'
disagreed in how elements in the list were merged. Correct the
documentation to match the implementation (that is, the earlier
elements in the list have precedence over later elements).
---
 emacs/notmuch.el | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 6c0bc1b..8aa0104 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -647,12 +647,12 @@ of the result."
 Here is an example of how to color search results based on tags.
  (the following text would be placed in your ~/.emacs file):
 
- (setq notmuch-search-line-faces '((\"deleted\" . (:foreground \"red\"
-						  :background \"blue\"))
-                                   (\"unread\" . (:foreground \"green\"))))
+ (setq notmuch-search-line-faces '((\"unread\" . (:foreground \"green\"))
+                                   (\"deleted\" . (:foreground \"red\"
+						  :background \"blue\"))))
 
-The attributes defined for matching tags are merged, with later
-attributes overriding earlier. A message having both \"deleted\"
+The attributes defined for matching tags are merged, with earlier
+attributes overriding later. A message having both \"deleted\"
 and \"unread\" tags with the above settings would have a green
 foreground and blue background."
   :type '(alist :key-type (string) :value-type (custom-face-edit))
-- 
2.0.0.rc0

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

* Re: [PATCH] emacs: Correct the documentation for `notmuch-search-line-faces'.
  2014-05-06 10:03     ` David Edmondson
@ 2014-05-06 10:09       ` David Edmondson
  2014-05-06 18:33       ` Tomi Ollila
  2014-05-17 21:47       ` David Bremner
  2 siblings, 0 replies; 9+ messages in thread
From: David Edmondson @ 2014-05-06 10:09 UTC (permalink / raw)
  To: notmuch

[-- Attachment #1: Type: text/plain, Size: 72 bytes --]

Sorry for the duplicates - MTA troubles. The two versions are the same.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 310 bytes --]

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

* Re: [PATCH] emacs: Correct the documentation for `notmuch-search-line-faces'.
  2014-05-06 10:03     ` David Edmondson
  2014-05-06 10:09       ` David Edmondson
@ 2014-05-06 18:33       ` Tomi Ollila
  2014-05-06 18:52         ` Mark Walters
  2014-05-17 21:47       ` David Bremner
  2 siblings, 1 reply; 9+ messages in thread
From: Tomi Ollila @ 2014-05-06 18:33 UTC (permalink / raw)
  To: David Edmondson, notmuch

On Tue, May 06 2014, David Edmondson <dme@dme.org> wrote:

> The implementation and documentation for `notmuch-search-line-faces'
> disagreed in how elements in the list were merged. Correct the
> documentation to match the implementation (that is, the earlier
> elements in the list have precedence over later elements).

LGTM.

Tomi



> ---
>  emacs/notmuch.el | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/emacs/notmuch.el b/emacs/notmuch.el
> index 6c0bc1b..8aa0104 100644
> --- a/emacs/notmuch.el
> +++ b/emacs/notmuch.el
> @@ -647,12 +647,12 @@ of the result."
>  Here is an example of how to color search results based on tags.
>   (the following text would be placed in your ~/.emacs file):
>  
> - (setq notmuch-search-line-faces '((\"deleted\" . (:foreground \"red\"
> -						  :background \"blue\"))
> -                                   (\"unread\" . (:foreground \"green\"))))
> + (setq notmuch-search-line-faces '((\"unread\" . (:foreground \"green\"))
> +                                   (\"deleted\" . (:foreground \"red\"
> +						  :background \"blue\"))))
>  
> -The attributes defined for matching tags are merged, with later
> -attributes overriding earlier. A message having both \"deleted\"
> +The attributes defined for matching tags are merged, with earlier
> +attributes overriding later. A message having both \"deleted\"
>  and \"unread\" tags with the above settings would have a green
>  foreground and blue background."
>    :type '(alist :key-type (string) :value-type (custom-face-edit))
> -- 
> 2.0.0.rc0
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

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

* Re: [PATCH] emacs: Correct the documentation for `notmuch-search-line-faces'.
  2014-05-06 18:33       ` Tomi Ollila
@ 2014-05-06 18:52         ` Mark Walters
  0 siblings, 0 replies; 9+ messages in thread
From: Mark Walters @ 2014-05-06 18:52 UTC (permalink / raw)
  To: Tomi Ollila, David Edmondson, notmuch


LGTM too +1

Mark

On Tue, 06 May 2014, Tomi Ollila <tomi.ollila@iki.fi> wrote:
> On Tue, May 06 2014, David Edmondson <dme@dme.org> wrote:
>
>> The implementation and documentation for `notmuch-search-line-faces'
>> disagreed in how elements in the list were merged. Correct the
>> documentation to match the implementation (that is, the earlier
>> elements in the list have precedence over later elements).
>
> LGTM.
>
> Tomi
>
>
>
>> ---
>>  emacs/notmuch.el | 10 +++++-----
>>  1 file changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/emacs/notmuch.el b/emacs/notmuch.el
>> index 6c0bc1b..8aa0104 100644
>> --- a/emacs/notmuch.el
>> +++ b/emacs/notmuch.el
>> @@ -647,12 +647,12 @@ of the result."
>>  Here is an example of how to color search results based on tags.
>>   (the following text would be placed in your ~/.emacs file):
>>  
>> - (setq notmuch-search-line-faces '((\"deleted\" . (:foreground \"red\"
>> -						  :background \"blue\"))
>> -                                   (\"unread\" . (:foreground \"green\"))))
>> + (setq notmuch-search-line-faces '((\"unread\" . (:foreground \"green\"))
>> +                                   (\"deleted\" . (:foreground \"red\"
>> +						  :background \"blue\"))))
>>  
>> -The attributes defined for matching tags are merged, with later
>> -attributes overriding earlier. A message having both \"deleted\"
>> +The attributes defined for matching tags are merged, with earlier
>> +attributes overriding later. A message having both \"deleted\"
>>  and \"unread\" tags with the above settings would have a green
>>  foreground and blue background."
>>    :type '(alist :key-type (string) :value-type (custom-face-edit))
>> -- 
>> 2.0.0.rc0
>>
>> _______________________________________________
>> notmuch mailing list
>> notmuch@notmuchmail.org
>> http://notmuchmail.org/mailman/listinfo/notmuch
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

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

* Re: [PATCH] emacs: Correct the documentation for `notmuch-search-line-faces'.
  2014-05-06 10:03     ` David Edmondson
  2014-05-06 10:09       ` David Edmondson
  2014-05-06 18:33       ` Tomi Ollila
@ 2014-05-17 21:47       ` David Bremner
  2 siblings, 0 replies; 9+ messages in thread
From: David Bremner @ 2014-05-17 21:47 UTC (permalink / raw)
  To: David Edmondson, notmuch

David Edmondson <dme@dme.org> writes:

> The implementation and documentation for `notmuch-search-line-faces'
> disagreed in how elements in the list were merged. Correct the
> documentation to match the implementation (that is, the earlier
> elements in the list have precedence over later elements).

pushed to master.

d

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

end of thread, other threads:[~2014-05-17 21:48 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-02 11:14 precedence in `notmuch-search-line-faces' David Edmondson
2014-05-04  7:31 ` Mark Walters
2014-05-06  9:40   ` David Edmondson
2014-05-06  9:42     ` [PATCH] emacs: Correct the documentation for `notmuch-search-line-faces' David Edmondson
2014-05-06 10:03     ` David Edmondson
2014-05-06 10:09       ` David Edmondson
2014-05-06 18:33       ` Tomi Ollila
2014-05-06 18:52         ` Mark Walters
2014-05-17 21:47       ` David Bremner

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