|
From: | Tatsu Takamaro |
Subject: | Re: [External] : Q1 - the keys' bindings to work more widely |
Date: | Tue, 17 Dec 2024 02:11:45 +0300 |
User-agent: | Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 |
See also the Emacs manual (`C-h r'), node `CUA Bindings'.
As I told: "Don't offer a CUA mode, I know about it, but it doesn't meet my needs."
I've read conventions, but did not find any answer to my questions. The only thing that may be close to it is about "Sequences consisting ofC-cfollowed by...", but it is irrelevant because 1) My "C-c" is not followed by anything, 2) I don't make any plugin for other users, I just try to set Emacs _for myself_. All the World uses Ctrl + c for copy, so the whole world would not sag under one program.
Anyway, my question here is why the key bindings in my minor mode don't work. Is there some syntax mistake? Lets' for example change them to others:
(define-minor-mode ttkeys-mode "Normal key bindings" :init-value 1 :lighter " TT" :global 1 :keymap '( ("a" . #'kill-ring-save) ) )Well, this variant doesn't work either. I get the message: "Wrong type argument: commandp, #'kill-ring-save"
вс, 15.12.2024 5:15, Drew Adams пишет:
I would like to have my keys (my bindings) working more widely so that I could trust them more. But for now some of them don't work. E. g. in a Help buffer C-c doesn't work as a copy action (though it works globally as I set). And this is not surprising. I understand that major modes have priority over the global one. What is the best idea to make my keys more reliable? One way is to change all the major and minor modes, but it's a big load of work and code. Another way is to create my own minor mode key bindings and make it be turned on by default, and I managed to find how it should be done ("init-value" and "global" should be non-nil, in the "define-minor-mode" call). So I hope I'm somewhere close to the solution. Here is my function call with an example of C-c rebinding: (define-minor-mode ttkeys-mode "My key bindings" :init-value 1 :lighter " TT" :global 1 :keymap '( ("C-c" . #'kill-ring-save) ("C-a" . #'mark-whole-buffer) ) ) The TT mode is being shown normally, I can switch in on and off, but the C-c and C-a don't work as I told them to. I tried to vary signs like # and ', but no result. What am I doing wrong? And, maybe there is some other advice that you could give to make my keys more reliable (make them work everywhere in Emacs)? Don't offer a CUA mode, I know about it, but it doesn't meet my needs.See node `Key Binding Conventions' in the Elisp manual: https://www.gnu.org/software/emacs/manual/html_node/elisp/Key-Binding-Conventions.html That's `C-h i m elisp RET', then `g key binding conventions RET'. See also the Emacs manual (`C-h r'), node `CUA Bindings'.
[Prev in Thread] | Current Thread | [Next in Thread] |