aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2008-04-24 17:59:51 +0000
committerStefan Monnier2008-04-24 17:59:51 +0000
commit4f3b3482ee9d5a61e9b7ecd68304a24db0beb579 (patch)
tree28dc850f2b8e8cd37af4fe2169d25918c9571b39
parent852618548a6a80773b3fa44fa76b4bd43077491f (diff)
downloademacs-4f3b3482ee9d5a61e9b7ecd68304a24db0beb579.tar.gz
emacs-4f3b3482ee9d5a61e9b7ecd68304a24db0beb579.zip
(isearch-search-string): Avoid string-bytes and aset.
-rw-r--r--lisp/ChangeLog2
-rw-r--r--lisp/isearch.el16
2 files changed, 11 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c9f57f0aae3..ddb6b68e9e4 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,7 @@
12008-04-24 Stefan Monnier <monnier@iro.umontreal.ca> 12008-04-24 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * isearch.el (isearch-search-string): Avoid string-bytes and aset.
4
3 * international/quail.el (quail-build-decode-map): Avoid string-bytes. 5 * international/quail.el (quail-build-decode-map): Avoid string-bytes.
4 6
5 * textmodes/ispell.el (ispell-dictionary-alist-1) 7 * textmodes/ispell.el (ispell-dictionary-alist-1)
diff --git a/lisp/isearch.el b/lisp/isearch.el
index ef6321be02c..920b999c185 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -2137,13 +2137,15 @@ Can be changed via `isearch-search-fun-function' for special needs."
2137 pos1 pos2) 2137 pos1 pos2)
2138 (setq pos1 (save-excursion (funcall func string bound noerror))) 2138 (setq pos1 (save-excursion (funcall func string bound noerror)))
2139 (if (and (char-table-p translation-table-for-input) 2139 (if (and (char-table-p translation-table-for-input)
2140 (> (string-bytes string) len)) 2140 (multibyte-string-p string)
2141 (let (translated match-data) 2141 ;; Minor optimization.
2142 (dotimes (i len) 2142 (string-match-p "[^[:ascii:]]" string))
2143 (let ((x (aref translation-table-for-input (aref string i)))) 2143 (let ((translated
2144 (when x 2144 (apply 'string
2145 (or translated (setq translated (copy-sequence string))) 2145 (mapcar (lambda (c)
2146 (aset translated i x)))) 2146 (or (aref translation-table-for-input c) c))
2147 string)))
2148 match-data)
2147 (when translated 2149 (when translated
2148 (save-match-data 2150 (save-match-data
2149 (save-excursion 2151 (save-excursion