comparison lisp/simple.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 64ac4337298b
children e29fcfd8df5f
comparison
equal deleted inserted replaced
4686:cdabd56ce1b5 4687:02b7c7189041
2089 (let ((key (event-key last-input-event)) 2089 (let ((key (event-key last-input-event))
2090 (mods (delq 'shift (event-modifiers last-input-event)))) 2090 (mods (delq 'shift (event-modifiers last-input-event))))
2091 ;(princ (format "key: %s mods: %s\n" key mods) 'external-debugging-output) 2091 ;(princ (format "key: %s mods: %s\n" key mods) 'external-debugging-output)
2092 (catch 'handle-pre-motion-command-current-command-is-motion 2092 (catch 'handle-pre-motion-command-current-command-is-motion
2093 (flet ((keysyms-equal (a b) 2093 (flet ((keysyms-equal (a b)
2094 (if (characterp a)
2095 (setq a (intern (char-to-string (downcase a)))))
2096 (if (characterp b) 2094 (if (characterp b)
2097 (setq b (intern (char-to-string (downcase b))))) 2095 (setq b (intern (char-to-string (downcase b)))))
2098 (eq a b))) 2096 (eq a b)))
2097 (setq key (if (characterp key)
2098 (intern (char-to-string (downcase key)))
2099 key))
2099 (dolist (keysym motion-keys-for-shifted-motion) 2100 (dolist (keysym motion-keys-for-shifted-motion)
2100 (when (if (listp keysym) 2101 (when (if (listp keysym)
2101 (and (equal mods (butlast keysym)) 2102 (and (equal mods (butlast keysym))
2102 (keysyms-equal key (car (last keysym)))) 2103 (keysyms-equal key (car (last keysym))))
2103 (keysyms-equal key keysym)) 2104 (keysyms-equal key keysym))