Mercurial > hg > xemacs-beta
comparison 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 |
comparison
equal
deleted
inserted
replaced
4686:cdabd56ce1b5 | 4687:02b7c7189041 |
---|---|
769 (funcall func))) | 769 (funcall func))) |
770 | 770 |
771 (let ((invalid-sequence-coding-system | 771 (let ((invalid-sequence-coding-system |
772 (get-language-info language-name 'invalid-sequence-coding-system)) | 772 (get-language-info language-name 'invalid-sequence-coding-system)) |
773 (disp-table (specifier-instance current-display-table)) | 773 (disp-table (specifier-instance current-display-table)) |
774 glyph string unicode-error-lookup) | 774 glyph string unicode-error-lookup first-char) |
775 (when (consp invalid-sequence-coding-system) | 775 (when (consp invalid-sequence-coding-system) |
776 (setq invalid-sequence-coding-system | 776 (setq invalid-sequence-coding-system |
777 (car invalid-sequence-coding-system))) | 777 (car invalid-sequence-coding-system))) |
778 (map-char-table | 778 (map-char-table |
779 #'(lambda (key entry) | 779 #'(lambda (key entry) |
786 (get-char-table (aref string 0) | 786 (get-char-table (aref string 0) |
787 unicode-error-default-translation-table)) | 787 unicode-error-default-translation-table)) |
788 (when unicode-error-lookup | 788 (when unicode-error-lookup |
789 (setq string (format "%c" unicode-error-lookup))) | 789 (setq string (format "%c" unicode-error-lookup))) |
790 ;; Treat control characters specially: | 790 ;; Treat control characters specially: |
791 (when (string-match "^[\x00-\x1f\x80-\x9f]$" string) | 791 (setq first-char (aref string 0)) |
792 (when (or (and (>= #x00 first-char) (<= first-char #x1f)) | |
793 (and (>= #x80 first-char) (<= first-char #x9f))) | |
792 (setq string (format "^%c" (+ ?@ (aref string 0)))))) | 794 (setq string (format "^%c" (+ ?@ (aref string 0)))))) |
793 (setq glyph (make-glyph (vector 'string :data string))) | 795 (setq glyph (make-glyph (vector 'string :data string))) |
794 (set-glyph-face glyph 'unicode-invalid-sequence-warning-face) | 796 (set-glyph-face glyph 'unicode-invalid-sequence-warning-face) |
795 (put-char-table key glyph disp-table) | 797 (put-char-table key glyph disp-table) |
796 nil) | 798 nil) |