diff --git a/lisp/hippie-exp.el b/lisp/hippie-exp.el index 3b89521e0fd..a7bb6ef92e9 100644 --- a/lisp/hippie-exp.el +++ b/lisp/hippie-exp.el @@ -334,11 +334,12 @@ undoes the expansion." (defun he-capitalize-first (str) (save-match-data - (if (string-match "\\Sw*\\(\\sw\\).*" str) - (let ((res (downcase str)) - (no (match-beginning 1))) - (aset res no (upcase (aref str no))) - res) + (if (string-match "\\Sw*\\(\\sw\\)" str) + (let ((b (match-beginning 1)) + (e (match-end 1))) + (concat (substring str 0 b) + (upcase (substring str b e)) + (downcase (substring str e)))) str))) (defun he-ordinary-case-p (str) diff --git a/lisp/international/quail.el b/lisp/international/quail.el index 20649082941..d015b73e955 100644 --- a/lisp/international/quail.el +++ b/lisp/international/quail.el @@ -2135,10 +2135,14 @@ minibuffer and the selected frame has no other windows)." (let ((guidance (quail-guidance))) (if (listp guidance) ;; We must replace the typed key with the specified PROMPT-KEY. - (dotimes (i (length str)) - (let ((prompt-key (cdr (assoc (aref str i) guidance)))) - (if prompt-key - (aset str i (aref prompt-key 0))))))) + (setq str (apply #'string + (mapcar + (lambda (c) + (let ((prompt-key (assq c guidance))) + (if prompt-key + (aref (cdr prompt-key) 0) + c))) + str))))) ;; Show followable keys. (if (and (> (length quail-current-key) 0) (cdr map)) diff --git a/lisp/play/zone.el b/lisp/play/zone.el index 39a33f1e2a0..5f817c10371 100644 --- a/lisp/play/zone.el +++ b/lisp/play/zone.el @@ -433,8 +433,9 @@ run a specific program. The program must be a member of (defsubst zone-replace-char (count del-count char-as-string new-value) (delete-char (or del-count (- count))) - (aset char-as-string 0 new-value) - (dotimes (_ count) (insert char-as-string))) + (let ((s (apply #'propertize (string new-value) + (text-properties-at 0 char-as-string)))) + (dotimes (_ count) (insert s)))) (defsubst zone-park/sit-for (pos seconds) (let ((p (point)))