help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [External] : Q1 - the keys' bindings to work more widely


From: Yuri Khan
Subject: Re: [External] : Q1 - the keys' bindings to work more widely
Date: Tue, 17 Dec 2024 13:28:18 +0700

On Tue, 17 Dec 2024 at 12:42, Tatsu Takamaro <tatsu.takamaro@gmail.com> wrote:

> This one works:
>
>     *:keymap '(keymap (?a . kill-ring-save)))*
>
> But I'm not sure why.

You’re not actually supposed to type out keymaps in their internal
representation. Drew probably does that because he learned Emacs
before the introduction of key binding helper functions.

    (defvar ttkeys-mode-map
      (define-keymap
         "C-c" #'kill-ring-save
         "C-a" #'mark-whole-buffer))

    (define-minor-mode ttkeys-mode "Regular key bindings"
      :init-value t
      :lighter " TT"
      :global t
      :keymap ttkeys-mode-map)

(I must note that you’re in for a lot of swimming against the current
if you want to reclaim C-c from its established Emacs role as a
prefix. A lot of modes bind some of their functionality to sequences
starting with C-c, and you will either have to rebind them in order to
start using them, or they will wrest C-c back from you.)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]