comparison lisp/hi-lock.el @ 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 06ff4f3266f8
children b174db545cfd
comparison
equal deleted inserted replaced
36707:1a49c651ad21 36708:0e09b49d21b8
332 nil nil 'hi-lock-regexp-history)) 332 nil nil 'hi-lock-regexp-history))
333 (hi-lock-read-face-name))) 333 (hi-lock-read-face-name)))
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
341 (defalias 'highlight-regexp 'hi-lock-face-buffer) 343 (defalias 'highlight-regexp 'hi-lock-face-buffer)
342 ;;;###autoload 344 ;;;###autoload