[BUG] Notmuch keeps adding notmuch-address-expand-name to message-completion-alist

classic Classic list List threaded Threaded
7 messages Options
Attic Hermit Attic Hermit
Reply | Threaded
Open this post in threaded view
|

[BUG] Notmuch keeps adding notmuch-address-expand-name to message-completion-alist

When I invocate compose-mail or something related with the message-mode
buffer and Notmuch, Notmuch keeps adding a pair like below to
`message-completion-alist`:

  ("^\\(Resent-\\)?\\(To\\|B?Cc\\|Reply-To\\|From\\|Mail-Followup-To\\|Mail-Copies-To\\):"
  . notmuch-address-expand-name)

I think there's bug in `notmuch-address-setup` on `notmuch-address.el`.
It checks that the pair exists in the `message-completion-alist` by
`memq`, but it seems to be amended to `member` instead.

P.S. Because I'm not a programming expert or a student, I don't know how
to send a patch to amend this problem. So I send where the bug was found
and the way how I tinkered it in English. I searched the file where bug
exists in the git repository of Notmuch, and found that there still was
a bug. I hope this will help to fix the bug.
--
Attic Hermit
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|

Re: [BUG] Notmuch keeps adding notmuch-address-expand-name to message-completion-alist

Attic Hermit <[hidden email]> writes:

> When I invocate compose-mail or something related with the message-mode
> buffer and Notmuch, Notmuch keeps adding a pair like below to
> `message-completion-alist`:
>
>   ("^\\(Resent-\\)?\\(To\\|B?Cc\\|Reply-To\\|From\\|Mail-Followup-To\\|Mail-Copies-To\\):"
>   . notmuch-address-expand-name)
>

I don't know much about the cause, but I can confirm that many such
pairs are added to this list.

d
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
Attic Hermit Attic Hermit
Reply | Threaded
Open this post in threaded view
|

Re: [BUG] Notmuch keeps adding notmuch-address-expand-name to message-completion-alist

You can get rid of the bug by using `member` instead of `memq` in
`nomtuch-address-setup`:

diff -u a/notmuch-address.el b/notmuch-address.el
--- a/notmuch-address.el 2017-08-05 18:45:40.000000000 +0900
+++ b/notmuch-address.el 2017-09-11 19:40:41.230872915 +0900
@@ -159,7 +159,7 @@
        #'notmuch-address-expand-name)))
       (when setup-company
  (notmuch-company-setup))
-      (unless (memq pair message-completion-alist)
+      (unless (member pair message-completion-alist)
  (setq message-completion-alist
       (push pair message-completion-alist)))))

David Bremner <[hidden email]> writes:

> Attic Hermit <[hidden email]> writes:
>
>> When I invocate compose-mail or something related with the message-mode
>> buffer and Notmuch, Notmuch keeps adding a pair like below to
>> `message-completion-alist`:
>>
>>   ("^\\(Resent-\\)?\\(To\\|B?Cc\\|Reply-To\\|From\\|Mail-Followup-To\\|Mail-Copies-To\\):"
>>   . notmuch-address-expand-name)
>>
>
> I don't know much about the cause, but I can confirm that many such
> pairs are added to this list.
>
> d
--
Attic Hermit
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|

[PATCH] emacs/address: use member instead of memq to check for pair

Quoting from the elisp reference:

     For other types (e.g., lists, vectors, strings), two arguments
     with the same contents or elements are not necessarily ‘eq’ to
     each other.

Thanks to "Attic Hermit" for the fix.
---
 emacs/notmuch-address.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el
index f937e708..64887a43 100644
--- a/emacs/notmuch-address.el
+++ b/emacs/notmuch-address.el
@@ -159,7 +159,7 @@ matching `notmuch-address-completion-headers-regexp'.
        #'notmuch-address-expand-name)))
       (when setup-company
  (notmuch-company-setup))
-      (unless (memq pair message-completion-alist)
+      (unless (member pair message-completion-alist)
  (setq message-completion-alist
       (push pair message-completion-alist)))))
 
--
2.14.1

_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
David Edmondson David Edmondson
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] emacs/address: use member instead of memq to check for pair

Looks good.

On Tuesday, 2017-09-12 at 22:31:46 -0300, David Bremner wrote:

> Quoting from the elisp reference:
>
>      For other types (e.g., lists, vectors, strings), two arguments
>      with the same contents or elements are not necessarily ‘eq’ to
>      each other.
>
> Thanks to "Attic Hermit" for the fix.
> ---
>  emacs/notmuch-address.el | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el
> index f937e708..64887a43 100644
> --- a/emacs/notmuch-address.el
> +++ b/emacs/notmuch-address.el
> @@ -159,7 +159,7 @@ matching `notmuch-address-completion-headers-regexp'.
>         #'notmuch-address-expand-name)))
>        (when setup-company
>   (notmuch-company-setup))
> -      (unless (memq pair message-completion-alist)
> +      (unless (member pair message-completion-alist)
>   (setq message-completion-alist
>        (push pair message-completion-alist)))))
>  
> --
> 2.14.1
>
> _______________________________________________
> notmuch mailing list
> [hidden email]
> https://notmuchmail.org/mailman/listinfo/notmuch

dme.
--
And the sign said: long haired freaky people need not apply.
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] emacs/address: use member instead of memq to check for pair

In reply to this post by David Bremner-2
David Bremner <[hidden email]> writes:

> Quoting from the elisp reference:
>
>      For other types (e.g., lists, vectors, strings), two arguments
>      with the same contents or elements are not necessarily ‘eq’ to
>      each other.
>
> Thanks to "Attic Hermit" for the fix.

pushed to master
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
Attic Hermit Attic Hermit
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] emacs/address: use member instead of memq to check for pair


Nice. Thank you for your lightning fast fix and push.

David Bremner <[hidden email]> writes:

> David Bremner <[hidden email]> writes:
>
>> Quoting from the elisp reference:
>>
>>      For other types (e.g., lists, vectors, strings), two arguments
>>      with the same contents or elements are not necessarily ‘eq’ to
>>      each other.
>>
>> Thanks to "Attic Hermit" for the fix.
>
> pushed to master
> _______________________________________________
> notmuch mailing list
> [hidden email]
> https://notmuchmail.org/mailman/listinfo/notmuch
--
Attic Hermit
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch