* override/delete translation of C-S-y?
@ 2021-06-09 22:18 Stephen Leake
2021-06-09 23:26 ` Stefan Monnier
2021-06-10 3:41 ` Phil Sainty
0 siblings, 2 replies; 5+ messages in thread
From: Stephen Leake @ 2021-06-09 22:18 UTC (permalink / raw)
To: emacs-devel
I'm trying to bind "\C-Y" to yank-from-kill-ring (I already have the
other modifies on C-y bound).
However, something is translating "\C-Y" to "\C-y"; according to the
elisp manual on translating keys, it's one of ‘input-decode-map’,
‘local-function-key-map’, or ‘key-translation-map’.
However, (lookup-key *-map "\C-Y") returns nil for all those maps, as
does (lookup-key *-map "\C-y").
I tried greping in the source to find where those keymaps are set, but I
did not find C-y.
How do I find the right key binding to override/delete?
--
-- Stephe
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: override/delete translation of C-S-y?
2021-06-09 22:18 override/delete translation of C-S-y? Stephen Leake
@ 2021-06-09 23:26 ` Stefan Monnier
2021-06-11 18:57 ` Stephen Leake
2021-06-10 3:41 ` Phil Sainty
1 sibling, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2021-06-09 23:26 UTC (permalink / raw)
To: Stephen Leake; +Cc: emacs-devel
> However, (lookup-key *-map "\C-Y") returns nil for all those maps, as
> does (lookup-key *-map "\C-y").
(equal "\C-y" "\C-Y") ==> t
I think you want something like [?\S-\C-y]
Stefan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: override/delete translation of C-S-y?
2021-06-09 22:18 override/delete translation of C-S-y? Stephen Leake
2021-06-09 23:26 ` Stefan Monnier
@ 2021-06-10 3:41 ` Phil Sainty
2021-06-10 3:44 ` Phil Sainty
1 sibling, 1 reply; 5+ messages in thread
From: Phil Sainty @ 2021-06-10 3:41 UTC (permalink / raw)
To: Stephen Leake; +Cc: emacs-devel
On 2021-06-10 10:18, Stephen Leake wrote:
> I'm trying to bind "\C-Y" to yank-from-kill-ring (I already have the
> other modifies on C-y bound).
>
> However, something is translating "\C-Y" to "\C-y"
The problem is that (AFAIR) those *are* the same thing.
(kbd "C-Y")
"^Y"
(kbd "C-y")
"^Y"
Such control characters have always been case-insensitive.
As it happens, you put the solution in your subject line:
(kbd "C-S-y")
[33554457]
That event wouldn't be sent in a terminal, but you should be able to
use it in GUI frames.
-Phil
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: override/delete translation of C-S-y?
2021-06-10 3:41 ` Phil Sainty
@ 2021-06-10 3:44 ` Phil Sainty
0 siblings, 0 replies; 5+ messages in thread
From: Phil Sainty @ 2021-06-10 3:44 UTC (permalink / raw)
To: Stephen Leake; +Cc: emacs-devel
I'll add that "(emacs)Modifier Keys" says:
A <Control>-modified alphabetical character is always considered
case-insensitive: Emacs always treats ‘C-A’ as ‘C-a’, ‘C-B’ as ‘C-b’,
and so forth. The reason for this is historical.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: override/delete translation of C-S-y?
2021-06-09 23:26 ` Stefan Monnier
@ 2021-06-11 18:57 ` Stephen Leake
0 siblings, 0 replies; 5+ messages in thread
From: Stephen Leake @ 2021-06-11 18:57 UTC (permalink / raw)
To: Stefan Monnier; +Cc: emacs-devel
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> However, (lookup-key *-map "\C-Y") returns nil for all those maps, as
>> does (lookup-key *-map "\C-y").
>
> (equal "\C-y" "\C-Y") ==> t
>
> I think you want something like [?\S-\C-y]
Thanks, that works:
(define-key global-map [?\S-\C-y] 'yank-from-kill-ring)
--
-- Stephe
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-06-11 18:57 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-09 22:18 override/delete translation of C-S-y? Stephen Leake
2021-06-09 23:26 ` Stefan Monnier
2021-06-11 18:57 ` Stephen Leake
2021-06-10 3:41 ` Phil Sainty
2021-06-10 3:44 ` Phil Sainty
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).