help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: elisp question:keyboard-translate with hyper fail?


From: Xah Lee
Subject: Re: elisp question:keyboard-translate with hyper fail?
Date: Fri, 11 Mar 2011 23:22:14 -0800 (PST)
User-agent: G2/1.0

ugh, just tried this and still doesn't work.

(define-key key-translation-map [?\H-8] ?\◇)

am giving up at this point.

in case anyone's interested, i'm trying to make hyper key do unicode
symbols.
Ι have it all working by
(global-set-key (kbd "H-3") (lambda () (interactive) (insert "•"))) ;
bullet

but yesterday i got smart and thought i'll re-write them using
keyboard-translate instead. (just had a major refactoring of
my .emacs.)

possibly i'll file a bug report. Thanks for the helpful answers.

 Xah

On Mar 11, 11:07 pm, Xah Lee <xah...@gmail.com> wrote:
> On Mar 11, 6:54 pm, Stefan Monnier <monn...@iro.umontreal.ca> wrote:
>
> > > ;; Swap “Ctrl+x” and “Ctrl+t”, so it's easier to type on Dvorak layout
> > > (keyboard-translate ?\C-t ?\C-x)
> > > (keyboard-translate ?\C-x ?\C-t)
>
> > There are 32 Ctrl+letter combinations which are characters, and the
> > above two are among them.  These are exceptional special cases due
> > to history.  My general recommendation is to not use keyboard-translate
> > but key-translation-map or function-key-map, which work on arbitrary
> > key sequences rather only on single-char events.
>
> >         Stefan
>
> thanks to all.
>
> perhaps the doc can be improved.
>
> i just read up the elisp doc and it actually gives a C- example.
>
>  -- Function: keyboard-translate from to
>      This function modifies `keyboard-translate-table' to translate
>      character code FROM into character code TO.  It creates the
>      keyboard translate table if necessary.
>
>    Here's an example of using the `keyboard-translate-table' to make
> `C-x', `C-c' and `C-v' perform the cut, copy and paste operations:
>
>      (keyboard-translate ?\C-x 'control-x)
>      (keyboard-translate ?\C-c 'control-c)
>      (keyboard-translate ?\C-v 'control-v)
>      (global-set-key [control-x] 'kill-region)
>      (global-set-key [control-c] 'kill-ring-save)
>      (global-set-key [control-v] 'yank)
>
> also note it uses the syntax 「'control-x」. I don't quite understand
> it...
>
> should it be a bug report?
>
>  Xah



reply via email to

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