all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Remapping keys and creating my own keymap \\ too complicated\\
@ 2024-12-03 16:59 Tatsu Takamaro
  2024-12-04  7:43 ` Jean Louis
  2024-12-04 16:25 ` Jean Louis
  0 siblings, 2 replies; 18+ messages in thread
From: Tatsu Takamaro @ 2024-12-03 16:59 UTC (permalink / raw)
  To: help-gnu-emacs

Good afternoon, I'm trying to reassign keys but have run into a number 
of difficulties and questions about the best way to do it and how to do 
it correctly.
1. Do I understand correctly that if I want to change hotkeys, the most 
logical, sensible and ‘beautiful’ way to do it is to create my own key 
map? That is, I create key mappings to commands, save it all in a file, 
and then just plug that map in instead of the default one (via the 
appropriate command in the ‘.emacs’ file). This seems like a more proper 
way, better than making changes to the default key map. Right?

2. Your original manual has a lot of complicated text on this topic. I 
honestly tried to figure it out on my own, though. However, I eventually 
found an article that explains in simple words how to do it. Here is 
that article: 
https://emacspal.com/extending-emacs-functionally-with-user-defined-keymaps/
However, I saw a large number of differences between the article and 
your official documentation. I already wrote to Emacs Pal (the authors 
of the article), but they haven't replied for a week now. On the one 
hand, the article is clear, but the syntax of the commands does not 
match your documentation on many points.

For example, here they describe the define-keymap command:
*
**(define-keymap my-map**
**  "Binding description."**
**  :bind (("C-c C-a" . select-all)**
**         ("C-c C-f" . find-file)))*

And here's an example from the official docs:
*
**         (define-keymap :full t**
**  "g" #'eww-reload**
**  :menu '("Eww"**
**          ["Exit" quit-window t]**
**          ["Reload" eww-reload t]))*

Huge difference. For example: 1) you don't specify the name of the 
keymap right after define-keymap. How do you plan to call it later, if 
not by name? And Emacs itself does not provide the name of the map in 
the command description either. 2) they probably have a description 
after the map name (line ‘Binding description.’), but official syntax 
does not provide any description in this place. 3) further they have the 
:bind key, which is also not officially provided. And other things, as 
you can see from the examples.
Thus, I am even more confused.

3. So how do I create my key map correctly (in simple words)? I need a 
global map to replace the default one. But I don't want to prescribe all 
combinations at all, but only those that I want to set my own. The rest 
of the combinations should remain as in the default one.


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2024-12-09 22:34 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-03 16:59 Remapping keys and creating my own keymap \\ too complicated\\ Tatsu Takamaro
2024-12-04  7:43 ` Jean Louis
2024-12-04 15:49   ` Tatsu Takamaro
2024-12-04 15:55   ` Tatsu Takamaro
2024-12-04 16:06     ` Robert Pluim
2024-12-04 16:37       ` Tatsu Takamaro
2024-12-04 16:40         ` Robert Pluim
2024-12-04 17:05           ` Tatsu Takamaro
2024-12-05 10:25             ` Robert Pluim
2024-12-05 18:08               ` Tatsu Takamaro
2024-12-06  9:57                 ` Robert Pluim
2024-12-06 10:38                   ` Jean Louis
2024-12-06 13:18                     ` Robert Pluim
2024-12-08 16:16                       ` Tatsu Takamaro
2024-12-08 23:07                         ` Stephen Berman
2024-12-09 22:34                           ` Tatsu Takamaro
2024-12-04 16:25 ` Jean Louis
2024-12-04 16:57   ` Tatsu Takamaro

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.