comparison src/doc.c @ 57497:0a4c356f307b

(Fsubstitute_command_keys): Fix remap-handling. Don't ignore menus, because where-is-internal already does it for us.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 15 Oct 2004 14:49:30 +0000
parents 4c881805ff35
children df00cdb75fc6 f3ec05478165
comparison
equal deleted inserted replaced
57496:ad0659a2d52e 57497:0a4c356f307b
772 772
773 strp++; /* skip ] */ 773 strp++; /* skip ] */
774 774
775 /* Save STRP in IDX. */ 775 /* Save STRP in IDX. */
776 idx = strp - SDATA (string); 776 idx = strp - SDATA (string);
777 tem = Fintern (make_string (start, length_byte), Qnil); 777 name = Fintern (make_string (start, length_byte), Qnil);
778 778
779 /* Ignore remappings unless there are no ordinary bindings. */ 779 /* Ignore remappings unless there are no ordinary bindings. */
780 tem = Fwhere_is_internal (tem, keymap, Qt, Qnil, Qt); 780 tem = Fwhere_is_internal (name, keymap, Qt, Qnil, Qt);
781 if (NILP (tem)) 781 if (NILP (tem))
782 tem = Fwhere_is_internal (tem, keymap, Qt, Qnil, Qnil); 782 tem = Fwhere_is_internal (name, keymap, Qt, Qnil, Qnil);
783 783
784 /* Note the Fwhere_is_internal can GC, so we have to take 784 /* Note the Fwhere_is_internal can GC, so we have to take
785 relocation of string contents into account. */ 785 relocation of string contents into account. */
786 strp = SDATA (string) + idx; 786 strp = SDATA (string) + idx;
787 start = SDATA (string) + start_idx; 787 start = SDATA (string) + start_idx;
788
789 /* Disregard menu bar bindings; it is positively annoying to
790 mention them when there's no menu bar, and it isn't terribly
791 useful even when there is a menu bar. */
792 if (!NILP (tem))
793 {
794 firstkey = Faref (tem, make_number (0));
795 if (EQ (firstkey, Qmenu_bar))
796 tem = Qnil;
797 }
798 788
799 if (NILP (tem)) /* but not on any keys */ 789 if (NILP (tem)) /* but not on any keys */
800 { 790 {
801 int offset = bufp - buf; 791 int offset = bufp - buf;
802 buf = (unsigned char *) xrealloc (buf, bsize += 4); 792 buf = (unsigned char *) xrealloc (buf, bsize += 4);