From: Glenn Morris Date: Sun, 7 Oct 2012 00:07:03 +0000 (-0700) Subject: * lisp/hi-lock.el (hi-lock-face-phrase-buffer): Doc fix. X-Git-Tag: emacs-24.2.90~239^2~17 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=82ed3ab40dfa2ac4f9a20b0dd8333058e45e1cfb;p=emacs.git * lisp/hi-lock.el (hi-lock-face-phrase-buffer): Doc fix. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2453dc2177a..4469c6112f8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2012-10-07 Glenn Morris + + * hi-lock.el (hi-lock-face-phrase-buffer): Doc fix. + 2012-10-06 Glenn Morris * ehelp.el (electric-help-mode): Use help-mode rather than diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el index f92e2ab0af2..0bbb3150874 100644 --- a/lisp/hi-lock.el +++ b/lisp/hi-lock.el @@ -444,8 +444,8 @@ updated as you type." ;;;###autoload (defun hi-lock-face-phrase-buffer (regexp &optional face) "Set face of each match of phrase REGEXP to FACE. -Whitespace in REGEXP converted to arbitrary whitespace and initial -lower-case letters made case insensitive. +If called interactively, replaces whitespace in REGEXP with +arbitrary whitespace and makes initial lower-case letters case-insensitive. If Font Lock mode is enabled in the buffer, it is used to highlight REGEXP. If Font Lock mode is disabled, overlays are @@ -544,9 +544,11 @@ be found in variable `hi-lock-interactive-patterns'." Blanks in PHRASE replaced by regexp that matches arbitrary whitespace and initial lower-case letters made case insensitive." (let ((mod-phrase nil)) + ;; FIXME fragile; better to just bind case-fold-search? (Bug#7161) (setq mod-phrase (replace-regexp-in-string "\\<[a-z]" (lambda (m) (format "[%s%s]" (upcase m) m)) phrase)) + ;; FIXME fragile; better to use search-spaces-regexp? (setq mod-phrase (replace-regexp-in-string "\\s-+" "[ \t\n]+" mod-phrase nil t))))