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

Previous Next

Packages: gnus, emacs;

Reported by: "Akinori MUSHA" <knu <at> iDaemons.org>

Date: Thu, 13 Dec 2012 16:58:03 UTC

Severity: minor

Tags: patch

Fixed in version 24.4

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: "Akinori MUSHA" <knu <at> iDaemons.org>
To: 13173 <at> debbugs.gnu.org
Subject: bug#13173: [PATCH] sieve-mode.el: Keywords should be word delimited.
Date: Fri, 14 Dec 2012 00:03:13 +0900
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 <at> iDaemons.org>
+
+	* sieve-mode.el (sieve-font-lock-keywords): Keywords should be word
+	delimited.
+
 2012-12-06  Sam Steingold  <sds <at> 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/




This bug report was last modified 12 years and 148 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.