diff options
| author | Stefan Kangas | 2020-10-17 20:55:04 +0200 |
|---|---|---|
| committer | Stefan Kangas | 2020-10-18 17:23:28 +0200 |
| commit | afd31f9e62e551a3f286d1d581a56ef1de33ee94 (patch) | |
| tree | 7e537c7add3341d97efabf229f70e88f336d4383 /src | |
| parent | dcf9cd47ae71e39eb616d77acb531ac11357391f (diff) | |
| download | emacs-afd31f9e62e551a3f286d1d581a56ef1de33ee94.tar.gz emacs-afd31f9e62e551a3f286d1d581a56ef1de33ee94.zip | |
Translate describe_map_tree to Lisp
This is the second step in converting substitute-command-keys to Lisp.
* lisp/help.el (describe-map-tree): New Lisp version of
describe_map_tree.
(substitute-command-keys): Update to use above function.
* src/keymap.c (Fdescribe_map): New defun to expose describe_map to
Lisp.
* src/keymap.c (syms_of_keymap): New variable 'help--keymaps-seen'; a
temporary kludge planned for removal. New defsubr for Fdescribe_map.
Diffstat (limited to 'src')
| -rw-r--r-- | src/keymap.c | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/src/keymap.c b/src/keymap.c index 05b0814c475..704b89eeecc 100644 --- a/src/keymap.c +++ b/src/keymap.c | |||
| @@ -2915,7 +2915,7 @@ You type Translation\n\ | |||
| 2915 | 2915 | ||
| 2916 | Any inserted text ends in two newlines (used by `help-make-xrefs'). */ | 2916 | Any inserted text ends in two newlines (used by `help-make-xrefs'). */ |
| 2917 | 2917 | ||
| 2918 | DEFUN ("describe-map-tree", Fdescribe_map_tree, Sdescribe_map_tree, 1, 8, 0, | 2918 | DEFUN ("describe-map-tree-old", Fdescribe_map_tree_old, Sdescribe_map_tree_old, 1, 8, 0, |
| 2919 | doc: /* This is just temporary. */) | 2919 | doc: /* This is just temporary. */) |
| 2920 | (Lisp_Object startmap, Lisp_Object partial, Lisp_Object shadow, | 2920 | (Lisp_Object startmap, Lisp_Object partial, Lisp_Object shadow, |
| 2921 | Lisp_Object prefix, Lisp_Object title, Lisp_Object nomenu, | 2921 | Lisp_Object prefix, Lisp_Object title, Lisp_Object nomenu, |
| @@ -3131,6 +3131,27 @@ describe_map_compare (const void *aa, const void *bb) | |||
| 3131 | return 0; | 3131 | return 0; |
| 3132 | } | 3132 | } |
| 3133 | 3133 | ||
| 3134 | DEFUN ("describe-map", Fdescribe_map, Sdescribe_map, 1, 7, 0, | ||
| 3135 | doc: /* This is a temporary definition preparing the transition | ||
| 3136 | of this function to Lisp. */) | ||
| 3137 | (Lisp_Object map, Lisp_Object prefix, | ||
| 3138 | Lisp_Object transl, Lisp_Object partial, Lisp_Object shadow, | ||
| 3139 | Lisp_Object nomenu, Lisp_Object mention_shadow) | ||
| 3140 | { | ||
| 3141 | ptrdiff_t count = SPECPDL_INDEX (); | ||
| 3142 | |||
| 3143 | bool b_transl = NILP(transl) ? false : true; | ||
| 3144 | bool b_partial = NILP (partial) ? false : true; | ||
| 3145 | bool b_nomenu = NILP (nomenu) ? false : true; | ||
| 3146 | bool b_mention_shadow = NILP (mention_shadow) ? false : true; | ||
| 3147 | describe_map (map, prefix, | ||
| 3148 | b_transl ? describe_translation : describe_command, | ||
| 3149 | b_partial, shadow, &Vhelp__keymaps_seen, | ||
| 3150 | b_nomenu, b_mention_shadow); | ||
| 3151 | |||
| 3152 | return unbind_to (count, Qnil); | ||
| 3153 | } | ||
| 3154 | |||
| 3134 | /* Describe the contents of map MAP, assuming that this map itself is | 3155 | /* Describe the contents of map MAP, assuming that this map itself is |
| 3135 | reached by the sequence of prefix keys PREFIX (a string or vector). | 3156 | reached by the sequence of prefix keys PREFIX (a string or vector). |
| 3136 | PARTIAL, SHADOW, NOMENU are as in `describe_map_tree' above. */ | 3157 | PARTIAL, SHADOW, NOMENU are as in `describe_map_tree' above. */ |
| @@ -3685,6 +3706,10 @@ exists, bindings using keys without modifiers (or only with meta) will | |||
| 3685 | be preferred. */); | 3706 | be preferred. */); |
| 3686 | Vwhere_is_preferred_modifier = Qnil; | 3707 | Vwhere_is_preferred_modifier = Qnil; |
| 3687 | where_is_preferred_modifier = 0; | 3708 | where_is_preferred_modifier = 0; |
| 3709 | DEFVAR_LISP ("help--keymaps-seen", Vhelp__keymaps_seen, | ||
| 3710 | doc: /* List of seen keymaps. | ||
| 3711 | This is used for internal purposes only. */); | ||
| 3712 | Vhelp__keymaps_seen = Qnil; | ||
| 3688 | 3713 | ||
| 3689 | DEFSYM (Qmenu_bar, "menu-bar"); | 3714 | DEFSYM (Qmenu_bar, "menu-bar"); |
| 3690 | DEFSYM (Qmode_line, "mode-line"); | 3715 | DEFSYM (Qmode_line, "mode-line"); |
| @@ -3739,7 +3764,8 @@ be preferred. */); | |||
| 3739 | defsubr (&Scurrent_active_maps); | 3764 | defsubr (&Scurrent_active_maps); |
| 3740 | defsubr (&Saccessible_keymaps); | 3765 | defsubr (&Saccessible_keymaps); |
| 3741 | defsubr (&Skey_description); | 3766 | defsubr (&Skey_description); |
| 3742 | defsubr (&Sdescribe_map_tree); | 3767 | defsubr (&Sdescribe_map_tree_old); |
| 3768 | defsubr (&Sdescribe_map); | ||
| 3743 | defsubr (&Sdescribe_vector); | 3769 | defsubr (&Sdescribe_vector); |
| 3744 | defsubr (&Ssingle_key_description); | 3770 | defsubr (&Ssingle_key_description); |
| 3745 | defsubr (&Stext_char_description); | 3771 | defsubr (&Stext_char_description); |