/[emacs]/emacs/src/keymap.c
ViewVC logotype

Diff of /emacs/src/keymap.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.282.4.4 by handa, Sat Nov 22 11:04:01 2003 UTC revision 1.282.4.5 by handa, Mon Nov 24 02:46:11 2003 UTC
# Line 870  store_in_keymap (keymap, idx, def) Line 870  store_in_keymap (keymap, idx, def)
870                  ASET (elt, XFASTINT (idx), def);                  ASET (elt, XFASTINT (idx), def);
871                  return def;                  return def;
872                }                }
873                else if (CONSP (idx) && CHARACTERP (XCAR (idx)))
874                  {
875                    int from = XFASTINT (XCAR (idx));
876                    int to = XFASTINT (XCDR (idx));
877    
878                    if (to >= ASIZE (elt))
879                      to = ASIZE (elt) - 1;
880                    for (; from <= to; from++)
881                      ASET (elt, from, def);
882                    if (to == XFASTINT (XCDR (idx)))
883                      /* We have defined all keys in IDX.  */
884                      return def;
885                  }
886              insertion_point = tail;              insertion_point = tail;
887            }            }
888          else if (CHAR_TABLE_P (elt))          else if (CHAR_TABLE_P (elt))
# Line 900  store_in_keymap (keymap, idx, def) Line 913  store_in_keymap (keymap, idx, def)
913                  XSETCDR (elt, def);                  XSETCDR (elt, def);
914                  return def;                  return def;
915                }                }
916                else if (CONSP (idx) && CHARACTERP (XCAR (idx)))
917                  {
918                    int from = XFASTINT (XCAR (idx));
919                    int to = XFASTINT (XCDR (idx));
920    
921                    if (from <= XFASTINT (XCAR (elt))
922                        && to >= XFASTINT (XCAR (elt)))
923                      {
924                        XSETCDR (elt, def);
925                        if (from == to)
926                          return def;
927                      }
928                  }
929            }            }
930          else if (EQ (elt, Qkeymap))          else if (EQ (elt, Qkeymap))
931            /* If we find a 'keymap' symbol in the spine of KEYMAP,            /* If we find a 'keymap' symbol in the spine of KEYMAP,
# Line 914  store_in_keymap (keymap, idx, def) Line 940  store_in_keymap (keymap, idx, def)
940    keymap_end:    keymap_end:
941      /* We have scanned the entire keymap, and not found a binding for      /* We have scanned the entire keymap, and not found a binding for
942         IDX.  Let's add one.  */         IDX.  Let's add one.  */
943      XSETCDR (insertion_point,      {
944               Fcons (Fcons (idx, def), XCDR (insertion_point)));        Lisp_Object elt;
945    
946          if (CONSP (idx) && CHARACTERP (XCAR (idx)))
947            {
948              /* IDX specifies a range of characters, and not all of them
949                 were handled yet, which means this keymap doesn't have a
950                 char-table.  So, we insert a char-table now.  */
951              elt = Fmake_char_table (Qkeymap, Qnil);
952              Fset_char_table_range (elt, idx, NILP (def) ? Qt : def);
953            }
954          else
955            elt = Fcons (idx, def);
956          XSETCDR (insertion_point, Fcons (elt, XCDR (insertion_point)));
957        }
958    }    }
959    
960    return def;    return def;

Legend:
Removed from v.1.282.4.4  
changed lines
  Added in v.1.282.4.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26