* Wrong comment in keymap.c
@ 2007-03-22 12:37 Herbert Euler
2007-03-23 1:25 ` Herbert Euler
0 siblings, 1 reply; 6+ messages in thread
From: Herbert Euler @ 2007-03-22 12:37 UTC (permalink / raw)
To: emacs-devel
The comment for `current_minor_maps' is wrong. Below is the patch.
*** keymap.c.~1.282.4.44.~ Mon Nov 13 10:58:22 2006
--- keymap.c Thu Mar 22 20:31:16 2007
*************** current_minor_maps (modeptr, mapptr)
*** 1432,1439 ****
static Lisp_Object *cmm_modes = NULL, *cmm_maps = NULL;
static int cmm_size = 0;
! /* Store a pointer to an array of the keymaps of the currently active
! minor modes in *buf, and return the number of maps it contains.
This function always returns a pointer to the same buffer, and may
free or reallocate it, so if you want to keep it for a long time or
--- 1432,1441 ----
static Lisp_Object *cmm_modes = NULL, *cmm_maps = NULL;
static int cmm_size = 0;
! /* Store a pointer to an array of the currently active minor modes in
! *modeptr, a pointer to an array of the keymaps of the currently
! active minor modes in *mapptr, and return the number of maps
! *mapptr contains.
This function always returns a pointer to the same buffer, and may
free or reallocate it, so if you want to keep it for a long time or
Regards,
Guanpeng Xu
_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar - get it now!
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: Wrong comment in keymap.c
2007-03-22 12:37 Wrong comment in keymap.c Herbert Euler
@ 2007-03-23 1:25 ` Herbert Euler
2007-03-26 1:49 ` Stefan Monnier
0 siblings, 1 reply; 6+ messages in thread
From: Herbert Euler @ 2007-03-23 1:25 UTC (permalink / raw)
To: herberteuler, emacs-devel
Here is another one, for `read_key_sequence' in keyboard.c.
`first_binding' is always used with `submaps', shouldn't the
comment for it be `submaps', rather than `defs'? Patch:
*** keyboard.c.~1.753.2.58.~ Mon Nov 13 10:58:22 2006
--- keyboard.c Fri Mar 23 09:21:18 2007
*************** read_key_sequence (keybuf, bufsize, prom
*** 8656,8664 ****
of the place where a mouse click occurred. */
volatile int localized_local_map = 0;
! /* The index in defs[] of the first keymap that has a binding for
this key sequence. In other words, the lowest i such that
! defs[i] is non-nil. */
volatile int first_binding;
/* Index of the first key that has no binding.
It is useless to try fkey.start larger than that. */
--- 8656,8664 ----
of the place where a mouse click occurred. */
volatile int localized_local_map = 0;
! /* The index in submaps[] of the first keymap that has a binding for
this key sequence. In other words, the lowest i such that
! submaps[i] is non-nil. */
volatile int first_binding;
/* Index of the first key that has no binding.
It is useless to try fkey.start larger than that. */
Regards,
Guanpeng Xu
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Wrong comment in keymap.c
2007-03-23 1:25 ` Herbert Euler
@ 2007-03-26 1:49 ` Stefan Monnier
2007-03-26 4:24 ` Herbert Euler
0 siblings, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2007-03-26 1:49 UTC (permalink / raw)
To: Herbert Euler; +Cc: emacs-devel
> Here is another one, for `read_key_sequence' in keyboard.c.
> `first_binding' is always used with `submaps', shouldn't the
> comment for it be `submaps', rather than `defs'?
No, the comment is correct. The "submaps[first_binding]" expressions are
used to check whether that first binding is a prefix or not. I.e. kind of
like "KEYMAPP (defs[first_binding])".
It's mostly set in follow_key:
if (! NILP (defs[i]))
first_binding = i;
-- Stefan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Wrong comment in keymap.c
2007-03-26 1:49 ` Stefan Monnier
@ 2007-03-26 4:24 ` Herbert Euler
2007-03-26 5:50 ` Herbert Euler
0 siblings, 1 reply; 6+ messages in thread
From: Herbert Euler @ 2007-03-26 4:24 UTC (permalink / raw)
To: monnier; +Cc: emacs-devel
> > Here is another one, for `read_key_sequence' in keyboard.c.
> > `first_binding' is always used with `submaps', shouldn't the
> > comment for it be `submaps', rather than `defs'?
>
>No, the comment is correct. The "submaps[first_binding]" expressions are
>used to check whether that first binding is a prefix or not. I.e. kind of
>like "KEYMAPP (defs[first_binding])".
>
>It's mostly set in follow_key:
>
> if (! NILP (defs[i]))
> first_binding = i;
Excuse me, but there are two ``first_binding''s in this file; I refered
the one in ``read_key_sequence''. Please take a look at near line
8996:
/* Find an accurate initial value for first_binding. */
for (first_binding = 0; first_binding < nmaps; first_binding++)
if (! NILP (submaps[first_binding]))
break;
Regards,
Guanpeng Xu
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Wrong comment in keymap.c
2007-03-26 4:24 ` Herbert Euler
@ 2007-03-26 5:50 ` Herbert Euler
2007-03-26 6:00 ` Herbert Euler
0 siblings, 1 reply; 6+ messages in thread
From: Herbert Euler @ 2007-03-26 5:50 UTC (permalink / raw)
To: herberteuler, monnier; +Cc: emacs-devel
>> > Here is another one, for `read_key_sequence' in keyboard.c.
>> > `first_binding' is always used with `submaps', shouldn't the
>> > comment for it be `submaps', rather than `defs'?
>>
>>No, the comment is correct. The "submaps[first_binding]" expressions are
>>used to check whether that first binding is a prefix or not. I.e. kind of
>>like "KEYMAPP (defs[first_binding])".
>>
>>It's mostly set in follow_key:
>>
>> if (! NILP (defs[i]))
>> first_binding = i;
>
>Excuse me, but there are two ``first_binding''s in this file; I refered
>the one in ``read_key_sequence''. Please take a look at near line
>8996:
>
> /* Find an accurate initial value for first_binding. */
> for (first_binding = 0; first_binding < nmaps; first_binding++)
> if (! NILP (submaps[first_binding]))
> break;
I guess I know what you meant now. I was wrong. I'm sorry
for the patch of keyboard.c. And thank you for reviewing it.
Regards,
Guanpeng Xu
_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar - get it now!
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Wrong comment in keymap.c
2007-03-26 5:50 ` Herbert Euler
@ 2007-03-26 6:00 ` Herbert Euler
0 siblings, 0 replies; 6+ messages in thread
From: Herbert Euler @ 2007-03-26 6:00 UTC (permalink / raw)
To: herberteuler, monnier; +Cc: emacs-devel
>>> > Here is another one, for `read_key_sequence' in keyboard.c.
>>> > `first_binding' is always used with `submaps', shouldn't the
>>> > comment for it be `submaps', rather than `defs'?
>>>
>>>No, the comment is correct. The "submaps[first_binding]" expressions are
>>>used to check whether that first binding is a prefix or not. I.e. kind
>>>of
>>>like "KEYMAPP (defs[first_binding])".
>>>
>>>It's mostly set in follow_key:
>>>
>>> if (! NILP (defs[i]))
>>> first_binding = i;
>>
>>Excuse me, but there are two ``first_binding''s in this file; I refered
>>the one in ``read_key_sequence''. Please take a look at near line
>>8996:
>>
>> /* Find an accurate initial value for first_binding. */
>> for (first_binding = 0; first_binding < nmaps; first_binding++)
>> if (! NILP (submaps[first_binding]))
>> break;
>
>I guess I know what you meant now. I was wrong. I'm sorry
>for the patch of keyboard.c. And thank you for reviewing it.
Wait, please read this again:
if (! NILP (current[i]))
{
defs[i] = access_keymap (current[i], key, 1, 0, 1);
if (! NILP (defs[i]))
first_binding = i;
}
else
defs[i] = Qnil;
``current[i]'' is firstly tested. The invocation of ``follow_key''
in ``read_key_sequence'' uses ``submaps'' as the actual value
for ``current'', and ``first_binding'' is assigned to ``i'' because
``current[i]'' is not nil. So I think what ``first_binding'' means
is the lowest ``i'' such that ``submaps[i]'' is non-nil.
Regards,
Guanpeng Xu
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2007-03-26 6:00 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-22 12:37 Wrong comment in keymap.c Herbert Euler
2007-03-23 1:25 ` Herbert Euler
2007-03-26 1:49 ` Stefan Monnier
2007-03-26 4:24 ` Herbert Euler
2007-03-26 5:50 ` Herbert Euler
2007-03-26 6:00 ` Herbert Euler
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.