summaryrefslogtreecommitdiff
path: root/lisp/hi-lock.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2001-03-09 21:16:24 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2001-03-09 21:16:24 +0000
commitb18f5523f42e8699cf7a3e6b35eeaf21ae045ad6 (patch)
treef51d08844ec452b40e50afcd6c9d16bac4e5c62a /lisp/hi-lock.el
parentf9db8f1954266304bbbe751d7f59f35bc07ef311 (diff)
downloademacs-b18f5523f42e8699cf7a3e6b35eeaf21ae045ad6.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