]> code.delx.au - gnu-emacs/blobdiff - lisp/hi-lock.el
* lisp/replace.el (perform-replace): Move let-bindings of isearch-*
[gnu-emacs] / lisp / hi-lock.el
index 0bbb315087427f5a7f7c58fece32fe7094efbe11..476399225f4855d58a1144cf69903941b21a2259 100644 (file)
@@ -1,6 +1,6 @@
 ;;; hi-lock.el --- minor mode for interactive automatic highlighting
 
-;; Copyright (C) 2000-2012 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2013 Free Software Foundation, Inc.
 
 ;; Author: David M. Koppelman <koppel@ece.lsu.edu>
 ;; Keywords: faces, minor-mode, matching, display
@@ -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