From: Juanma <juanma_bellon@yahoo.es>
To: help-gnu-emacs@gnu.org
Subject: Re: remapping keys
Date: Wed, 20 Feb 2008 03:12:34 +0100 [thread overview]
Message-ID: <200802200312.34753.juanma_bellon@yahoo.es> (raw)
In-Reply-To: <87skzompr3.fsf@nospam.please.ucdavis.edu>
On Wednesday 20 February 2008 01:32, Sam Peterson wrote:
> Wow, a whole thread on remapping keys, and NOBODY mentions
> global-set-key or local-set-key.
>
> ;; just an example, change the keys to whatever you like
> (global-set-key "{" '(lambda () (interactive) (insert "a")))
>
> Many will argue that keyboard translate is better. Whatever works...
I thought of it but I rejected it because the point is not just to get a curly
bracket inserted in the text, but also to use it in keystrokes, which I guess
can't be done with that lambda form. I can't figure any other way to do it
than keyboard-translate. Involving only Emacs in the solution, that is.
Sadly, no approach solves the problem. Neither the above lambda form, nor
keyboard-translate¹, nor define-key² provide a substitution of keys
throughout the whole Emacs cathedral: in keystrokes the original key still
applies.
¹: (keyboard-translate ?. ?/)
²: (define-key global-map (kbd ".") (kbd "/"))
In any of these cases, asking for the command mapped to M-. will give exactly
that, not the command mapped to M-/ as intended.
It is still possible to re-map *all* keystrokes using curly brackets to make
them use something more comfortable, but ... well, no way.
Juanma
next prev parent reply other threads:[~2008-02-20 2:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-18 11:35 remapping keys Seldon
2008-02-18 16:14 ` Stefan Monnier
2008-02-18 17:00 ` Seldon
2008-02-18 19:04 ` muede73
2008-02-25 10:45 ` Seldon
2008-02-19 2:01 ` Juanma
[not found] ` <mailman.7615.1203400883.18990.help-gnu-emacs@gnu.org>
2008-02-19 16:33 ` Seldon
2008-02-20 0:32 ` Sam Peterson
2008-02-20 2:12 ` Juanma [this message]
2008-02-20 19:53 ` Stefan Monnier
2008-02-27 20:29 ` Hans Ekbrand
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=200802200312.34753.juanma_bellon@yahoo.es \
--to=juanma_bellon@yahoo.es \
--cc=help-gnu-emacs@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.
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).