From 9c7a6b159d64bcc457c85bf6a5c0b4ceb13eb7a2 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Wed, 3 Sep 2008 00:01:25 +0000 Subject: [PATCH] (isearch-highlight-regexp): Fix last change, quoting non-alphabetical characters properly. --- lisp/isearch.el | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lisp/isearch.el b/lisp/isearch.el index 3aed19b9ceb..15dc7a3cdd8 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -1401,11 +1401,13 @@ and reads its face argument using `hi-lock-read-face-name'." isearch-case-fold-search) ;; Turn isearch-string into a case-insensitive ;; regexp. - (replace-regexp-in-string - "[a-z]" - (lambda (m) - (format "[%s%s]" (upcase m) (downcase m))) - isearch-string)) + (mapconcat + (lambda (c) + (let ((s (string c))) + (if (string-match "[[:alpha:]]" s) + (format "[%s%s]" (upcase s) (downcase s)) + (regexp-quote s)))) + isearch-string "")) (t (regexp-quote isearch-string))))) (hi-lock-face-buffer string (hi-lock-read-face-name)))) -- 2.39.5