From: Tatsu Takamaro <tatsu.takamaro@gmail.com>
To: Drew Adams <drew.adams@oracle.com>,
"help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: Re: [External] : Q1 - the keys' bindings to work more widely
Date: Tue, 17 Dec 2024 03:16:21 +0300 [thread overview]
Message-ID: <f81e3e26-e61a-9817-b72c-7b3a4e360523@gmail.com> (raw)
In-Reply-To: <DS7PR10MB5232EA4BF74317040F89088FF3042@DS7PR10MB5232.namprd10.prod.outlook.com>
>> You can't bind non-interactive functions to keys.
But I rebound globally and this works:
*(keymap-global-unset "C-c")**
**(keymap-global-set "C-c" #'kill-ring-save)*
*
*
*
*
>> This is a keymap: '(keymap ("a" . #'kill-ring-save)))
Do you mean this:
*(define-minor-mode ttkeys-mode "Normal key bindings"**
**:init-value 1 :lighter " TT" :global 1**
**:keymap**
**'(keymap ("a" . #'kill-ring-save)))*
Doesn't work either.
вт, 17.12.2024 3:05, Drew Adams пишет:
> Reformatting...
> ___
>
> Below.
>
>> 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 of C-c
>> followed 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.
> A user can use any keys s?he likes. That Elisp convention tells you which
> keys are reserved for users. Other keys (not reserved for users) are
> likely to have bindings provided by Emacs or packages, so if you bind
> them to different keys you might change some behavior. That's all - just
> useful to know, for users too.
>
>> 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)
>> )
>> )
> This isn't a keymap: '(("a" . #'kill-ring-save)))
>
> (keymapp '(("a" . #'kill-ring-save))) ; returns nil
>
> This is a keymap: '(keymap ("a" . #'kill-ring-save)))
>
> (keymapp '(keymap ("a" . #'kill-ring-save))) ; returns t
>
>> Well, this variant doesn't work either. I get the message: "Wrong type
>> argument: commandp, #'kill-ring-save"
> Yes, that too. You can't bind non-interactive functions to keys.
next prev parent reply other threads:[~2024-12-17 0:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-14 23:46 Q1 - the keys' bindings to work more widely Tatsu Takamaro
2024-12-15 2:15 ` [External] : " Drew Adams
2024-12-16 23:11 ` Tatsu Takamaro
2024-12-16 23:55 ` Drew Adams via Users list for the GNU Emacs text editor
2024-12-17 0:05 ` Drew Adams
2024-12-17 0:16 ` Tatsu Takamaro [this message]
2024-12-17 2:17 ` Drew Adams
2024-12-17 5:41 ` Tatsu Takamaro
2024-12-17 6:28 ` Yuri Khan
2024-12-17 5:42 ` Tatsu Takamaro
2024-12-15 10:05 ` Alain.Cochard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f81e3e26-e61a-9817-b72c-7b3a4e360523@gmail.com \
--to=tatsu.takamaro@gmail.com \
--cc=drew.adams@oracle.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).