[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: custom keyboard layout? howto redefine keys?
From: |
nic . d . m . 1 |
Subject: |
Re: custom keyboard layout? howto redefine keys? |
Date: |
Fri, 10 Apr 2009 03:18:12 -0700 (PDT) |
User-agent: |
G2/1.0 |
Thank you very much! I "mixed" your solutions and it worked:
(global-set-key "b" (lambda () (interactive) (ucs-insert "61")))
(global-set-key "a" (lambda () (interactive) (ucs-insert "62")))
Any idea *why* this works? I don't understand it. What is the meaning
of "interactive" here?
By the way: Is there a possibility to reload the .emacs file without
restarting emacs?
I tried: M-x load-file .emacs but it doesn't work.
On 10 Apr., 11:25, "B. T. Raven" <ni...@nihilo.net> wrote:
> nic.d....@googlemail.com wrote:
> > Is there a way to customize the keyboard layout within emacs? For
> > example if I want "the key on my keyboard labeled 'a' behave like
> > that labeled 'b' I think the code for my .emacs file should be
> > something like this:
>
> > (global-set-key ["Key labeled 'a' on my keyboard"] 'ucs-insert0062)
>
> > I am new to emacs and don't know what the correct syntax for "Key
> > labeled 'a' on my keyboard' could be.
>
> > So I tried to make f5instead behave like b:
>
> > (global-set-key [f5] 'ucs-insert0062)
>
> > Then I get an error message: "Wrong type argument: commandp, (ucs-
> > insert62)" if I restart emacs and press f5.
>
> > (For example (global-set-key [f1] 'ucs-insert) works, but then it
> > asks which UTF-8character I want to insert, that's not what I want)
>
> > Any ideas?
>
> (global-set-key [f5] (lambda () (interactive) (ucs-insert "62")))
>
> ucs-insert seems to want a string;
>
> for your original question you could also do this:
>
> (global-set-key "a" "b")
>
> but you will immediately regret it, since now you won't be able to type
> the letter a, for example to assign it to another key. At least I
> couldn't figure out how to undo the damage and I had to re-start Emacs.
>