comparison src/keymap.c @ 88821:690d527d1ad2

(access_keymap): Remove generic char code. (push_key_description): Use CHARACTERP.
author Dave Love <fx@gnu.org>
date Wed, 03 Jul 2002 22:01:54 +0000
parents f35665df510f
children 5ee60ded9f0d
comparison
equal deleted inserted replaced
88820:2a39da7c94ef 88821:690d527d1ad2
535 for this key sequence. */ 535 for this key sequence. */
536 536
537 Lisp_Object t_binding; 537 Lisp_Object t_binding;
538 t_binding = Qnil; 538 t_binding = Qnil;
539 539
540 /* If `t_ok' is 2, both `t' and generic-char bindings are accepted. 540 /* If `t_ok' is 2, both `t' is accepted. */
541 If it is 1, only generic-char bindings are accepted.
542 Otherwise, neither are. */
543 t_ok = t_ok ? 2 : 0; 541 t_ok = t_ok ? 2 : 0;
544 542
545 for (tail = XCDR (map); 543 for (tail = XCDR (map);
546 (CONSP (tail) 544 (CONSP (tail)
547 || (tail = get_keymap (tail, 0, autoload), CONSP (tail))); 545 || (tail = get_keymap (tail, 0, autoload), CONSP (tail)));
561 { 559 {
562 Lisp_Object key = XCAR (binding); 560 Lisp_Object key = XCAR (binding);
563 561
564 if (EQ (key, idx)) 562 if (EQ (key, idx))
565 val = XCDR (binding); 563 val = XCDR (binding);
566 else if (t_ok
567 && INTEGERP (idx)
568 && (XINT (idx) & CHAR_MODIFIER_MASK) == 0
569 && INTEGERP (key)
570 && (XINT (key) & CHAR_MODIFIER_MASK) == 0
571 && !SINGLE_BYTE_CHAR_P (XINT (idx))
572 && !SINGLE_BYTE_CHAR_P (XINT (key))
573 && CHAR_VALID_P (XINT (key), 1)
574 && !CHAR_VALID_P (XINT (key), 0)
575 && (CHAR_CHARSET (XINT (key))
576 == CHAR_CHARSET (XINT (idx))))
577 {
578 /* KEY is the generic character of the charset of IDX.
579 Use KEY's binding if there isn't a binding for IDX
580 itself. */
581 t_binding = XCDR (binding);
582 t_ok = 0;
583 }
584 else if (t_ok > 1 && EQ (key, Qt)) 564 else if (t_ok > 1 && EQ (key, Qt))
585 { 565 {
586 t_binding = XCDR (binding); 566 t_binding = XCDR (binding);
587 t_ok = 1; 567 t_ok = 1;
588 } 568 }
2042 && SINGLE_BYTE_CHAR_P (c) 2022 && SINGLE_BYTE_CHAR_P (c)
2043 && !force_multibyte)) 2023 && !force_multibyte))
2044 { 2024 {
2045 *p++ = c; 2025 *p++ = c;
2046 } 2026 }
2047 else if (CHAR_VALID_P (c, 0)) 2027 else if (CHARACTERP (c))
2048 { 2028 {
2049 if (NILP (current_buffer->enable_multibyte_characters)) 2029 if (NILP (current_buffer->enable_multibyte_characters))
2050 *p++ = multibyte_char_to_unibyte (c, Qnil); 2030 *p++ = multibyte_char_to_unibyte (c, Qnil);
2051 else 2031 else
2052 p += CHAR_STRING (c, (unsigned char *) p); 2032 p += CHAR_STRING (c, (unsigned char *) p);