Mercurial > hg > xemacs-beta
diff lisp/mule/mule-cmds.el @ 4687:02b7c7189041
Random (minimal) performance improvements at startup.
lisp/ChangeLog addition:
2009-09-06 Aidan Kehoe <kehoea@parhasard.net>
* simple.el (handle-pre-motion-command-current-command-is-motion):
If KEY is a character, ascertain that once, not every iteration of
the loop.
* mule/mule-cmds.el (finish-set-language-environment):
Don't call #'string-match on a one-character string, use functions
that have bytecodes instead, since this is called so often on
startup.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Sun, 06 Sep 2009 23:47:12 +0100 |
parents | 127dbf03e1af |
children | b3ea9c582280 |
line wrap: on
line diff
--- a/lisp/mule/mule-cmds.el Sun Sep 06 19:36:02 2009 +0100 +++ b/lisp/mule/mule-cmds.el Sun Sep 06 23:47:12 2009 +0100 @@ -771,7 +771,7 @@ (let ((invalid-sequence-coding-system (get-language-info language-name 'invalid-sequence-coding-system)) (disp-table (specifier-instance current-display-table)) - glyph string unicode-error-lookup) + glyph string unicode-error-lookup first-char) (when (consp invalid-sequence-coding-system) (setq invalid-sequence-coding-system (car invalid-sequence-coding-system))) @@ -788,7 +788,9 @@ (when unicode-error-lookup (setq string (format "%c" unicode-error-lookup))) ;; Treat control characters specially: - (when (string-match "^[\x00-\x1f\x80-\x9f]$" string) + (setq first-char (aref string 0)) + (when (or (and (>= #x00 first-char) (<= first-char #x1f)) + (and (>= #x80 first-char) (<= first-char #x9f))) (setq string (format "^%c" (+ ?@ (aref string 0)))))) (setq glyph (make-glyph (vector 'string :data string))) (set-glyph-face glyph 'unicode-invalid-sequence-warning-face)