unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Richard Stallman <rms@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: `special' keys in keyboard macros
Date: Sat, 11 Oct 2003 01:37:51 -0400	[thread overview]
Message-ID: <E1A8CRr-0001Hp-Kc@fencepost.gnu.org> (raw)
In-Reply-To: <16257.16532.727889.658851@tfkp07.physik.uni-erlangen.de> (message from Roland Winkler on Mon, 6 Oct 2003 12:14:44 +0200)

    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	other threads:[~2003-10-11  5:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <16257.16532.727889.658851@tfkp07.physik.uni-erlangen.de>
2003-10-11  5:37 ` Richard Stallman [this message]
2003-10-14 21:21   ` `special' keys in keyboard macros Stefan Monnier
2003-10-15 20:00     ` Richard Stallman
2003-10-15 21:27       ` Kim F. Storm
2003-10-16 10:18         ` Roland Winkler
2003-10-16 12:36           ` Robert J. Chassell
2003-10-16 23:07           ` Richard Stallman

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=E1A8CRr-0001Hp-Kc@fencepost.gnu.org \
    --to=rms@gnu.org \
    --cc=emacs-devel@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.
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).