diff lisp/hi-lock.el @ 36708:0e09b49d21b8

(hi-lock-line-face-buffer): Wrap the regexp in a group so ^, $, *, ? and + are interpreted correctly.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 09 Mar 2001 21:16:18 +0000
parents 06ff4f3266f8
children b174db545cfd
line wrap: on
line diff
--- a/lisp/hi-lock.el	Fri Mar 09 18:50:20 2001 +0000
+++ b/lisp/hi-lock.el	Fri Mar 09 21:16:18 2001 +0000
@@ -334,7 +334,9 @@
   (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