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: Drew Adams
Subject: RE: [External] : Q1 - the keys' bindings to work more widely
Date: Tue, 17 Dec 2024 00:05:00 +0000

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.

reply via email to

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