* lisp/hi-lock.el (hi-lock-process-phrase): Try to make it less fragile.

Fixes: debbugs:7161
This commit is contained in:
Glenn Morris 2012-10-06 17:27:31 -07:00
parent 82ed3ab40d
commit 1595ecfac9
2 changed files with 8 additions and 1 deletions

View file

@ -1,5 +1,8 @@
2012-10-07 Glenn Morris <rgm@gnu.org>
* hi-lock.el (hi-lock-process-phrase):
Try to make it less fragile. (Bug#7161)
* hi-lock.el (hi-lock-face-phrase-buffer): Doc fix.
2012-10-06 Glenn Morris <rgm@gnu.org>

View file

@ -547,7 +547,11 @@ and initial lower-case letters made case insensitive."
;; 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))
"\\(^\\|\\s-\\)\\([a-z]\\)"
(lambda (m) (format "%s[%s%s]"
(match-string 1 m)
(upcase (match-string 2 m))
(match-string 2 m))) phrase))
;; FIXME fragile; better to use search-spaces-regexp?
(setq mod-phrase
(replace-regexp-in-string