* binding a key for keyword completion in all modes
@ 2009-02-26 2:20 Xah Lee
2009-02-26 3:01 ` David Golden
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Xah Lee @ 2009-02-26 2:20 UTC (permalink / raw)
To: help-gnu-emacs
this is a problem that annoys me, i wonder how you guys solve it.
the default shortcut for completion is Meta+Tab. However, that key is
after Alt+Tab, and in Mac and Windows and Linux, that combo is taken
by OS to switch apps. (i don't want to have emacs override that)
What i have always been doing is pressing Esc then Tab, but that is
really annoying, especially if you use this often.
How do you solve this?
also, how to bind a key to completion in any lang's mode? the problem
for me is, each lang mode usually uses a different name for
completion, e.g. lisp-complete-symbol, python-complete-symbol, etc. Is
there a way to solve this? Must i add hook to every mode?
Thanks.
Xah
∑ http://xahlee.org/
☄
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: binding a key for keyword completion in all modes
2009-02-26 2:20 binding a key for keyword completion in all modes Xah Lee
@ 2009-02-26 3:01 ` David Golden
2009-02-26 8:13 ` Tassilo Horn
2009-02-26 19:58 ` Marc Tfardy
2 siblings, 0 replies; 8+ messages in thread
From: David Golden @ 2009-02-26 3:01 UTC (permalink / raw)
To: help-gnu-emacs
Xah Lee wrote:
> (i don't want to have emacs override that)
>
> What i have always been doing is pressing Esc then Tab, but that is
> really annoying, especially if you use this often.
>
> How do you solve this?
>
On my own systems I use super-tab for app switching* and therefore let
emacs have alt-tab, but on occasion it helps to know that C-M-i
typically works the same in emacs - C-i being conventionally a tab
character of course, but OS / window manager level stuff tends not to
grab it like the tab key.
* I tend to place "system-wide" window manager shortcuts consistently on
super-<something> rather than the horrible defaults that can get in the
way of emacs use.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: binding a key for keyword completion in all modes
2009-02-26 2:20 binding a key for keyword completion in all modes Xah Lee
2009-02-26 3:01 ` David Golden
@ 2009-02-26 8:13 ` Tassilo Horn
[not found] ` <87skm012ln.fsf@mundaneum.com>
2009-02-26 19:58 ` Marc Tfardy
2 siblings, 1 reply; 8+ messages in thread
From: Tassilo Horn @ 2009-02-26 8:13 UTC (permalink / raw)
To: help-gnu-emacs
Xah Lee <xahlee@gmail.com> writes:
Hi Xah,
> the default shortcut for completion is Meta+Tab. However, that key is
> after Alt+Tab, and in Mac and Windows and Linux, that combo is taken
> by OS to switch apps. (i don't want to have emacs override that)
>
> What i have always been doing is pressing Esc then Tab, but that is
> really annoying, especially if you use this often.
>
> How do you solve this?
I reverve super-* for window manager keys, so emacs can use very C and M
binding. I don't know if that's possible on windows and mac, too.
> also, how to bind a key to completion in any lang's mode? the problem
> for me is, each lang mode usually uses a different name for
> completion, e.g. lisp-complete-symbol, python-complete-symbol, etc.
I think it's more or less a convention that each language mode binds its
symbol completion command to M-TAB.
> Is there a way to solve this?
Maybe something like this will do the trick?
(global-set-key (kbd "C-TAB")
(lambda () (key-binding (kbd "M-TAB")))
Now when you hit C-TAB the command normally bound to M-TAB will be
called.
Bye,
Tassilo
--
When Richard Stallman pipes to more, he gets less
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: binding a key for keyword completion in all modes
2009-02-26 2:20 binding a key for keyword completion in all modes Xah Lee
2009-02-26 3:01 ` David Golden
2009-02-26 8:13 ` Tassilo Horn
@ 2009-02-26 19:58 ` Marc Tfardy
2 siblings, 0 replies; 8+ messages in thread
From: Marc Tfardy @ 2009-02-26 19:58 UTC (permalink / raw)
To: help-gnu-emacs
Xah Lee schrieb:
> this is a problem that annoys me, i wonder how you guys solve it.
>
> the default shortcut for completion is Meta+Tab. However, that key is
> after Alt+Tab, and in Mac and Windows and Linux, that combo is taken
> by OS to switch apps. (i don't want to have emacs override that)
>
> What i have always been doing is pressing Esc then Tab, but that is
> really annoying, especially if you use this often.
>
> How do you solve this?
On windows you can use:
(w32-register-hot-key [A-tab])
and M-TAB do completion in Emacs.
I start Emacs in "normal" behavior, so ALT-TAB do task switch, but
in my .emacs I have this small piece of code:
;; Disable Alt+Tab as task switch with ESC C-TAB
(define-key esc-map (kbd "C-<tab>")
(lambda ()
(interactive)
(message "ALT-TAB task switch disabled.")
(w32-register-hot-key [A-tab])))
If required I press "ESC C-TAB" and Emacs take over the M-TAB (ALT-TAB).
Windows task switch works still with ALT-ESC (but in slightly
another way).
regards
Marc
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2009-03-04 23:17 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-26 2:20 binding a key for keyword completion in all modes Xah Lee
2009-02-26 3:01 ` David Golden
2009-02-26 8:13 ` Tassilo Horn
[not found] ` <87skm012ln.fsf@mundaneum.com>
[not found] ` <87r61j62k0.fsf@thinkpad.tsdh.de>
[not found] ` <58e57903-4b47-443c-b84d-e41662071482@e36g2000prg.googlegroups.com>
[not found] ` <87ocwkavg0.fsf@thinkpad.tsdh.de>
2009-03-03 23:35 ` Xah Lee
2009-03-04 12:04 ` TomSW
2009-03-04 22:18 ` Xah Lee
2009-03-04 23:17 ` TomSW
2009-02-26 19:58 ` Marc Tfardy
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.