* How can I set a different key binding to minibuffer?
@ 2003-05-09 1:12 Wang Yin
2003-05-09 13:18 ` Joakim Hove
2003-05-10 14:34 ` Kai Großjohann
0 siblings, 2 replies; 5+ messages in thread
From: Wang Yin @ 2003-05-09 1:12 UTC (permalink / raw)
Hi,
I'm trying to bind a function named my-indent-or-complete to TAB.
(defun my-indent-or-complete ()
"hippie-expand, if we are at word boundary, indent otherwise"
(interactive)
(if (looking-at "\\>")
(hippie-expand nil)
(indent-for-tab-command)
))
(global-set-key [(tab)] 'my-indent-or-complete)
(setq hippie-expand-try-functions-list
'(try-expand-dabbrev-visible
try-expand-dabbrev
try-expand-dabbrev-all-buffers
try-expand-dabbrev-from-kill
try-complete-file-name-partially
try-complete-file-name
try-expand-all-abbrevs
try-expand-list
try-expand-line
try-complete-lisp-symbol-partially
try-complete-lisp-symbol))
But when I partially typed a M-x commands in my minibuffer, I want to
TAB to complete it. But TAB is hippie-expand'ing! I want no expand in
my minibuffer. How can I do that?
Can I have a different key binding in the minibuffer? How do I set it?
Or can I have a different local variable
hippie-expand-try-functions-list in my minibuffer?
Thanks.
--
Wang Yin
DA Lab, Tsinghua University,
100084
Beijing China
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: How can I set a different key binding to minibuffer?
2003-05-09 1:12 How can I set a different key binding to minibuffer? Wang Yin
@ 2003-05-09 13:18 ` Joakim Hove
2003-05-10 2:34 ` wang yin
2003-05-10 14:34 ` Kai Großjohann
1 sibling, 1 reply; 5+ messages in thread
From: Joakim Hove @ 2003-05-09 13:18 UTC (permalink / raw)
Wang Yin <wang-y01@mails.tsinghua.edu.cn> writes:
> Can I have a different key binding in the minibuffer? How do I set it?
> Or can I have a different local variable
> hippie-expand-try-functions-list in my minibuffer?
Try:
(define-key 'minibuffer-local-map [(tab)] 'minibuffer-complete)
[There are some other minibuffer maps as well:
M-x apropos ^minibuffer.*map
you might have to define keys for them as well?]
Joakim
--
Joakim Hove / hove@ii.uib.no / (55 5) 84076
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: How can I set a different key binding to minibuffer?
2003-05-09 13:18 ` Joakim Hove
@ 2003-05-10 2:34 ` wang yin
2003-05-12 17:51 ` Kevin Rodgers
0 siblings, 1 reply; 5+ messages in thread
From: wang yin @ 2003-05-10 2:34 UTC (permalink / raw)
I set this key in the minibuffer. But this scheme just can't work
properly.
M-x loa TAB
in the minibuffer will be expand into "load-path". Which is not what I
wanted.
I'm not good at elisp. Can you give a conditional clause that can only
change keybinds in buffers other than the minibuffer?
Thanks.
--
Wang Yin
DA Lab, Tsinghua University,
100084
Beijing China
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: How can I set a different key binding to minibuffer?
2003-05-10 2:34 ` wang yin
@ 2003-05-12 17:51 ` Kevin Rodgers
0 siblings, 0 replies; 5+ messages in thread
From: Kevin Rodgers @ 2003-05-12 17:51 UTC (permalink / raw)
wang yin wrote:
> I set this key in the minibuffer. But this scheme just can't work
> properly.
>
> M-x loa TAB
>
> in the minibuffer will be expand into "load-path". Which is not what I
> wanted.
>
> I'm not good at elisp. Can you give a conditional clause that can only
> change keybinds in buffers other than the minibuffer?
The minibuffer has its own keymaps (M-x apropos RET minibuffer.*map RET),
so defining a key that's already bound in the minibuffer in the global keymap
shouldn't affect the minibuffer.
If you want to change a key's behavior in the minibuffer, rebind it in the
relevant minibuffer keymaps.
--
<a href="mailto:<kevin.rodgers@ihs.com>">Kevin Rodgers</a>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: How can I set a different key binding to minibuffer?
2003-05-09 1:12 How can I set a different key binding to minibuffer? Wang Yin
2003-05-09 13:18 ` Joakim Hove
@ 2003-05-10 14:34 ` Kai Großjohann
1 sibling, 0 replies; 5+ messages in thread
From: Kai Großjohann @ 2003-05-10 14:34 UTC (permalink / raw)
Wang Yin <wang-y01@mails.tsinghua.edu.cn> writes:
> (global-set-key [(tab)] 'my-indent-or-complete)
(global-set-key (kbd "TAB") 'my-indent-or-complete)
I should really write some boilerplate text that explains about
Emacs' pseudo function keys...
--
file-error; Data: (Opening input file no such file or directory ~/.signature)
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2003-05-12 17:51 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-09 1:12 How can I set a different key binding to minibuffer? Wang Yin
2003-05-09 13:18 ` Joakim Hove
2003-05-10 2:34 ` wang yin
2003-05-12 17:51 ` Kevin Rodgers
2003-05-10 14:34 ` Kai Großjohann
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).