1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-06 11:50:51 -08:00
Commit graph

258 commits

Author SHA1 Message Date
Kim F. Storm
5f24537118 (Flookup_key): Fixed problem in 2001-12-28 patch:
The validation of the event type was too strict as it didn't
allow string events; buffer names are used in bindings for
menu-bar-select-buffer (see `menu-bar-update-buffers').
2002-02-24 00:24:37 +00:00
Kim F. Storm
a1df473f03 The following changes rework my patch of 2002-02-06 which
added command remapping by entering the commands directly into
the keymaps.  Now, command remapping uses an explicit `remap'
prefix in the keymaps, i.e. [remap COMMAND].

(Qremap, remap_command_vector): New variables.
(is_command_symbol): Removed function.
(Fdefine_key): No longer accept a symbol for KEY.  Added
validation of [remap COMMAND] argument for KEY.  The DEF is no
longer required to be a symbol when remapping a command.
(Fremap_command): New function to remap command through keymaps.
(Flookup_key): Perform command remapping initiated by
Fremap_command directly for speed.
(Fkey_binding): Use Fremap_command for command remapping.
(where_is_internal): Handle new command remapping representation.
(syms_of_keymap): Intern Qremap, initialize remap_command_vector,
staticpro them.  Defsubr Fremap_command.
2002-02-23 22:00:37 +00:00
Kim F. Storm
b864457cf8 (where_is_internal): Only check if definition is
remapped if it fulfills is_command_symbol.
2002-02-07 11:12:50 +00:00
Kim F. Storm
0c412762ee (Fdefine_key): Allow symbol as KEY argument for
defining command remapping.  Doc updated.
(Flookup_key): Remap command through keymap if KEY is a symbol.
(is_command_symbol): New function.
(Fkey_binding): Use it.  New optional argument NO-REMAP.  Doc
updated.  Callers changed.  Perform command remapping via
recursive call unless that arg is non-nil.
(where_is_internal): New argument no_remap.  Callers changed.
Call recursively to find original key bindings for a remapped
comand unless that arg is non-nil.
(Fwhere_is_internal): New optional argument NO-REMAP.  Doc
updated.  Callers changed.  Pass arg to where_is_internal.
2002-02-06 22:57:42 +00:00
Richard M. Stallman
d1d070e3c5 (Fcurrent_active_maps): Put the `keymap' property map first.
(Fkey_binding): Try the `keymap' property map first.
(Fdescribe_buffer_bindings): Show `keymap' property bindings before
minor mode bindings.
2002-01-03 21:28:16 +00:00
Richard M. Stallman
15fff01d49 (silly_event_symbol_error): New subrtn, from Fdefine_key.
Handle modifier bits.  Correct typo in error message.
2001-12-29 14:54:28 +00:00
Richard M. Stallman
ade19cac43 Fix previous change; also correct its change log:
(Fdefine_key): Add error message for trying to bind [DEL], [RET], etc.
(exclude_keys): New variable.
(Flookup_key): Error message if key has wrong data type.
2001-12-28 18:49:02 +00:00
Richard M. Stallman
2fae9111a4 (Flookup_key): Add error message for trying to bind [DEL], [RET], etc. 2001-12-28 18:39:20 +00:00
Pavel Janík
f0529b5b1a Doc fix. 2001-12-20 19:01:00 +00:00
Stefan Monnier
4dc3eb25ae (access_keymap): Handle t bindings like nil bindings.
Make nil bindings in char-tables transparent.
(store_in_keymap): Turn a nil binding into a t binding for char-tables.
2001-11-26 22:30:21 +00:00
Pavel Janík
1b944d9cd9 (access_keymap): Remove unused variables c1' and c2'. 2001-11-23 07:04:49 +00:00
Stefan Monnier
d55627cca4 (Fdescribe_vector): Add `describer' parameter.
(describe_command, describe_translation): Add dummy second param.
(describe_map): Call elt_describer with two arguments.
(describe_vector_princ): Add `fun' parameter.
Call it instead of the hardcoded `princ'.
(describe_vector): Add arg `args'.
Pass it as a new second argument to elt_describer.
2001-11-19 22:46:37 +00:00
Pavel Janík
335c5470b5 Change doc-string comments to new style' [w/doc:' keyword]. 2001-11-13 07:48:37 +00:00
Pavel Janík
830ddd7780 (access_keymap): Fix compilation error. 2001-11-07 08:47:21 +00:00
Richard M. Stallman
efb916453f (access_keymap): Don't use initializers on Lisp_Object. 2001-11-07 03:35:05 +00:00
Pavel Janík
b782650360 Update usage of CHECK_ macros (remove unused second argument). 2001-11-02 20:46:55 +00:00
Richard M. Stallman
36ca6189c6 (Fdescribe_buffer_bindings): Print character property
bindings along with or instead of the buffer local map.
Make the overriding maps override what they should.
2001-11-01 19:55:42 +00:00
Pavel Janík
13b1a09c3e (access_keymap): Remove unused variable `charset'. 2001-10-28 10:53:43 +00:00
Stefan Monnier
ef879104ac (current_minor_maps): `override' only shadows its
correspondent in minor-mode-map-alist, not the whole tail.
2001-10-18 22:14:45 +00:00
Ken Raeburn
f3fbd15535 Avoid (most) uses of XCAR/XCDR as lvalues, for flexibility in experimenting
with lisp system changes.
2001-10-16 09:09:51 +00:00
Stefan Monnier
845e4cf4d4 (access_keymap): Unify handling of `t' and generic-char.
If a parent is reached and noinherit is set, exit immediately.
Use AREF and ASIZE macros.  Call get_keyelt before checking KEYMAPP.
2001-10-14 22:45:14 +00:00
Stefan Monnier
2b6748c0ac (Fkey_description): Use empty_string.
(Fdescribe_bindings_internal, describe_buffer_bindings): Remove.
(syms_of_keymap): Setup inheritance between maps.
Don't export Sdescribe_bindings_internal any more.
2001-10-12 18:46:30 +00:00
Sam Steingold
0c4d9527dd current-active-maps: quote newlines 2001-10-08 13:33:20 +00:00
Stefan Monnier
8feddab4e0 Include keymap.h. 2001-10-08 11:39:52 +00:00
Stefan Monnier
54cbc3d4cd (Fkeymap_prompt, Fcurrent_active_maps): New funs.
(accessible_keymaps_1): New function.
(Faccessible_keymaps, accessible_keymaps_char_table): Use it.
(Fwhere_is_internal): Use Fcurrent_active_maps.
(Fdescribe_buffer_bindings): Renamed from describe_buffer_bindings.
Insert in current buffer rather than standard-output.
Don't call `help-mode'.  Export to elisp.
(describe_buffer_bindings): New wrapper.
(syms_of_keymap): Defsubr Skeymap_prompt, Scurrent_active_maps
and Sdescribe_buffer_bindings.
2001-10-08 09:47:10 +00:00
Gerd Moellmann
32c82ac0a1 Don't define min/max. 2001-10-08 08:08:08 +00:00
Gerd Moellmann
3ec6401d7b (access_keymap): Return the cdr of the binding of
a generic character instead of its definition (KEY . BINDING).
2001-08-24 08:42:35 +00:00
Gerd Moellmann
62b366ffb3 (access_keymap): Fix last change to not consider
IDX when it has modifiers.
2001-08-22 08:29:20 +00:00
Gerd Moellmann
859ea4b849 (access_keymap): If a binding of the form (GENERIC-CHAR
. BINDING) exists, where GENERIC-CHAR is the generic character of
the charset of IDX, return BINDING, unless there exists or binding
for IDX itself.
2001-08-21 10:42:27 +00:00
Gerd Moellmann
e15e282807 (Fsingle_key_description): NUL-terminate the string
buffer before calling build_string.
2001-05-29 14:09:54 +00:00
Gerd Moellmann
3d9d7a9b30 (Fsingle_key_description): Create a multibyte string
only if necessary.
2001-05-28 16:21:41 +00:00
Gerd Moellmann
d4ae91d2ce (Fsingle_key_description): Replace a build_string with
a make_multibyte_string.  From Kenichi Handa <handa@etl.go.jp>.
2001-05-16 10:49:21 +00:00
Stefan Monnier
fc18e5470d (Faccessible_keymaps): Pass `is_metized' to accessible_keymaps_char_table.
(accessible_keymaps_char_table): Obey `is_metized'.
(where_is_internal, Fwhere_is_internal): Don't confuse int and Lisp_Object.
2001-02-26 17:16:00 +00:00
Stefan Monnier
f58c64946e *** empty log message *** 2001-02-26 17:07:47 +00:00
Stefan Monnier
2ba11bbdcb (where_is_internal): Accept non-ascii integer prefixes. 2001-02-24 17:07:29 +00:00
Stefan Monnier
60dc655805 (Fwhere_is_internal): Use the first valid binding
if no ascii binding is found (when firstonly is t).
2001-01-31 15:19:30 +00:00
Gerd Moellmann
fdbbf26657 Undo last change. 2001-01-29 20:04:42 +00:00
Gerd Moellmann
341e4f2465 (mouse_key_p): New function.
(where_is_internal, Fwhere_is_internal): Use it.
2001-01-29 19:52:22 +00:00
Dave Love
0482803f6b (Fwhere_is_internal): Declare gcpro3, gcpro4. 2001-01-25 12:58:22 +00:00
Gerd Moellmann
f9aaedb634 (Fwhere_is_internal): Don't nreverse the cached
value in where_is_cache; the next lookup in the cache returns
something bogus if we do.
2001-01-24 19:42:17 +00:00
Gerd Moellmann
4956d1efe2 Call get_local_map with new argument list.
(Fwhere_is_internal): Rename parameter XKEYMAP to KEYMAP.
2001-01-12 11:19:36 +00:00
Gerd Moellmann
f1cb0a2584 (push_key_description): Add parameter FORCE_MULTIBYTE.
If set, print multibyte text.
(Fsingle_key_description): Call push_key_description with
FORCE_MULTIBYTE set.
(describe_buffer_bindings): Likewise.
2000-12-28 13:38:55 +00:00
Kenichi Handa
588fc8bdf0 (push_key_description): Don't convert eight-bit-control
and eight-bit-graphic to multibyte character.
2000-12-21 01:58:28 +00:00
Stefan Monnier
88416888aa (where_is_internal): Check ascii_sequence_p rather than
excluding menu-bar and tool-bar.
(Fwhere_is_internal): Check ascii_sequence_p when looking up the cache.
(menu_item_p): Remove.
(where_is_internal_1): Don't ignore menu-items.
2000-12-20 22:46:44 +00:00
Stefan Monnier
d5b3eb1b54 (get_keyelt): Only eval the filter if `autoload' is set. 2000-12-13 14:13:18 +00:00
Gerd Moellmann
6e80fddb98 (Fkey_description): If KEYS is an empty key sequence,
return an empty string.
2000-12-11 15:21:46 +00:00
Gerd Moellmann
ee89188f29 (current_minor_maps): Use malloc. Prevent a leak. 2000-12-08 09:58:28 +00:00
Ken Raeburn
ae0b9b4690 * undo.c (record_delete): Check that last_undo_buffer is really a buffer before
applying XBUFFER to it.

* keymap.c (where_is_internal): Pass lisp object, not integer, to Faref.
2000-10-27 23:01:20 +00:00
Stefan Monnier
020676925c * lisp.h (KEYMAPP): New macro.
(get_keymap): Remove.
(get_keymap_1): Rename get_keymap.
* keyboard.h (get_keymap_1, Fkeymapp): Remove prototype.
* xterm.c (note_mode_line_highlight): Use KEYMAPP.
* xmenu.c (single_submenu): Use KEYMAPP.
(Fx_popup_menu): Fetch keymaps rather than checking Fkeymapp.
Use KEYMAPP rather than Fkeymapp.
* w32term.c (note_mode_line_highlight): Use KEYMAPP.
* w32menu.c (True, False): Remove (use TRUE and FALSE instead).
(Fx_popup_menu): Fetch keymaps rather than checking Fkeymapp.
Use KEYMAPP rather than Fkeymapp.
(single_submenu): Use KEYMAPP.
(w32_menu_show, w32_dialog_show): Use TRUE.
* minibuf.c (Fread_from_minibuffer): Update call to get_keymap.
* keymap.c (KEYMAPP): Remove (moved to lisp.h).
(Fkeymapp): Use KEYMAPP.
(get_keymap): Rename from get_keymap_1.  Remove old def.
Return t when autoload=0 and error=0 and the keymap needs autoloading.
(Fcopy_keymap): Check (eq (car x) 'keymap) rather than using Fkeymapp.
(Fminor_mode_key_binding): Don't raise an error if the binding
is not a keymap.
(Fuse_global_map, Fuse_local_map): Allow autoloading.
(Faccessible_keymaps): Fetch keymaps rather than checking Fkeymapp.
* keyboard.c (read_char): get_keymap_1 -> get_keymap.
Allow Vspecial_event_map to be autoloaded.
(menu_bar_items): Fetch the keymap rather than using keymapp.
(menu_bar_one_keymap): No need to follow func-indirect any more.
(parse_menu_item): get_keymap_1 -> get_keymap.
(tool_bar_items): Fetch the keymap rather than using keymapp.
(read_key_sequence): Use KEYMAPP.
* intervals.c (get_local_map): Use get_keymap rather than following
function-indirections explicitly.
* doc.c (Fsubstitute_command_keys): get_keymap_1 -> get_keymap.
2000-10-27 22:20:19 +00:00
Stefan Monnier
1e7d1ab059 (where_is_cache, where_is_cache_keymaps): New vars.
(Fset_keymap_parent, store_in_keymap): Flush the where-is cache.
(where_is_internal): Renamed from Fwhere_is_internal.
Don't DEFUN any more. Arg `xkeymap' replaced by `keymaps'.
(Fwhere_is_internal): New function wrapping where_is_internal.
(where_is_internal_1): Handle the case where we're filling the cache.
(syms_of_keymap): Init and gcpro the where_is_cache(|_keymaps).
2000-10-25 23:35:21 +00:00