As always, a fresh look helps. The question is not really why didn't
work but why it did work.
src/ChangeLog addition:
2002-01-19 Jan Vroonhof <jan(a)xemacs.org>
* cmdloop.c: New variable Qdisabled_command_loop.
Move Vdisabled_command_loop declaration here.
* cmdloop.c (syms_of_cmdloop): Declare Qdisabled_command_loop.
* eval.c (Fcommand_execute): Use the value of the symbol not
the value of the value as the hook to run.
* event-stream.c: Remove declaration of Vdisabled_command_loop
* lisp.h: Declare Qdisabled_command_loop
XEmacs Patch (cvs -q diff -u):
Index: src/cmdloop.c
===================================================================
RCS file: /local/xemacs/sunsite/xemacscvs/XEmacs/xemacs/src/cmdloop.c,v
retrieving revision 1.12
diff -u -u -r1.12 cmdloop.c
--- src/cmdloop.c 2001/05/24 07:51:03 1.12
+++ src/cmdloop.c 2002/01/19 15:30:48
@@ -50,6 +50,8 @@
Lisp_Object Venter_window_hook, Vleave_window_hook;
+Lisp_Object Qdisabled_command_hook, Vdisabled_command_hook;
+
/* The error handler. */
Lisp_Object Qcommand_error;
@@ -606,6 +608,7 @@
void
syms_of_cmdloop (void)
{
+ DEFSYMBOL (Qdisabled_command_hook);
DEFSYMBOL (Qcommand_error);
DEFSYMBOL (Qreally_early_error_handler);
DEFSYMBOL (Qtop_level);
Index: src/eval.c
===================================================================
RCS file: /local/xemacs/sunsite/xemacscvs/XEmacs/xemacs/src/eval.c,v
retrieving revision 1.44
diff -u -u -r1.44 eval.c
--- src/eval.c 2001/09/20 06:28:54 1.44
+++ src/eval.c 2002/01/19 15:21:37
@@ -2894,7 +2894,7 @@
debug_on_next_call = 0; /* #### from FSFmacs; correct? */
if (SYMBOLP (cmd) && !NILP (Fget (cmd, Qdisabled, Qnil)))
- return run_hook (Vdisabled_command_hook);
+ return run_hook (Qdisabled_command_hook);
for (;;)
{
Index: src/event-stream.c
===================================================================
RCS file: /local/xemacs/sunsite/xemacscvs/XEmacs/xemacs/src/event-stream.c,v
retrieving revision 1.57
diff -u -u -r1.57 event-stream.c
--- src/event-stream.c 2001/12/20 05:49:46 1.57
+++ src/event-stream.c 2002/01/19 15:25:14
@@ -135,7 +135,7 @@
/* Non-nil disable property on a command means
do not execute it; call disabled-command-hook's value instead. */
-Lisp_Object Qdisabled, Vdisabled_command_hook;
+Lisp_Object Qdisabled;
EXFUN (Fnext_command_event, 2);
Index: src/lisp.h
===================================================================
RCS file: /local/xemacs/sunsite/xemacscvs/XEmacs/xemacs/src/lisp.h,v
retrieving revision 1.64
diff -u -u -r1.64 lisp.h
--- src/lisp.h 2001/12/20 05:49:47 1.64
+++ src/lisp.h 2002/01/19 15:27:42
@@ -3257,7 +3257,7 @@
extern Lisp_Object Qcrlf, Qcurrent_menubar, Qctext;
extern Lisp_Object Qcyclic_variable_indirection, Qdecode;
extern Lisp_Object Qdefun, Qdevice_live_p;
-extern Lisp_Object Qdim, Qdisabled, Qdisplay_table;
+extern Lisp_Object Qdim, Qdisabled, Qdisabled_command_hook, Qdisplay_table;
extern Lisp_Object Qdomain_error;
extern Lisp_Object Qediting_error;
extern Lisp_Object Qencode, Qend_of_buffer, Qend_of_file, Qend_open;