# HG changeset patch # User Stefan Monnier # Date 984172578 0 # Node ID 0e09b49d21b8e8481c4fdf7dd490143275eac82f # Parent 1a49c651ad21e0f9e23594964fdc6454833032ca (hi-lock-line-face-buffer): Wrap the regexp in a group so ^, $, *, ? and + are interpreted correctly. diff -r 1a49c651ad21 -r 0e09b49d21b8 lisp/hi-lock.el --- 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