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

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

Re: how to get Meta+y to be Meta+Tab


From: Xah
Subject: Re: how to get Meta+y to be Meta+Tab
Date: Mon, 27 Oct 2008 23:13:14 -0700 (PDT)
User-agent: G2/1.0

On Oct 26, 7:11 am, Nikolaj Schumacher <m...@nschum.de> wrote:
> Xah<xah...@gmail.com> wrote:
> > am pretty sure that global-set-key cannot be used for the
> > functionality of keyboard-translate.
>
> In a way it can.  You can bind it to a macro:
>
> (global-set-key "\M-y" "\M-\t")

Super. Thanks.

seems this still does not work well... For example, after i did that,
then in a text mode i have cursor at the end of “m” in “this form
that”. Then, pressing Alt+y gives me this error:

«After 0 kbd macro iterations: ispell-command-loop: Keyboard macro
terminated by a command ringing the bell»

but pressing Esc Tab does return a list of completion.

what i'm trying to do is to get command completion to some Meta
+‹letter› binding, because Alt+Tab is used by the OS to switch apps.
So, in the past 10 years i just used Esc Tab but that's 2
keystrokes...

The normal way of binding M-‹letter› to a command wont work well
because the command name varies depending on the mode. e.g. ispell-
complete-word, lisp-complete-word, etc.

> Using `keyboard-translate' is generally a little risky, because it will
> change the key in all places.  So people wouldn't be able to do use C-c M-y
> anymore.  So I would only use it to fix keyboard issues.

great advice.

> You can also write a function like this:
>
> (defun do-what-backspace-does ()
>   (interactive)
>   (call-interactively (key-binding "\C-?")))
>
> I've found that one to be the most reliable solution.

This won't work for my need above... but will try it out for other
uses. Thanks.

Andreas Politz wrote::
> (define-key key-translation-map [?\M-y] [?\M-\C-i])

this seems to work. Thanks.

  Xah
∑ http://xahlee.org/

reply via email to

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