emacs-devel
[Top][All Lists]
Advanced

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

Re: `special' keys in keyboard macros


From: Richard Stallman
Subject: Re: `special' keys in keyboard macros
Date: Sat, 11 Oct 2003 01:37:51 -0400

    When emacs runs in its own X window [for short: "emacs (X)"] I get
    the keyboard macro

    ;; "emacs (X)"
    (fset 'foo
       [return left right up down insert delete backspace])

    On the other hand "emacs -nw" gives me for the same key sequence

    ;; "emacs -nw"
    (fset 'bar
       "\C-m\C-[OD\C-[OC\C-[OA\C-[OB\C-[[2~\C-[[3~\C-?")

    The problem is: "emacs -nw" cannot make use of the keyboard macro
    foo and "emacs (X)" cannot make use of the macro bar either.

The cause of this problem is obvious; what's amazing is that I never
thought of it until you pointed it out.

It seems that a solution might be to do the processing through
function-key-map before recording keys in the keyboard macro.  I
looked at the code, and this is not trivial, so I won't try to write
it now.  I think it would take a bit of hard debugging to make this
work right in all cases.  Basically, you'd need to make
read_key_sequence remove, from the keyboard macro being defined, the
characters it reads, and then record the translated versions of them.

To be entirely correct, the characters you record should not have been
translated through key-translation-map, only through function-key-map.




reply via email to

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