[PATCH 7/6] emacs: relax tag syntax check in `notmuch-tag' function

2012-02-19 Thread Pieter Praet
On Sat, 28 Jan 2012 10:56:21 +0200, Jani Nikula  wrote:
> On Jan 28, 2012 7:06 AM, "Dmitry Kurochkin" 
> wrote:
> >
> > The tag syntax check in `notmuch-tag' function was too strict and did
> > not allow nmbug tags with "::".  Since the check is done for all
> > tagging operations in Emacs UI, this basically means that no nmbug
> > tags can be changed.  The patch relaxes the tag syntax check to allow
> > any tag names that do not include whitespace characters.
> 
> Imho the syntax check should be in cli, or lib even. I posted a patch to
> cli some time ago when I realized it's possible to add tag "-" but you
> can't remove it with the current cli. (On the road, can't find the message
> id now.)
>

Here you go:
  id:"3da260c7687fafe2cbc17bad129a8b1edb05c6d0.1320958534.git.jani at 
nikula.org"

> > ---
> >  emacs/notmuch.el |2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/emacs/notmuch.el b/emacs/notmuch.el
> > index 9813e0a..0de6123 100644
> > --- a/emacs/notmuch.el
> > +++ b/emacs/notmuch.el
> > @@ -555,7 +555,7 @@ notmuch-after-tag-hook will be run."
> >   ;; Perform some validation
> >   (when (null tags) (error "No tags given"))
> >   (mapc (lambda (tag)
> > - (unless (string-match-p "^[-+][-+_.[:word:]]+$" tag)
> > + (unless (string-match-p "^[-+]\\S-+$" tag)
> >(error "Tag must be of the form `+this_tag' or `-that_tag'")))
> >tags)
> >   (run-hooks 'notmuch-before-tag-hook)
> > --
> > 1.7.8.3
> >
> > ___
> > notmuch mailing list
> > notmuch at notmuchmail.org
> > http://notmuchmail.org/mailman/listinfo/notmuch
Non-text part: text/html
> ___
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


Peace

-- 
Pieter


Re: [PATCH 7/6] emacs: relax tag syntax check in `notmuch-tag' function

2012-02-19 Thread Pieter Praet
On Sat, 28 Jan 2012 10:56:21 +0200, Jani Nikula  wrote:
> On Jan 28, 2012 7:06 AM, "Dmitry Kurochkin" 
> wrote:
> >
> > The tag syntax check in `notmuch-tag' function was too strict and did
> > not allow nmbug tags with "::".  Since the check is done for all
> > tagging operations in Emacs UI, this basically means that no nmbug
> > tags can be changed.  The patch relaxes the tag syntax check to allow
> > any tag names that do not include whitespace characters.
> 
> Imho the syntax check should be in cli, or lib even. I posted a patch to
> cli some time ago when I realized it's possible to add tag "-" but you
> can't remove it with the current cli. (On the road, can't find the message
> id now.)
>

Here you go:
  id:"3da260c7687fafe2cbc17bad129a8b1edb05c6d0.1320958534.git.j...@nikula.org"

> > ---
> >  emacs/notmuch.el |2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/emacs/notmuch.el b/emacs/notmuch.el
> > index 9813e0a..0de6123 100644
> > --- a/emacs/notmuch.el
> > +++ b/emacs/notmuch.el
> > @@ -555,7 +555,7 @@ notmuch-after-tag-hook will be run."
> >   ;; Perform some validation
> >   (when (null tags) (error "No tags given"))
> >   (mapc (lambda (tag)
> > - (unless (string-match-p "^[-+][-+_.[:word:]]+$" tag)
> > + (unless (string-match-p "^[-+]\\S-+$" tag)
> >(error "Tag must be of the form `+this_tag' or `-that_tag'")))
> >tags)
> >   (run-hooks 'notmuch-before-tag-hook)
> > --
> > 1.7.8.3
> >
> > ___
> > notmuch mailing list
> > notmuch@notmuchmail.org
> > http://notmuchmail.org/mailman/listinfo/notmuch
Non-text part: text/html
> ___
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


Peace

-- 
Pieter
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH 7/6] emacs: relax tag syntax check in `notmuch-tag' function

2012-01-28 Thread Dmitry Kurochkin
On Sat, 28 Jan 2012 10:56:21 +0200, Jani Nikula  wrote:
> On Jan 28, 2012 7:06 AM, "Dmitry Kurochkin" 
> wrote:
> >
> > The tag syntax check in `notmuch-tag' function was too strict and did
> > not allow nmbug tags with "::".  Since the check is done for all
> > tagging operations in Emacs UI, this basically means that no nmbug
> > tags can be changed.  The patch relaxes the tag syntax check to allow
> > any tag names that do not include whitespace characters.
> 
> Imho the syntax check should be in cli, or lib even. I posted a patch to
> cli some time ago when I realized it's possible to add tag "-" but you
> can't remove it with the current cli. (On the road, can't find the message
> id now.)
> 

I agree that this is an issue (a general issue for notmuch, not just
Emacs UI).  But it is outside of scope of this patch.  This patch
purpose is just to solve an immediate issue with a broken regexp.

Regards,
  Dmitry

> > ---
> >  emacs/notmuch.el |2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/emacs/notmuch.el b/emacs/notmuch.el
> > index 9813e0a..0de6123 100644
> > --- a/emacs/notmuch.el
> > +++ b/emacs/notmuch.el
> > @@ -555,7 +555,7 @@ notmuch-after-tag-hook will be run."
> >   ;; Perform some validation
> >   (when (null tags) (error "No tags given"))
> >   (mapc (lambda (tag)
> > - (unless (string-match-p "^[-+][-+_.[:word:]]+$" tag)
> > + (unless (string-match-p "^[-+]\\S-+$" tag)
> >(error "Tag must be of the form `+this_tag' or `-that_tag'")))
> >tags)
> >   (run-hooks 'notmuch-before-tag-hook)
> > --
> > 1.7.8.3
> >
> > ___
> > notmuch mailing list
> > notmuch at notmuchmail.org
> > http://notmuchmail.org/mailman/listinfo/notmuch
Non-text part: text/html


[PATCH 7/6] emacs: relax tag syntax check in `notmuch-tag' function

2012-01-28 Thread Jani Nikula
On Jan 28, 2012 7:06 AM, "Dmitry Kurochkin" 
wrote:
>
> The tag syntax check in `notmuch-tag' function was too strict and did
> not allow nmbug tags with "::".  Since the check is done for all
> tagging operations in Emacs UI, this basically means that no nmbug
> tags can be changed.  The patch relaxes the tag syntax check to allow
> any tag names that do not include whitespace characters.

Imho the syntax check should be in cli, or lib even. I posted a patch to
cli some time ago when I realized it's possible to add tag "-" but you
can't remove it with the current cli. (On the road, can't find the message
id now.)

> ---
>  emacs/notmuch.el |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/emacs/notmuch.el b/emacs/notmuch.el
> index 9813e0a..0de6123 100644
> --- a/emacs/notmuch.el
> +++ b/emacs/notmuch.el
> @@ -555,7 +555,7 @@ notmuch-after-tag-hook will be run."
>   ;; Perform some validation
>   (when (null tags) (error "No tags given"))
>   (mapc (lambda (tag)
> - (unless (string-match-p "^[-+][-+_.[:word:]]+$" tag)
> + (unless (string-match-p "^[-+]\\S-+$" tag)
>(error "Tag must be of the form `+this_tag' or `-that_tag'")))
>tags)
>   (run-hooks 'notmuch-before-tag-hook)
> --
> 1.7.8.3
>
> ___
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch
-- next part --
An HTML attachment was scrubbed...
URL: 



[PATCH 7/6] emacs: relax tag syntax check in `notmuch-tag' function

2012-01-28 Thread Dmitry Kurochkin
The tag syntax check in `notmuch-tag' function was too strict and did
not allow nmbug tags with "::".  Since the check is done for all
tagging operations in Emacs UI, this basically means that no nmbug
tags can be changed.  The patch relaxes the tag syntax check to allow
any tag names that do not include whitespace characters.
---
 emacs/notmuch.el |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 9813e0a..0de6123 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -555,7 +555,7 @@ notmuch-after-tag-hook will be run."
   ;; Perform some validation
   (when (null tags) (error "No tags given"))
   (mapc (lambda (tag)
- (unless (string-match-p "^[-+][-+_.[:word:]]+$" tag)
+ (unless (string-match-p "^[-+]\\S-+$" tag)
(error "Tag must be of the form `+this_tag' or `-that_tag'")))
tags)
   (run-hooks 'notmuch-before-tag-hook)
-- 
1.7.8.3



Re: [PATCH 7/6] emacs: relax tag syntax check in `notmuch-tag' function

2012-01-28 Thread Dmitry Kurochkin
On Sat, 28 Jan 2012 10:56:21 +0200, Jani Nikula  wrote:
> On Jan 28, 2012 7:06 AM, "Dmitry Kurochkin" 
> wrote:
> >
> > The tag syntax check in `notmuch-tag' function was too strict and did
> > not allow nmbug tags with "::".  Since the check is done for all
> > tagging operations in Emacs UI, this basically means that no nmbug
> > tags can be changed.  The patch relaxes the tag syntax check to allow
> > any tag names that do not include whitespace characters.
> 
> Imho the syntax check should be in cli, or lib even. I posted a patch to
> cli some time ago when I realized it's possible to add tag "-" but you
> can't remove it with the current cli. (On the road, can't find the message
> id now.)
> 

I agree that this is an issue (a general issue for notmuch, not just
Emacs UI).  But it is outside of scope of this patch.  This patch
purpose is just to solve an immediate issue with a broken regexp.

Regards,
  Dmitry

> > ---
> >  emacs/notmuch.el |2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/emacs/notmuch.el b/emacs/notmuch.el
> > index 9813e0a..0de6123 100644
> > --- a/emacs/notmuch.el
> > +++ b/emacs/notmuch.el
> > @@ -555,7 +555,7 @@ notmuch-after-tag-hook will be run."
> >   ;; Perform some validation
> >   (when (null tags) (error "No tags given"))
> >   (mapc (lambda (tag)
> > - (unless (string-match-p "^[-+][-+_.[:word:]]+$" tag)
> > + (unless (string-match-p "^[-+]\\S-+$" tag)
> >(error "Tag must be of the form `+this_tag' or `-that_tag'")))
> >tags)
> >   (run-hooks 'notmuch-before-tag-hook)
> > --
> > 1.7.8.3
> >
> > ___
> > notmuch mailing list
> > notmuch@notmuchmail.org
> > http://notmuchmail.org/mailman/listinfo/notmuch
Non-text part: text/html
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH 7/6] emacs: relax tag syntax check in `notmuch-tag' function

2012-01-28 Thread Jani Nikula
On Jan 28, 2012 7:06 AM, "Dmitry Kurochkin" 
wrote:
>
> The tag syntax check in `notmuch-tag' function was too strict and did
> not allow nmbug tags with "::".  Since the check is done for all
> tagging operations in Emacs UI, this basically means that no nmbug
> tags can be changed.  The patch relaxes the tag syntax check to allow
> any tag names that do not include whitespace characters.

Imho the syntax check should be in cli, or lib even. I posted a patch to
cli some time ago when I realized it's possible to add tag "-" but you
can't remove it with the current cli. (On the road, can't find the message
id now.)

> ---
>  emacs/notmuch.el |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/emacs/notmuch.el b/emacs/notmuch.el
> index 9813e0a..0de6123 100644
> --- a/emacs/notmuch.el
> +++ b/emacs/notmuch.el
> @@ -555,7 +555,7 @@ notmuch-after-tag-hook will be run."
>   ;; Perform some validation
>   (when (null tags) (error "No tags given"))
>   (mapc (lambda (tag)
> - (unless (string-match-p "^[-+][-+_.[:word:]]+$" tag)
> + (unless (string-match-p "^[-+]\\S-+$" tag)
>(error "Tag must be of the form `+this_tag' or `-that_tag'")))
>tags)
>   (run-hooks 'notmuch-before-tag-hook)
> --
> 1.7.8.3
>
> ___
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH 7/6] emacs: relax tag syntax check in `notmuch-tag' function

2012-01-27 Thread Dmitry Kurochkin
The tag syntax check in `notmuch-tag' function was too strict and did
not allow nmbug tags with "::".  Since the check is done for all
tagging operations in Emacs UI, this basically means that no nmbug
tags can be changed.  The patch relaxes the tag syntax check to allow
any tag names that do not include whitespace characters.
---
 emacs/notmuch.el |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 9813e0a..0de6123 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -555,7 +555,7 @@ notmuch-after-tag-hook will be run."
   ;; Perform some validation
   (when (null tags) (error "No tags given"))
   (mapc (lambda (tag)
- (unless (string-match-p "^[-+][-+_.[:word:]]+$" tag)
+ (unless (string-match-p "^[-+]\\S-+$" tag)
(error "Tag must be of the form `+this_tag' or `-that_tag'")))
tags)
   (run-hooks 'notmuch-before-tag-hook)
-- 
1.7.8.3

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch