unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#13173: [PATCH] sieve-mode.el: Keywords should be word delimited.
@ 2012-12-13 15:03 Akinori MUSHA
  2012-12-14  4:27 ` Glenn Morris
       [not found] ` <handler.13173.D13173.135545931710813.notifdone@debbugs.gnu.org>
  0 siblings, 2 replies; 5+ messages in thread
From: Akinori MUSHA @ 2012-12-13 15:03 UTC (permalink / raw)
  To: 13173

In sieve-mode, font-lock keywords will wrongly match because the
regexp patterns are unaware of word boundaries.

For example, if you put an action command "notify", it is highlighted
as "not"+"if"+y.

Apply the following simple patch to fix that.

---
 lisp/gnus/ChangeLog     | 5 +++++
 lisp/gnus/sieve-mode.el | 9 ++++++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 601ed0c..42b3e59 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,8 @@
+2012-12-13  Akinori MUSHA  <knu@iDaemons.org>
+
+	* sieve-mode.el (sieve-font-lock-keywords): Keywords should be word
+	delimited.
+
 2012-12-06  Sam Steingold  <sds@gnu.org>
 
 	* gnus-start.el (gnus-before-resume-hook): Add.
diff --git a/lisp/gnus/sieve-mode.el b/lisp/gnus/sieve-mode.el
index f49f767..32abbfe 100644
--- a/lisp/gnus/sieve-mode.el
+++ b/lisp/gnus/sieve-mode.el
@@ -131,14 +131,17 @@
   (eval-when-compile
     (list
      ;; control commands
-     (cons (regexp-opt '("require" "if" "else" "elsif" "stop"))
+     (cons (regexp-opt '("require" "if" "else" "elsif" "stop")
+                       'words)
 	   'sieve-control-commands-face)
      ;; action commands
-     (cons (regexp-opt '("fileinto" "redirect" "reject" "keep" "discard"))
+     (cons (regexp-opt '("fileinto" "redirect" "reject" "keep" "discard")
+                       'words)
 	   'sieve-action-commands-face)
      ;; test commands
      (cons (regexp-opt '("address" "allof" "anyof" "exists" "false"
-			 "true" "header" "not" "size" "envelope"))
+			 "true" "header" "not" "size" "envelope")
+                       'words)
 	   'sieve-test-commands-face)
      (cons "\\Sw+:\\sw+"
 	   'sieve-tagged-arguments-face))))
-- 
1.8.0.1

-- 
Akinori MUSHA / http://akinori.org/





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

* bug#13173: [PATCH] sieve-mode.el: Keywords should be word delimited.
  2012-12-13 15:03 bug#13173: [PATCH] sieve-mode.el: Keywords should be word delimited Akinori MUSHA
@ 2012-12-14  4:27 ` Glenn Morris
       [not found] ` <handler.13173.D13173.135545931710813.notifdone@debbugs.gnu.org>
  1 sibling, 0 replies; 5+ messages in thread
From: Glenn Morris @ 2012-12-14  4:27 UTC (permalink / raw)
  To: 13173-done

Version: 24.4

Thanks; applied.





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

* bug#13173: closed (Re: bug#13173: [PATCH] sieve-mode.el: Keywords should be word delimited.)
       [not found] ` <handler.13173.D13173.135545931710813.notifdone@debbugs.gnu.org>
@ 2012-12-28  1:49   ` Akinori MUSHA
  2012-12-28  1:52     ` Glenn Morris
  0 siblings, 1 reply; 5+ messages in thread
From: Akinori MUSHA @ 2012-12-28  1:49 UTC (permalink / raw)
  To: 13173

Could you merge this fix to the emacs-24 branch?

-- 
Akinori MUSHA / http://akinori.org/





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

* bug#13173: closed (Re: bug#13173: [PATCH] sieve-mode.el: Keywords should be word delimited.)
  2012-12-28  1:49   ` bug#13173: closed (Re: bug#13173: [PATCH] sieve-mode.el: Keywords should be word delimited.) Akinori MUSHA
@ 2012-12-28  1:52     ` Glenn Morris
  2012-12-28  1:58       ` Akinori MUSHA
  0 siblings, 1 reply; 5+ messages in thread
From: Glenn Morris @ 2012-12-28  1:52 UTC (permalink / raw)
  To: Akinori MUSHA; +Cc: 13173

"Akinori MUSHA" wrote:

> Could you merge this fix to the emacs-24 branch?

Nope, sorry. It's a long-standing piece of font-lock trivia, so I prefer
to err on the side of extreme caution and leave it for 24.4.





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

* bug#13173: closed (Re: bug#13173: [PATCH] sieve-mode.el: Keywords should be word delimited.)
  2012-12-28  1:52     ` Glenn Morris
@ 2012-12-28  1:58       ` Akinori MUSHA
  0 siblings, 0 replies; 5+ messages in thread
From: Akinori MUSHA @ 2012-12-28  1:58 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 13173

At Thu, 27 Dec 2012 20:52:26 -0500,
Glenn Morris wrote:
> "Akinori MUSHA" wrote:
> 
> > Could you merge this fix to the emacs-24 branch?
> 
> Nope, sorry. It's a long-standing piece of font-lock trivia, so I prefer
> to err on the side of extreme caution and leave it for 24.4.

OK.  Sorry for the bother!

-- 
Akinori MUSHA / http://akinori.org/





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

end of thread, other threads:[~2012-12-28  1:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-13 15:03 bug#13173: [PATCH] sieve-mode.el: Keywords should be word delimited Akinori MUSHA
2012-12-14  4:27 ` Glenn Morris
     [not found] ` <handler.13173.D13173.135545931710813.notifdone@debbugs.gnu.org>
2012-12-28  1:49   ` bug#13173: closed (Re: bug#13173: [PATCH] sieve-mode.el: Keywords should be word delimited.) Akinori MUSHA
2012-12-28  1:52     ` Glenn Morris
2012-12-28  1:58       ` Akinori MUSHA

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

	https://git.savannah.gnu.org/cgit/emacs.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).