Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
c1141155
Commit
c1141155
authored
Mar 14, 2011
by
Paul Eggert
Browse files
* keymap.c: (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
(describe_map_tree): Rename locals to avoid shadowing.
parent
dbbb8427
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
28 deletions
+32
-28
src/ChangeLog
src/ChangeLog
+3
-0
src/keymap.c
src/keymap.c
+29
-28
No files found.
src/ChangeLog
View file @
c1141155
...
...
@@ -5,6 +5,9 @@
Now static.
(Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
(DENSE_TABLE_SIZE): Remove; unused.
(get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
(describe_map_tree):
Rename locals to avoid shadowing.
* keyboard.c: Declare functions static if they are not used elsewhere.
(echo_char, echo_dash, cmd_error, top_level_2):
src/keymap.c
View file @
c1141155
...
...
@@ -188,8 +188,9 @@ when reading a key-sequence to be looked-up in this keymap. */)
If the map needs to be autoloaded, but AUTOLOAD is zero (and ERROR
is zero as well), return Qt.
ERROR controls how we respond if OBJECT isn't a keymap.
If ERROR is non-zero, signal an error; otherwise, just return Qnil.
ERROR_IF_NOT_KEYMAP controls how we respond if OBJECT isn't a keymap.
If ERROR_IF_NOT_KEYMAP is non-zero, signal an error; otherwise,
just return Qnil.
Note that most of the time, we don't want to pursue autoloads.
Functions like Faccessible_keymaps which scan entire keymap trees
...
...
@@ -201,7 +202,7 @@ when reading a key-sequence to be looked-up in this keymap. */)
do_autoload which can GC. */
Lisp_Object
get_keymap
(
Lisp_Object
object
,
int
error
,
int
autoload
)
get_keymap
(
Lisp_Object
object
,
int
error
_if_not_keymap
,
int
autoload
)
{
Lisp_Object
tem
;
...
...
@@ -219,7 +220,7 @@ get_keymap (Lisp_Object object, int error, int autoload)
/* Should we do an autoload? Autoload forms for keymaps have
Qkeymap as their fifth element. */
if
((
autoload
||
!
error
)
&&
EQ
(
XCAR
(
tem
),
Qautoload
)
if
((
autoload
||
!
error
_if_not_keymap
)
&&
EQ
(
XCAR
(
tem
),
Qautoload
)
&&
SYMBOLP
(
object
))
{
Lisp_Object
tail
;
...
...
@@ -244,7 +245,7 @@ get_keymap (Lisp_Object object, int error, int autoload)
}
end:
if
(
error
)
if
(
error
_if_not_keymap
)
wrong_type_argument
(
Qkeymapp
,
object
);
return
Qnil
;
}
...
...
@@ -465,19 +466,19 @@ access_keymap (Lisp_Object map, Lisp_Object idx, int t_ok, int noinherit, int au
/* See if there is a meta-map. If there's none, there is
no binding for IDX, unless a default binding exists in MAP. */
struct
gcpro
gcpro1
;
Lisp_Object
meta_map
;
Lisp_Object
event_
meta_map
;
GCPRO1
(
map
);
/* A strange value in which Meta is set would cause
infinite recursion. Protect against that. */
if
(
XINT
(
meta_prefix_char
)
&
CHAR_META
)
meta_prefix_char
=
make_number
(
27
);
meta_map
=
get_keymap
(
access_keymap
(
map
,
meta_prefix_char
,
t_ok
,
noinherit
,
autoload
),
0
,
autoload
);
event_
meta_map
=
get_keymap
(
access_keymap
(
map
,
meta_prefix_char
,
t_ok
,
noinherit
,
autoload
),
0
,
autoload
);
UNGCPRO
;
if
(
CONSP
(
meta_map
))
if
(
CONSP
(
event_
meta_map
))
{
map
=
meta_map
;
map
=
event_
meta_map
;
idx
=
make_number
(
XUINT
(
idx
)
&
~
meta_modifier
);
}
else
if
(
t_ok
)
...
...
@@ -1139,10 +1140,10 @@ binding KEY to DEF is added at the front of KEYMAP. */)
int
i
=
ASIZE
(
def
);
while
(
--
i
>=
0
)
{
Lisp_Object
c
=
AREF
(
def
,
i
);
if
(
CONSP
(
c
)
&&
lucid_event_type_list_p
(
c
))
c
=
Fevent_convert_list
(
c
);
ASET
(
tmp
,
i
,
c
);
Lisp_Object
defi
=
AREF
(
def
,
i
);
if
(
CONSP
(
defi
)
&&
lucid_event_type_list_p
(
defi
))
defi
=
Fevent_convert_list
(
defi
);
ASET
(
tmp
,
i
,
defi
);
}
def
=
tmp
;
}
...
...
@@ -2812,9 +2813,9 @@ remapped command in the returned list. */)
seems to be only one menu item to report. */
if
(
!
NILP
(
sequence
))
{
Lisp_Object
tem
;
tem
=
Faref
(
sequence
,
make_number
(
ASIZE
(
sequence
)
-
1
));
if
(
STRINGP
(
tem
))
Lisp_Object
tem
1
;
tem
1
=
Faref
(
sequence
,
make_number
(
ASIZE
(
sequence
)
-
1
));
if
(
STRINGP
(
tem
1
))
Faset
(
sequence
,
make_number
(
ASIZE
(
sequence
)
-
1
),
build_string
(
"(any string)"
));
}
...
...
@@ -3119,13 +3120,13 @@ key binding\n\
/* Delete from MAPS each element that is for the menu bar. */
for
(
list
=
maps
;
CONSP
(
list
);
list
=
XCDR
(
list
))
{
Lisp_Object
elt
,
prefix
,
tem
;
Lisp_Object
elt
,
elt_
prefix
,
tem
;
elt
=
XCAR
(
list
);
prefix
=
Fcar
(
elt
);
if
(
XVECTOR
(
prefix
)
->
size
>=
1
)
elt_
prefix
=
Fcar
(
elt
);
if
(
XVECTOR
(
elt_
prefix
)
->
size
>=
1
)
{
tem
=
Faref
(
prefix
,
make_number
(
0
));
tem
=
Faref
(
elt_
prefix
,
make_number
(
0
));
if
(
EQ
(
tem
,
Qmenu_bar
))
maps
=
Fdelq
(
elt
,
maps
);
}
...
...
@@ -3150,10 +3151,10 @@ key binding\n\
for
(;
CONSP
(
maps
);
maps
=
XCDR
(
maps
))
{
register
Lisp_Object
elt
,
prefix
,
tail
;
register
Lisp_Object
elt
,
elt_
prefix
,
tail
;
elt
=
XCAR
(
maps
);
prefix
=
Fcar
(
elt
);
elt_
prefix
=
Fcar
(
elt
);
sub_shadows
=
Qnil
;
...
...
@@ -3165,8 +3166,8 @@ key binding\n\
/* If the sequence by which we reach this keymap is zero-length,
then the shadow map for this keymap is just SHADOW. */
if
((
STRINGP
(
prefix
)
&&
SCHARS
(
prefix
)
==
0
)
||
(
VECTORP
(
prefix
)
&&
XVECTOR
(
prefix
)
->
size
==
0
))
if
((
STRINGP
(
elt_
prefix
)
&&
SCHARS
(
elt_
prefix
)
==
0
)
||
(
VECTORP
(
elt_
prefix
)
&&
XVECTOR
(
elt_
prefix
)
->
size
==
0
))
;
/* If the sequence by which we reach this keymap actually has
some elements, then the sequence's definition in SHADOW is
...
...
@@ -3192,12 +3193,12 @@ key binding\n\
for
(
tail
=
orig_maps
;
!
EQ
(
tail
,
maps
);
tail
=
XCDR
(
tail
))
{
Lisp_Object
tem
;
tem
=
Fequal
(
Fcar
(
XCAR
(
tail
)),
prefix
);
tem
=
Fequal
(
Fcar
(
XCAR
(
tail
)),
elt_
prefix
);
if
(
!
NILP
(
tem
))
sub_shadows
=
Fcons
(
XCDR
(
XCAR
(
tail
)),
sub_shadows
);
}
describe_map
(
Fcdr
(
elt
),
prefix
,
describe_map
(
Fcdr
(
elt
),
elt_
prefix
,
transl
?
describe_translation
:
describe_command
,
partial
,
sub_shadows
,
&
seen
,
nomenu
,
mention_shadow
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment