diff options
author | Glenn Morris <rgm@gnu.org> | 2012-10-06 17:27:31 -0700 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2012-10-06 17:27:31 -0700 |
commit | 1595ecfac950d69ae94c270fb9829529a421c56c (patch) | |
tree | 3ddc61cab36ab147abbb831bcc8802c8880faaec /lisp/hi-lock.el | |
parent | 82ed3ab40dfa2ac4f9a20b0dd8333058e45e1cfb (diff) | |
download | emacs-1595ecfac950d69ae94c270fb9829529a421c56c.tar.gz |
* lisp/hi-lock.el (hi-lock-process-phrase): Try to make it less fragile.
Fixes: debbugs:7161
Diffstat (limited to 'lisp/hi-lock.el')
-rw-r--r-- | lisp/hi-lock.el | 6 |
1 files changed, 5 insertions, 1 deletions
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 |