emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r99612: Fix keyboard macro key lookup


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r99612: Fix keyboard macro key lookup (Bug#5481).
Date: Wed, 03 Mar 2010 12:31:50 -0500
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 99612
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Wed 2010-03-03 12:31:50 -0500
message:
  Fix keyboard macro key lookup (Bug#5481).
  
  * src/keymap.c (Fwhere_is_internal): Use Fequal to compare
  definitions, so that keyboard macros are correctly handled
  (Bug#5481).
  
  * lisp/macros.el (insert-kbd-macro): Look up keyboard macro
  using the definition, not the name (Bug#5481).
modified:
  lisp/ChangeLog
  lisp/macros.el
  src/ChangeLog
  src/keymap.c
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-03-03 04:11:15 +0000
+++ b/lisp/ChangeLog    2010-03-03 17:31:50 +0000
@@ -1,3 +1,8 @@
+2010-03-03  Chong Yidong  <address@hidden>
+
+       * macros.el (insert-kbd-macro): Look up keyboard macro using the
+       definition, not the name (Bug#5481).
+
 2010-03-03  Štěpán Němec  <address@hidden>  (tiny change)
 
        * subr.el (momentary-string-display): Don't overwrite the MESSAGE

=== modified file 'lisp/macros.el'
--- a/lisp/macros.el    2010-02-04 05:14:36 +0000
+++ b/lisp/macros.el    2010-03-03 17:31:50 +0000
@@ -138,7 +138,8 @@
        (prin1 definition (current-buffer))))
     (insert ")\n")
     (if keys
-       (let ((keys (where-is-internal macroname '(keymap))))
+       (let ((keys (where-is-internal (symbol-function macroname)
+                                      '(keymap))))
          (while keys
            (insert "(global-set-key ")
            (prin1 (car keys) (current-buffer))

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2010-03-02 20:35:44 +0000
+++ b/src/ChangeLog     2010-03-03 17:31:50 +0000
@@ -1,3 +1,9 @@
+2010-03-03  Chong Yidong  <address@hidden>
+
+       * keymap.c (Fwhere_is_internal): Use Fequal to compare
+       definitions, so that keyboard macros are correctly handled
+       (Bug#5481).
+
 2010-03-02  Eli Zaretskii  <address@hidden>
 
        * coding.c (decode_coding_emacs_mule): Fixup pointers to buffer

=== modified file 'src/keymap.c'
--- a/src/keymap.c      2010-01-24 08:42:22 +0000
+++ b/src/keymap.c      2010-03-03 17:31:50 +0000
@@ -1633,13 +1633,13 @@
   /* If a mouse click position is given, our variables are based on
      the buffer clicked on, not the current buffer.  So we may have to
      switch the buffer here. */
-  
+
   if (CONSP (position))
     {
       Lisp_Object window;
-      
+
       window = POSN_WINDOW (position);
-         
+
       if (WINDOWP (window)
          && BUFFERP (XWINDOW (window)->buffer)
          && XBUFFER (XWINDOW (window)->buffer) != current_buffer)
@@ -1651,14 +1651,14 @@
             would not be a problem here, but it is easier to keep
             things the same.
          */
-             
+
          record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
-         
+
          set_buffer_internal (XBUFFER (XWINDOW (window)->buffer));
        }
     }
 
-  keymaps = Fcons (current_global_map, Qnil);  
+  keymaps = Fcons (current_global_map, Qnil);
 
   if (!NILP (olp))
     {
@@ -1685,8 +1685,8 @@
       /* Get the buffer local maps, possibly overriden by text or
         overlay properties */
 
-      local_map = get_local_map (pt, current_buffer, Qlocal_map); 
-      keymap = get_local_map (pt, current_buffer, Qkeymap); 
+      local_map = get_local_map (pt, current_buffer, Qlocal_map);
+      keymap = get_local_map (pt, current_buffer, Qkeymap);
 
       if (CONSP (position))
        {
@@ -1694,7 +1694,7 @@
 
          /* For a mouse click, get the local text-property keymap
             of the place clicked on, rather than point.  */
-         
+
          if (POSN_INBUFFER_P (position))
            {
              Lisp_Object pos;
@@ -1705,7 +1705,7 @@
                {
                  local_map = get_local_map (XINT (pos),
                                             current_buffer, Qlocal_map);
-                 
+
                  keymap = get_local_map (XINT (pos),
                                          current_buffer, Qkeymap);
                }
@@ -1716,12 +1716,12 @@
             string displayed via the `display' property,
             consider `local-map' and `keymap' properties of
             that string.  */
-         
+
          if (string = POSN_STRING (position),
              (CONSP (string) && STRINGP (XCAR (string))))
            {
              Lisp_Object pos, map;
-             
+
              pos = XCDR (string);
              string = XCAR (string);
              if (INTEGERP (pos)
@@ -1737,7 +1737,7 @@
                    keymap = map;
                }
            }
-         
+
        }
 
       if (!NILP (local_map))
@@ -2890,7 +2890,7 @@
             CONSP (sequences)))
     {
       Lisp_Object sequence, function;
-         
+
       sequence = XCAR (sequences);
       sequences = XCDR (sequences);
 
@@ -2903,8 +2903,8 @@
 
         Either nil or number as value from Flookup_key
         means undefined.  */
-      if (!EQ (shadow_lookup (keymaps, sequence, Qnil, remapped),
-              definition))
+      if (NILP (Fequal (shadow_lookup (keymaps, sequence, Qnil, remapped),
+                       definition)))
        continue;
 
       /* If the current sequence is a command remapping with
@@ -2933,12 +2933,12 @@
            Faset (sequence, make_number (ASIZE (sequence) - 1),
                   build_string ("(any string)"));
        }
-      
+
       /* It is a true unshadowed match.  Record it, unless it's already
         been seen (as could happen when inheriting keymaps).  */
       if (NILP (Fmember (sequence, found)))
        found = Fcons (sequence, found);
-      
+
       /* If firstonly is Qnon_ascii, then we can return the first
         binding we find.  If firstonly is not Qnon_ascii but not
         nil, then we should return the first ascii-only binding


reply via email to

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