Re: notmuch-tag failing on trailing space

2021-08-16 Thread Tomi Ollila
On Mon, Aug 16 2021, David Edmondson wrote:

> On Monday, 2021-08-16 at 08:17:56 -07, David Bremner wrote:
>
>> Alan Schmitt  writes:
>>
>>>
>>> #+begin_src emacs-lisp
>>>   (defun trim-tag-changes (args)
>>> (list (car args) (mapcar #'s-trim-right (cadr args
>>>   (advice-add 'notmuch-tag :filter-args #'trim-tag-changes)
>>> #+end_src
>>>
>>> Could it be integrated directly in the notmuch-tag function?
>>>
>>
>> That particular function won't work for us because it would introduce a
>> new dependency on s.el. But if someone wants to make an equivalent using
>> only core emacs functions and integrate it into notmuch-tag, that seems
>> likely OK to me.
>
> What if someone has trailing spaces on their tags deliberately?
>
> This seems like an oddity of the code in `notmuch-read-tag-changes' that
> appends a space to every possible completion. It would probably be a
> more annoying change to some users, but I'd be more inclined to remove
> that code than this change.

I'd also fix the source of the problem rather than the outcome...

Tomi
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: notmuch-tag failing on trailing space

2021-08-16 Thread David Bremner
Alan Schmitt  writes:

>
> #+begin_src emacs-lisp
>   (defun trim-tag-changes (args)
> (list (car args) (mapcar #'s-trim-right (cadr args
>   (advice-add 'notmuch-tag :filter-args #'trim-tag-changes)
> #+end_src
>
> Could it be integrated directly in the notmuch-tag function?
>

That particular function won't work for us because it would introduce a
new dependency on s.el. But if someone wants to make an equivalent using
only core emacs functions and integrate it into notmuch-tag, that seems
likely OK to me.

d
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: notmuch-tag failing on trailing space

2021-08-16 Thread Alan Schmitt
Hello,

On 2021-07-27 10:24, alan.schm...@polytechnique.org writes:

> I have an issue when using the vertico completion system to add tags to
> messages that boils down to the following: the notmuch-tag function is
> called like this:
>   notmuch-tag("id:CA+b3G33ad9PX5SuOwqaWS8TWBTtZcdguKtcQ3XmPvzSCsU..." ("+cwn 
> "))
> and it fails because of the extra space at the end.
>
> Could notmuch-tag be modified to accept trailing spaces?

Someone on the doom discord suggested the following workaround.

#+begin_src emacs-lisp
  (defun trim-tag-changes (args)
(list (car args) (mapcar #'s-trim-right (cadr args
  (advice-add 'notmuch-tag :filter-args #'trim-tag-changes)
#+end_src

Could it be integrated directly in the notmuch-tag function?

Best,

Alan


signature.asc
Description: PGP signature
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: notmuch-tag failing on trailing space

2021-07-27 Thread Tomi Ollila
On Tue, Jul 27 2021, alan schmitt wrote:

> Hello,
>
> I have an issue when using the vertico completion system to add tags to
> messages that boils down to the following: the notmuch-tag function is
> called like this:
>   notmuch-tag("id:CA+b3G33ad9PX5SuOwqaWS8TWBTtZcdguKtcQ3XmPvzSCsU..." ("+cwn 
> "))
> and it fails because of the extra space at the end.
>
> Could notmuch-tag be modified to accept trailing spaces?

$ notmuch tag '+foo ' id:87im0w6u5r@m4x.org

works -- the tag is 'foo ' in this case.

The following fails (what I tried first based on your sample above):

$ notmuch tag id:87im0w6u5r@m4x.org '+foo '
Error: 'notmuch tag' requires at least one tag to add or remove.

(i.e. tags first then search terms)

>
> Thanks,
>
> Alan

Tomi
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


notmuch-tag failing on trailing space

2021-07-27 Thread alan . schmitt
Hello,

I have an issue when using the vertico completion system to add tags to
messages that boils down to the following: the notmuch-tag function is
called like this:
  notmuch-tag("id:CA+b3G33ad9PX5SuOwqaWS8TWBTtZcdguKtcQ3XmPvzSCsU..." ("+cwn "))
and it fails because of the extra space at the end.

Could notmuch-tag be modified to accept trailing spaces?

Thanks,

Alan


signature.asc
Description: PGP signature
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org