From 1595ecfac950d69ae94c270fb9829529a421c56c Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 6 Oct 2012 17:27:31 -0700 Subject: [PATCH] * lisp/hi-lock.el (hi-lock-process-phrase): Try to make it less fragile. Fixes: debbugs:7161 --- lisp/ChangeLog | 3 +++ lisp/hi-lock.el | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) 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 -- 2.39.5