[Top][All Lists]

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

Re: Proper way to add bindings under C-x 8

From: Robert Pluim
Subject: Re: Proper way to add bindings under C-x 8
Date: Thu, 02 Dec 2021 11:26:50 +0100

>>>>> On Tue, 30 Nov 2021 12:43:33 -0500, Howard Melman <> 
>>>>> said:

    >> I am? I donʼt feel like I have any grasp of it at all.

    Howard> I'd like to know.  The work-around posted doesn't bind
    Howard> things in all the places iso-tranl-define-keys does (only
    Howard> under C-x 8) and I find that code a bit opaque.

So the elisp manual says the following in "(elisp) Translation Keymaps"
(see especially that last sentence)

       Translation keymaps have the same structure as other keymaps, but are
    used differently: they specify translations to make while reading key
    sequences, rather than bindings for complete key sequences.  As each key
    sequence is read, it is checked against each translation keymap.  If one
    of the translation keymaps binds K to a vector V, then whenever K
    appears as a sub-sequence _anywhere_ in a key sequence, that
    sub-sequence is replaced with the events in V.

"event_s_ in V."

Later in the same node:

       You can use ‘input-decode-map’, ‘local-function-key-map’, and
    ‘key-translation-map’ for more than simple aliases, by using a function,
    instead of a key sequence, as the translation of a key.  Then this
    function is called to compute the translation of that key.

"instead of a key _sequence_"

So Iʼd expect the following

(define-key iso-transl-ctl-x-8-map "ef" (vector #x2660 #x2660))

to allow me to use C-x 8 e f to insert U+2660 twice, but it only
inserts it once. What am I missing?

(emacs-master, although I doubt that matters)


reply via email to

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