4 new commits in XEmacs:
https://bitbucket.org/xemacs/xemacs/changeset/b490ddbd42aa/
changeset:   b490ddbd42aa
user:        kehoea
date:        2012-11-06 22:34:15
summary:     Back out 7371081ce8f7, I have a better approach.
affected #:  6 files
diff -r 7b5f88e5b456b61e5108c84079389b2235ee5c77 -r
b490ddbd42aab637aa8332b0fc3dbb722f60dc44 lisp/ChangeLog
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,10 +1,3 @@
-2012-10-14  Aidan Kehoe  <kehoea(a)parhasard.net>
-
-	* help.el:
-	* help.el (describe-function-1):
-	Add some newlines here when dealing with remapped commands, thank
-	you Robert Pluim.
-
 2012-10-13  Mats Lidell  <matsl(a)xemacs.org>
 
 	* process.el (call-process-shell-command): New function from GNU.
diff -r 7b5f88e5b456b61e5108c84079389b2235ee5c77 -r
b490ddbd42aab637aa8332b0fc3dbb722f60dc44 lisp/help.el
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -1544,10 +1544,10 @@
                                    (format "\n\\[%s]" function))))
                        (when commands-remapped-to
                          (if (cdr commands-remapped-to)
-                             (princ (format "\n\nThe following functions are \
+                             (princ (format "The following functions are \
 remapped to it:\n`%s'" (mapconcat #'prin1-to-string commands-remapped-to
                                   "', `")))
-                           (princ (format "\n\n`%s' is remapped to it.\n"
+                           (princ (format "`%s' is remapped to it.\n"
                                           (car
                                            commands-remapped-to))))))))))))))
 
diff -r 7b5f88e5b456b61e5108c84079389b2235ee5c77 -r
b490ddbd42aab637aa8332b0fc3dbb722f60dc44 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,14 +1,3 @@
-2012-10-14  Aidan Kehoe  <kehoea(a)parhasard.net>
-
-	Have command remapping work interactively too, thank you Robert
-	Pluim.
-	* event-stream.c (Fdispatch_event):
-	Obey command remapping here, it wasn't done for us.
-	* keymap.c:
-	* keymap.c (command_remapping_for_event): New, needed to observe
-	command remapping interactively.
-	* lisp.h: Make it available.
-
 2012-10-14  Aidan Kehoe  <kehoea(a)parhasard.net>
 
 	Respect face and display table information in the minibuffer
diff -r 7b5f88e5b456b61e5108c84079389b2235ee5c77 -r
b490ddbd42aab637aa8332b0fc3dbb722f60dc44 src/event-stream.c
--- a/src/event-stream.c
+++ b/src/event-stream.c
@@ -4550,6 +4550,8 @@
 	    int magic_undo = 0;
 	    Elemcount magic_undo_count = 20;
 
+	    Vthis_command = leaf;
+
 	    /* Don't push an undo boundary if the command set the prefix arg,
 	       or if we are executing a keyboard macro, or if in the
 	       minibuffer.  If the command we are about to execute is
@@ -4565,8 +4567,6 @@
 	    if (SYMBOLP (leaf))
 	      {
 		Lisp_Object prop = Fget (leaf, Qself_insert_defer_undo, Qnil);
-                Lisp_Object remap = Qnil;
-
 		if (NATNUMP (prop))
                   {
                     magic_undo = 1;
@@ -4587,16 +4587,8 @@
 		  magic_undo = 1;
 		else if (EQ (leaf, Qself_insert_command))
 		  magic_undo = 1;
-
-                remap = command_remapping_for_event (leaf, event);
-                if (!NILP (remap))
-                  {
-                    leaf = remap;
-                  }
 	      }
 
-	    Vthis_command = leaf;
-
 	    if (!magic_undo)
 	      command_builder->self_insert_countdown = 0;
 	    if (NILP (XCONSOLE (console)->prefix_arg)
diff -r 7b5f88e5b456b61e5108c84079389b2235ee5c77 -r
b490ddbd42aab637aa8332b0fc3dbb722f60dc44 src/keymap.c
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -2127,20 +2127,6 @@
   return Qnil;
 }
 
-Lisp_Object
-command_remapping_for_event (Lisp_Object command, Lisp_Object event0)
-{
-  /* This function can GC */
-  Lisp_Object maps[100];
-  int nmaps;
-
-  nmaps = get_relevant_keymaps (event0, Qnil, countof (maps), maps);
-  if (nmaps > countof (maps))
-    nmaps = countof (maps);
-
-  return command_remapping (command, nmaps, maps);
-}                             
-
 DEFUN ("command-remapping", Fcommand_remapping, 1, 3, 0, /*
 Return the remapping for command COMMAND.
 
diff -r 7b5f88e5b456b61e5108c84079389b2235ee5c77 -r
b490ddbd42aab637aa8332b0fc3dbb722f60dc44 src/lisp.h
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -5473,9 +5473,6 @@
 EXFUN (Fmake_sparse_keymap, 1);
 EXFUN (Fset_keymap_parents, 2);
 
-Lisp_Object command_remapping_for_event (Lisp_Object command,
-                                         Lisp_Object event0);
-
 void where_is_to_char (Lisp_Object, Eistring *);
 
 /* Defined in lread.c */
https://bitbucket.org/xemacs/xemacs/changeset/be87f507f510/
changeset:   be87f507f510
user:        kehoea
date:        2012-11-06 23:27:15
summary:     Handle interactive command remapping a little better than 7371081ce8f7,
keymap.c
src/ChangeLog addition:
2012-11-06  Aidan Kehoe  <kehoea(a)parhasard.net>
	* keymap.c (event_binding):
	Do command remapping here for interactive lookups; avoids a
	relatively expensive repeated call to get_relevant_keymaps(), as
	was necessary in 7371081ce8f7 (which changeset has been backed
	out).
lisp/ChangeLog addition:
2012-10-14  Aidan Kehoe  <kehoea(a)parhasard.net>
	* help.el:
	* help.el (describe-function-1):
	Add some newlines here when dealing with remapped commands, thank
	you Robert Pluim.
affected #:  4 files
diff -r b490ddbd42aab637aa8332b0fc3dbb722f60dc44 -r
be87f507f5100953f14b0405f0ccbd825e941fe7 lisp/ChangeLog
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
+2012-10-14  Aidan Kehoe  <kehoea(a)parhasard.net>
+
+	* help.el:
+	* help.el (describe-function-1):
+	Add some newlines here when dealing with remapped commands, thank
+	you Robert Pluim.
+
 2012-10-13  Mats Lidell  <matsl(a)xemacs.org>
 
 	* process.el (call-process-shell-command): New function from GNU.
diff -r b490ddbd42aab637aa8332b0fc3dbb722f60dc44 -r
be87f507f5100953f14b0405f0ccbd825e941fe7 lisp/help.el
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -1544,10 +1544,10 @@
                                    (format "\n\\[%s]" function))))
                        (when commands-remapped-to
                          (if (cdr commands-remapped-to)
-                             (princ (format "The following functions are \
+                             (princ (format "\n\nThe following functions are \
 remapped to it:\n`%s'" (mapconcat #'prin1-to-string commands-remapped-to
                                   "', `")))
-                           (princ (format "`%s' is remapped to it.\n"
+                           (princ (format "\n\n`%s' is remapped to it.\n"
                                           (car
                                            commands-remapped-to))))))))))))))
 
diff -r b490ddbd42aab637aa8332b0fc3dbb722f60dc44 -r
be87f507f5100953f14b0405f0ccbd825e941fe7 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,11 @@
+2012-11-06  Aidan Kehoe  <kehoea(a)parhasard.net>
+
+	* keymap.c (event_binding):
+	Do command remapping here for interactive lookups; avoids a
+	relatively expensive repeated call to get_relevant_keymaps(), as
+	was necessary in 7371081ce8f7 (which changeset has been backed
+	out).
+
 2012-10-14  Aidan Kehoe  <kehoea(a)parhasard.net>
 
 	Respect face and display table information in the minibuffer
diff -r b490ddbd42aab637aa8332b0fc3dbb722f60dc44 -r
be87f507f5100953f14b0405f0ccbd825e941fe7 src/keymap.c
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -2996,7 +2996,7 @@
 event_binding (Lisp_Object event0, int accept_default)
 {
   /* This function can GC */
-  Lisp_Object maps[100];
+  Lisp_Object maps[100], result;
   int nmaps;
 
   assert (EVENTP (event0));
@@ -3004,8 +3004,20 @@
   nmaps = get_relevant_keymaps (event0, Qnil, countof (maps), maps);
   if (nmaps > countof (maps))
     nmaps = countof (maps);
-  return process_event_binding_result (lookup_events (event0, nmaps, maps,
-						      accept_default));
+
+  result = process_event_binding_result (lookup_events (event0, nmaps, maps,
+							accept_default));
+
+  if (!NILP (result) && SYMBOLP (result))
+    {
+      Lisp_Object remap = command_remapping (result, nmaps, maps);
+      if (!NILP (remap))
+	{
+	  result = remap;
+	}
+    }
+
+  return result;
 }
 
 /* like event_binding, but specify a keymap to search */
https://bitbucket.org/xemacs/xemacs/changeset/4d15e903800b/
changeset:   4d15e903800b
user:        kehoea
date:        2012-11-06 23:33:58
summary:     Be more careful about erroring with probable GNU-syntax keysyms, keymap.c
src/ChangeLog addition:
2012-11-06  Aidan Kehoe  <kehoea(a)parhasard.net>
	* keymap.c (define_key_check_and_coerce_keysym):
	When worrying about GNU Emacs-like keysym syntax, if the symbol
	name starts with c-whatever (or s-whatever, or m-whatever), check
	for a function binding for that before erroring. Otherwise command
	remapping and C mode interact badly, since most of the C mode
	commands are regarded as GNU Emacs-style keysyms.
affected #:  2 files
diff -r be87f507f5100953f14b0405f0ccbd825e941fe7 -r
4d15e903800b152c8f2710467d8e0693dd054570 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,12 @@
+2012-11-06  Aidan Kehoe  <kehoea(a)parhasard.net>
+
+	* keymap.c (define_key_check_and_coerce_keysym):
+	When worrying about GNU Emacs-like keysym syntax, if the symbol
+	name starts with c-whatever (or s-whatever, or m-whatever), check
+	for a function binding for that before erroring. Otherwise command
+	remapping and C mode interact badly, since most of the C mode
+	commands are regarded as GNU Emacs-style keysyms.
+
 2012-11-06  Aidan Kehoe  <kehoea(a)parhasard.net>
 
 	* keymap.c (event_binding):
diff -r be87f507f5100953f14b0405f0ccbd825e941fe7 -r
4d15e903800b152c8f2710467d8e0693dd054570 src/keymap.c
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -1344,7 +1344,11 @@
 	 sanitize the Sun keyboards, and would make it trickier to
 	 conditionalize a .emacs file for multiple X servers.
 	 */
-      if (((int) qxestrlen (name) >= 2 && name[1] == '-')
+      if (((int) qxestrlen (name) >= 2 && name[1] == '-'
+	   /* Check for a function binding if the symbol looks like
+	      c-..., otherwise command remapping and C mode interact
+	      badly. */
+           && NILP (Ffunctionp (XSYMBOL_FUNCTION (*keysym))))
 #if 1
           ||
 	  /* Ok, this is a bit more dubious - prevent people from doing things
https://bitbucket.org/xemacs/xemacs/changeset/7f4c8574a590/
changeset:   7f4c8574a590
user:        kehoea
date:        2012-11-07 00:12:06
summary:     No error from an incorrect number of arguments, recently-added compiler
macros
lisp/ChangeLog addition:
2012-11-06  Aidan Kehoe  <kehoea(a)parhasard.net>
	* cl-macs.el (equal, member, assoc, rassoc):
	Never error at compile time in these compiler macros because of an
	incorrect number of arguments.
affected #:  2 files
diff -r 4d15e903800b152c8f2710467d8e0693dd054570 -r
7f4c8574a590f3e3457bdecf5716aa21a64626c8 lisp/ChangeLog
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
+2012-11-06  Aidan Kehoe  <kehoea(a)parhasard.net>
+
+	* cl-macs.el (equal, member, assoc, rassoc):
+	Never error at compile time in these compiler macros because of an
+	incorrect number of arguments.
+
 2012-10-14  Aidan Kehoe  <kehoea(a)parhasard.net>
 
 	* help.el:
diff -r 4d15e903800b152c8f2710467d8e0693dd054570 -r
7f4c8574a590f3e3457bdecf5716aa21a64626c8 lisp/cl-macs.el
--- a/lisp/cl-macs.el
+++ b/lisp/cl-macs.el
@@ -3238,34 +3238,46 @@
 (defun cl-cdr-or-pi (object)
   (if (consp object) (cdr object) pi))
 
-(define-compiler-macro equal (&whole form a b)
-  (if (or (cl-equal-equivalent-to-eq-p (cl-const-expr-val a pi))
-          (cl-equal-equivalent-to-eq-p (cl-const-expr-val b pi)))
-      (cons 'eq (cdr form))
-    form))
-
-(define-compiler-macro member (&whole form elt list)
-  (if (or (cl-equal-equivalent-to-eq-p (cl-const-expr-val elt pi))
-          (every #'cl-equal-equivalent-to-eq-p
-                 (cl-const-expr-val list '(1.0))))
-      (cons 'memq (cdr form))
-    form))
-
-(define-compiler-macro assoc (&whole form elt list)
-  (if (or (cl-equal-equivalent-to-eq-p (cl-const-expr-val elt pi))
-          (not (find-if-not #'cl-equal-equivalent-to-eq-p
-                            (cl-const-expr-val list '((1.0 . nil)))
-:key #'cl-car-or-pi)))
-      (cons 'assq (cdr form))
-    form))
-
-(define-compiler-macro rassoc (&whole form elt list)
-  (if (or (cl-equal-equivalent-to-eq-p (cl-const-expr-val elt pi))
-          (not (find-if-not #'cl-equal-equivalent-to-eq-p
-                            (cl-const-expr-val list '((nil . 1.0)))
+(define-compiler-macro equal (&whole form &rest args)
+  (cond
+   ((not (eql (length form) 3))
+    form)
+   ((or (cl-equal-equivalent-to-eq-p (cl-const-expr-val (pop args) pi))
+        (cl-equal-equivalent-to-eq-p (cl-const-expr-val (pop args) pi)))
+    (cons 'eq (cdr form)))
+   (t form)))
+
+(define-compiler-macro member (&whole form &rest args)
+  (cond
+   ((not (eql (length form) 3))
+    form)
+   ((or (cl-equal-equivalent-to-eq-p (cl-const-expr-val (pop args) pi))
+        (every #'cl-equal-equivalent-to-eq-p
+               (cl-const-expr-val (pop args) '(1.0))))
+    (cons 'memq (cdr form)))
+   (t form)))
+
+(define-compiler-macro assoc (&whole form &rest args)
+  (cond
+   ((not (eql (length form) 3))
+    form)
+   ((or (cl-equal-equivalent-to-eq-p (cl-const-expr-val (pop args) pi))
+        (not (find-if-not #'cl-equal-equivalent-to-eq-p
+                          (cl-const-expr-val (pop args) '((1.0 . nil)))
+:key #'cl-car-or-pi)))
+    (cons 'assq (cdr form)))
+   (t form)))
+
+(define-compiler-macro rassoc (&whole form &rest args)
+  (cond
+   ((not (eql (length form) 3))
+    form)
+   ((or (cl-equal-equivalent-to-eq-p (cl-const-expr-val (pop args) pi))
+        (not (find-if-not #'cl-equal-equivalent-to-eq-p
+                            (cl-const-expr-val (pop args) '((nil . 1.0)))
                             :key #'cl-cdr-or-pi)))
-      (cons 'rassq (cdr form))
-    form))
+    (cons 'rassq (cdr form)))
+   (t form)))
 
 (macrolet
     ((define-star-compiler-macros (&rest macros)
Repository URL: 
https://bitbucket.org/xemacs/xemacs/
--
This is a commit notification from 
bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches