From b18f5523f42e8699cf7a3e6b35eeaf21ae045ad6 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 9 Mar 2001 21:16:24 +0000 Subject: [PATCH] (hi-lock-line-face-buffer): Wrap the regexp in a group so ^, $, *, ? and + are interpreted correctly. --- lisp/ChangeLog | 5 +++++ lisp/hi-lock.el | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2818191aec6..29fa58fde38 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2001-03-09 Stefan Monnier + + * hi-lock.el (hi-lock-line-face-buffer): Wrap the regexp in a group + so ^, $, *, ? and + are interpreted correctly. + 2001-03-09 Gerd Moellmann * help.el (string-key-binding): Renamed from 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 -- 2.39.5