"Drew Adams" <[EMAIL PROTECTED]> writes: > In previous Emacs versions, I could do this, to bind stuff that > is bound to self-insert-command in the global map: > > (dolist (key (where-is-internal 'self-insert-command global-map)) > (define-key my-map key 'my-command)) > > Now, however, it looks like I need to do something like the > following. > (dolist (key (or (condition-case nil > (where-is-internal 'self-insert-command > global-map nil nil t) > (wrong-number-of-arguments nil)) > (where-is-internal 'self-insert-command > global-map))) > (define-key my-map key 'my-command)) > > I forgot to mention that, whereas the above code is lightning-quick in Emacs > 20 (without the 5th arg), in Emacs 22 it takes about 5 _seconds_ (on a > pretty fast machine). Why so slow?
IIRC, the problem probably is that with command remapping, where-is-internal in 22.x has to lookup the key binding for each command to see if it remapped -- in the normal case (where a command only has a few bindings), the penalty is neglible, but for self-insert-command specifically, that will be time consuming. The problem is that where-is-internal must return proper bindings for commands that are remapped to, so there really don't see to be an easy way to speed things up. -- Kim F. Storm <[EMAIL PROTECTED]> http://www.cua.dk _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel