Subject: bug#13173: closed (Re: bug#13173: [PATCH] sieve-mode.el: Keywords should be word delimited.)

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 14 Dec 2012 04:29:02 +0000

Your bug report

#13173: [PATCH] sieve-mode.el: Keywords should be word delimited.

which was filed against the emacs,gnus package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
13173: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13173
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#13173: [PATCH] sieve-mode.el: Keywords should be word delimited.
From: Glenn Morris <[email-masked]>
To: [email-masked]
Date: Thu, 13 Dec 2012 23:27:38 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

Version: 24.4

Thanks; applied.

Subject: [PATCH] sieve-mode.el: Keywords should be word delimited.
From: "Akinori MUSHA" <[email-masked]>
To: [email-masked]
Date: Fri, 14 Dec 2012 00:03:13 +0900
List-Id: <debbugs-submit.debbugs.gnu.org>

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  <[email-masked]>
+
+	* sieve-mode.el (sieve-font-lock-keywords): Keywords should be word
+	delimited.
+
 2012-12-06  Sam Steingold  <[email-masked]>
 
 	* 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/