emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: command remapping problem


From: Kim F. Storm
Subject: Re: command remapping problem
Date: Wed, 01 Feb 2006 01:32:48 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

"Richard M. Stallman" <address@hidden> writes:

>     >     lost functionality in going to Emacs 22, because
>     >     `substitute-key-definition' is unusable (at least with
>     >     `self-insert-command'), for performance reasons.
>
> Could someone please investigate the slowness, and respond
> with an explanation of the cause?
>

There was a big rewrite of substitute-key-definition to use map-keymap.

revision 1.418
date: 2004-10-13 17:05:55 +0000;  author: monnier;  state: Exp;  lines: +52 -135
(substitute-key-definition-key): New function.
(substitute-key-definition): Use it with map-keymap.
(event-modifiers): Use push.
(mouse-movement-p, with-temp-buffer): Simplify.


It doesn't seem to be extremely slow on my system, but the slowdown
may be caused by the presense of some unbound symbols in keymaps.
Could you try to see if this change makes a difference?



*** data.c      31 Jan 2006 11:23:13 +0100      1.259
--- data.c      01 Feb 2006 01:24:22 +0100      
***************
*** 1946,1951 ****
--- 1946,1971 ----
      return Fsignal (Qvoid_function, Fcons (object, Qnil));
    return result;
  }
+ 
+ DEFUN ("indirect-function-noerror", Findirect_function_noerror, 
Sindirect_function_noerror, 1, 1, 0,
+        doc: /* Return the function at the end of OBJECT's function chain.
+ If OBJECT is a symbol, follow all function indirections and return the final
+ function binding.
+ If OBJECT is not a symbol, just return it.
+ If the final symbol is unbound, return OBJECT
+ Signal a cyclic-function-indirection error if there is a loop in the
+ function chain of symbols.  */)
+      (object)
+      register Lisp_Object object;
+ {
+   Lisp_Object result;
+ 
+   result = indirect_function (object);
+ 
+   if (EQ (result, Qunbound))
+     return object;
+   return result;
+ }
  
  /* Extract and set vector and string elements */
  
***************
*** 3320,3325 ****
--- 3340,3346 ----
    defsubr (&Ssetcdr);
    defsubr (&Ssymbol_function);
    defsubr (&Sindirect_function);
+   defsubr (&Sindirect_function_noerror);
    defsubr (&Ssymbol_plist);
    defsubr (&Ssymbol_name);
    defsubr (&Smakunbound);


*** subr.el     31 Jan 2006 11:23:11 +0100      1.495
--- subr.el     01 Feb 2006 01:29:59 +0100      
***************
*** 608,614 ****
        ;; Look past a symbol that names a keymap.
        (setq inner-def
            (and defn
!                (condition-case nil (indirect-function defn) (error defn))))
        ;; For nested keymaps, we use `inner-def' rather than `defn' so as to
        ;; avoid autoloading a keymap.  This is mostly done to preserve the
        ;; original non-autoloading behavior of pre-map-keymap times.
--- 608,614 ----
        ;; Look past a symbol that names a keymap.
        (setq inner-def
            (and defn
!                (indirect-function-noerror defn)))
        ;; For nested keymaps, we use `inner-def' rather than `defn' so as to
        ;; avoid autoloading a keymap.  This is mostly done to preserve the
        ;; original non-autoloading behavior of pre-map-keymap times.

--
Kim F. Storm <address@hidden> http://www.cua.dk





reply via email to

[Prev in Thread] Current Thread [Next in Thread]