[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Usability suggestion : completion for M-:
From: |
paul r |
Subject: |
Re: Usability suggestion : completion for M-: |
Date: |
Mon, 17 Mar 2008 10:32:00 +0100 |
2008/3/17, Stefan Monnier <address@hidden>:
> For what it's worth, I'm a bit annoyed by Emacs's inconsistent use of
> TAB: in minibuffers, TAB behaves like in terminals to mean "complete",
> where in normal buffers it usually means "indent".
As a person relatively new to emacs, I can remember that those various
uses of TAB made my first steps a bit more difficult. Now in my
config, TAB is rebound for almost every mode I use, see below.
> I have used for many years commands that do both bound to TAB: typically
> my TAB first tries to indent, and if the indentation code didn't make any
> change then TAB tries to complete.
I'm really surprised to see how many people here have done their own
implementation of this behaviour. FWIW, here is mine, fairly naive,
but functional.
(defun indent-for-tab-or-expand (expand-fct)
"Indent line if not yet, otherwise call parameter function."
(interactive)
(let ((ppos (point)))
(indent-for-tab-command)
(if (and (looking-at "$") (not (looking-back "^\\s-*")) (eq ppos (point)))
(call-interactively expand-fct))))
(defun indent-for-tab-or-dabbrev-expand ()
"Indent line if not yet, otherwise call dabbrev-expand."
(interactive)
(indent-for-tab-or-expand 'dabbrev-expand))
(defun indent-for-tab-or-hippie-expand ()
"Indent line if not yet, otherwise call hippie-expand."
(interactive)
(indent-for-tab-or-expand 'hippie-expand))
regards,
-- paul
- Re: Usability suggestion : completion for M-:, (continued)
- Re: Usability suggestion : completion for M-:, paul r, 2008/03/16
- RE: Usability suggestion : completion for M-:, Drew Adams, 2008/03/16
- Re: Usability suggestion : completion for M-:, paul r, 2008/03/16
- Re: Usability suggestion : completion for M-:, Bastien, 2008/03/16
- Re: Usability suggestion : completion for M-:, David De La Harpe Golden, 2008/03/16
- Re: Usability suggestion : completion for M-:, Stefan Monnier, 2008/03/16
- Re: Usability suggestion : completion for M-:, Mike Mattie, 2008/03/17
- Re: Usability suggestion : completion for M-:, Stefan Monnier, 2008/03/17
- Re: Usability suggestion : completion for M-:,
paul r <=
- Re: Usability suggestion : completion for M-:, Richard Stallman, 2008/03/17
- Re: Usability suggestion : completion for M-:, paul r, 2008/03/18
- Re: Usability suggestion : completion for M-:, Richard Stallman, 2008/03/18
- Re: Usability suggestion : completion for M-:, Stefan Monnier, 2008/03/19
- Re: Usability suggestion : completion for M-:, paul r, 2008/03/19
- Re: Usability suggestion : completion for M-:, Andreas Schwab, 2008/03/19
- Re: Usability suggestion : completion for M-:, paul r, 2008/03/16
- Re: Usability suggestion : completion for M-:, Lennart Borgman (gmail), 2008/03/16
- RE: Usability suggestion : completion for M-:, Drew Adams, 2008/03/16
- Re: Usability suggestion : completion for M-:, Bastien Guerry, 2008/03/16