From: Glenn Morris Date: Sun, 7 Oct 2012 00:27:31 +0000 (-0700) Subject: * lisp/hi-lock.el (hi-lock-process-phrase): Try to make it less fragile. X-Git-Tag: emacs-24.2.90~239^2~16 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1595ecfac950d69ae94c270fb9829529a421c56c;p=emacs.git * lisp/hi-lock.el (hi-lock-process-phrase): Try to make it less fragile. Fixes: debbugs:7161 --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4469c6112f8..b91d9715bfa 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2012-10-07 Glenn Morris + * 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 diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el index 0bbb3150874..59743124cc5 100644 --- a/lisp/hi-lock.el +++ b/lisp/hi-lock.el @@ -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