emacs-devel
[Top][All Lists]
Advanced

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

Re: Usability suggestion : completion for M-:


From: Mike Mattie
Subject: Re: Usability suggestion : completion for M-:
Date: Sun, 16 Mar 2008 21:07:12 -0700

On Sun, 16 Mar 2008 22:52:51 -0400
Stefan Monnier <address@hidden> wrote:

> >> But I think I stated that enough now, and you clearly stated your
> >> position as well, so it could help to have other people advice on 
> >> that concerning the *current implementation* of M-:
> 
> 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".
> 
> But of course, "indent" can also make sense in minibuffers, and
> "complete" also makes a lot of sense in normal buffers.
> 
> 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.
> 
> It works OK as far as DWIMish things are concerned, but it has some
> rough corners:
> - if the indentation code always makes changes (e.g. because it cycles
>   through several possible indentation points), then completion is
>   never used.

Can you post the code ? I have a similar setup, but I can't remember
running into that particular problem before.

The biggest issue I noticed with overloaded commands is that Emacs
commands will inspect this-command. An overloaded command
needs to adjust these sorts of variables so other code isn't adversely
affected. Some parts of Emacs definitely don't appreciate the current
command being a lambda either.

> - if the completion code only gets called when you repeat TAB, then
>   well... you have to repeat TAB to get to completion.
> - if not, then you get surprising results when you do TAB C-n TAB C-n
>   ... intending to reindent a chunk of code and once of the lines
>   happens to be properly indented already and you end up
>   completing instead.
> 
> So it's not a satisfactory solution.

I definitely have a different implementation that sounds more robust.
I hit tab repeatedly and the result is always the same in regards to
the behavior selected.
 
> 
>         Stefan
> 
> 

Attachment: signature.asc
Description: PGP signature


reply via email to

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