emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs/src ChangeLog keymap.c


From: Stefan Monnier
Subject: [Emacs-diffs] emacs/src ChangeLog keymap.c
Date: Wed, 09 Sep 2009 02:38:53 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        09/09/09 02:38:53

Modified files:
        src            : ChangeLog keymap.c 

Log message:
        (where_is_internal): Filter out shadowed remappings.
        Assume that where_is_internal returns unshadowed bindings to simplify
        the code and get rid of the gotos.  Use ASIZE.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/src/ChangeLog?cvsroot=emacs&r1=1.7730&r2=1.7731
http://cvs.savannah.gnu.org/viewcvs/emacs/src/keymap.c?cvsroot=emacs&r1=1.380&r2=1.381

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/src/ChangeLog,v
retrieving revision 1.7730
retrieving revision 1.7731
diff -u -b -r1.7730 -r1.7731
--- ChangeLog   4 Sep 2009 05:33:49 -0000       1.7730
+++ ChangeLog   9 Sep 2009 02:38:50 -0000       1.7731
@@ -1,3 +1,9 @@
+2009-09-09  Stefan Monnier  <address@hidden>
+
+       * keymap.c (where_is_internal): Filter out shadowed remappings.
+       Assume that where_is_internal returns unshadowed bindings to simplify
+       the code and get rid of the gotos.  Use ASIZE.
+
 2009-09-04  Jan Djärv  <address@hidden>
 
        * xterm.c (x_focus_changed): If we get a focusout and pointer

Index: keymap.c
===================================================================
RCS file: /sources/emacs/emacs/src/keymap.c,v
retrieving revision 1.380
retrieving revision 1.381
diff -u -b -r1.380 -r1.381
--- keymap.c    20 Feb 2009 01:52:22 -0000      1.380
+++ keymap.c    9 Sep 2009 02:38:53 -0000       1.381
@@ -2758,30 +2758,6 @@
          sequence = XCAR (sequences);
          sequences = XCDR (sequences);
 
-         /* If the current sequence is a command remapping with
-            format [remap COMMAND], find the key sequences
-            which run COMMAND, and use those sequences instead.  */
-         remapped = Qnil;
-         if (NILP (no_remap)
-             && VECTORP (sequence) && XVECTOR (sequence)->size == 2
-             && EQ (AREF (sequence, 0), Qremap)
-             && (function = AREF (sequence, 1), SYMBOLP (function)))
-           {
-             Lisp_Object remapped1;
-             
-             remapped1 = where_is_internal (function, keymaps, firstonly, 
noindirect, Qt);
-             if (CONSP (remapped1))
-               {
-                 /* Verify that this key binding actually maps to the
-                    remapped command (see below).  */
-                 if (!EQ (shadow_lookup (keymaps, XCAR (remapped1), Qnil), 
function))
-                   continue;
-                 sequence = XCAR (remapped1);
-                 remapped = XCDR (remapped1);
-                 goto record_sequence;
-               }
-           }
-
          /* Verify that this key binding is not shadowed by another
             binding for the same key, before we say it exists.
 
@@ -2794,17 +2770,31 @@
          if (!EQ (shadow_lookup (keymaps, sequence, Qnil), definition))
            continue;
 
-       record_sequence:
-         /* Don't annoy user with strings from a menu such as
-            Select Paste.  Change them all to "(any string)",
-            so that there seems to be only one menu item
-            to report. */
+         /* If the current sequence is a command remapping with
+            format [remap COMMAND], find the key sequences
+            which run COMMAND, and use those sequences instead.  */
+         if (NILP (no_remap)
+             && VECTORP (sequence) && XVECTOR (sequence)->size == 2
+             && EQ (AREF (sequence, 0), Qremap)
+             && (function = AREF (sequence, 1), SYMBOLP (function)))
+           remapped = where_is_internal (function, keymaps, firstonly,
+                                         noindirect, Qt);
+         else
+           remapped = Fcons (sequence, Qnil);
+
+         for (; CONSP (remapped);
+              sequence = XCAR (remapped), remapped = XCDR (remapped))
+           {
+             /* Don't annoy user with strings from a menu such as the
+                entries from the "Edit => Paste from Kill Menu".
+                Change them all to "(any string)", so that there
+                seems to be only one menu item to report.  */
          if (! NILP (sequence))
            {
              Lisp_Object tem;
-             tem = Faref (sequence, make_number (XVECTOR (sequence)->size - 
1));
+                 tem = Faref (sequence, make_number (ASIZE (sequence) - 1));
              if (STRINGP (tem))
-               Faset (sequence, make_number (XVECTOR (sequence)->size - 1),
+                   Faset (sequence, make_number (ASIZE (sequence) - 1),
                       build_string ("(any string)"));
            }
 
@@ -2819,14 +2809,10 @@
             we find.  */
          if (EQ (firstonly, Qnon_ascii))
            RETURN_UNGCPRO (sequence);
-         else if (!NILP (firstonly) && 2 == preferred_sequence_p (sequence))
+             else if (!NILP (firstonly)
+                      && 2 == preferred_sequence_p (sequence))
            RETURN_UNGCPRO (sequence);
 
-         if (CONSP (remapped))
-           {
-             sequence = XCAR (remapped);
-             remapped = XCDR (remapped);
-             goto record_sequence;
            }
        }
     }




reply via email to

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