Mercurial > emacs
changeset 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 | 1a49c651ad21 |
children | 9566f100bdd3 |
files | lisp/hi-lock.el |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
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