summaryrefslogtreecommitdiff
path: root/lisp/hi-lock.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2001-03-09 21:16:18 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2001-03-09 21:16:18 +0000
commit3681d88c488985c82c1b895282ce08c82ca694fd (patch)
treebe4238fabccf0139cd01931a04f3908807fb0638 /lisp/hi-lock.el
parent29b3f58ea824a962d05ba2db7f38d5f7a1996fdc (diff)
downloademacs-3681d88c488985c82c1b895282ce08c82ca694fd.tar.gz
(hi-lock-line-face-buffer): Wrap the regexp in a group
so ^, $, *, ? and + are interpreted correctly.
Diffstat (limited to 'lisp/hi-lock.el')
-rw-r--r--lisp/hi-lock.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el
index 610a217916f..e37cb94d1a9 100644
--- a/lisp/hi-lock.el
+++ b/lisp/hi-lock.el
@@ -334,7 +334,9 @@ list maintained for regexps, global history maintained for faces.
(unless hi-lock-mode (hi-lock-mode))
(or (facep face) (setq face 'rwl-yellow))
(hi-lock-set-pattern
- (list (concat "^.*" regexp ".*$") (list 0 (list 'quote face) t))))
+ ;; The \\(?:...\\) grouping construct ensures that a leading ^, +, * or ?
+ ;; or a trailing $ in REGEXP will be interpreted correctly.
+ (list (concat "^.*\\(?:" regexp "\\).*$") (list 0 (list 'quote face) t))))
;;;###autoload