diff options
| author | Stefan Monnier | 2001-03-09 21:16:24 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2001-03-09 21:16:24 +0000 |
| commit | b18f5523f42e8699cf7a3e6b35eeaf21ae045ad6 (patch) | |
| tree | f51d08844ec452b40e50afcd6c9d16bac4e5c62a | |
| parent | f9db8f1954266304bbbe751d7f59f35bc07ef311 (diff) | |
| download | emacs-b18f5523f42e8699cf7a3e6b35eeaf21ae045ad6.tar.gz emacs-b18f5523f42e8699cf7a3e6b35eeaf21ae045ad6.zip | |
(hi-lock-line-face-buffer): Wrap the regexp in a group
so ^, $, *, ? and + are interpreted correctly.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/hi-lock.el | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2818191aec6..29fa58fde38 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2001-03-09 Stefan Monnier <monnier@cs.yale.edu> | ||
| 2 | |||
| 3 | * hi-lock.el (hi-lock-line-face-buffer): Wrap the regexp in a group | ||
| 4 | so ^, $, *, ? and + are interpreted correctly. | ||
| 5 | |||
| 1 | 2001-03-09 Gerd Moellmann <gerd@gnu.org> | 6 | 2001-03-09 Gerd Moellmann <gerd@gnu.org> |
| 2 | 7 | ||
| 3 | * help.el (string-key-binding): Renamed from | 8 | * 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. | |||
| 334 | (unless hi-lock-mode (hi-lock-mode)) | 334 | (unless hi-lock-mode (hi-lock-mode)) |
| 335 | (or (facep face) (setq face 'rwl-yellow)) | 335 | (or (facep face) (setq face 'rwl-yellow)) |
| 336 | (hi-lock-set-pattern | 336 | (hi-lock-set-pattern |
| 337 | (list (concat "^.*" regexp ".*$") (list 0 (list 'quote face) t)))) | 337 | ;; The \\(?:...\\) grouping construct ensures that a leading ^, +, * or ? |
| 338 | ;; or a trailing $ in REGEXP will be interpreted correctly. | ||
| 339 | (list (concat "^.*\\(?:" regexp "\\).*$") (list 0 (list 'quote face) t)))) | ||
| 338 | 340 | ||
| 339 | 341 | ||
| 340 | ;;;###autoload | 342 | ;;;###autoload |