(hi-lock-line-face-buffer): Wrap the regexp in a group

so ^, $, *, ? and + are interpreted correctly.
This commit is contained in:
Stefan Monnier 2001-03-09 21:16:24 +00:00
parent f9db8f1954
commit b18f5523f4
2 changed files with 8 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2001-03-09 Stefan Monnier <monnier@cs.yale.edu>
* hi-lock.el (hi-lock-line-face-buffer): Wrap the regexp in a group
so ^, $, *, ? and + are interpreted correctly.
2001-03-09 Gerd Moellmann <gerd@gnu.org>
* help.el (string-key-binding): Renamed from

View file

@ -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