emacs-devel
[Top][All Lists]
Advanced

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

Re: reenabling icomplete operation during read-buffer


From: ken manheimer
Subject: Re: reenabling icomplete operation during read-buffer
Date: Wed, 11 Feb 2009 19:08:17 -0500

On Mon, Feb 9, 2009 at 9:11 PM, Stefan Monnier <address@hidden> wrote:

> > i noticed that icomplete stopped operating during, eg,
> > switch-to-buffer, in my CVS checkouts a good while back.  i'm finally
> > getting around to investigating, and see that read-buffer &c fail this
> > condition in icomplete-simple-completing-p:
>
> >        (or t (not (functionp minibuffer-completion-table))
> >            (eq icomplete-with-completion-tables t)
> >            (member minibuffer-completion-table
> >                          icomplete-with-completion-tables))))
>
> > i believe i (or someone) put that in to weed out complicated
> > situations where casual use of completion may be prohibitive, for
> > instance, during file-name read operations where the filesystem could
> > be remote or otherwise mediated.  the thing is, this inhibition is not
> > necessary for buffer-name-reading situations, but i haven't figured
> > out a good way to recognize that situation, in order to reframe the
> > above condition to allow for it.  can anyone suggest a good way to do
> > so?  or am i heading in the wrong direction?
>
> The best fix AFAIK is to set icomplete-with-completion-tables to
> t (i.e. to just drop this whole condition).  After all, icomplete's code
> is now run within a while-no-input, so even access to remote filesystems
> shouldn't be problematic (this was new in Emacs-22, IIRC).

i'd love to simplify that to default icomplete-with-completion-tables
to t, but it misbehaves dramatically for special tramp file visits,
like /sudo:address@hidden:/etc/hosts or /ftp:...

unfortunately, it looks like read-buffer-to-switch (files.el) was
changed to use a manufactured lambda as the completion table, which
means that icomplete can't statically match it to recognize being
within that completion context.  i can add a condition like:

           (and (boundp 'rbts-completion-table)
                (equal minibuffer-completion-table rbts-completion-table))

to get the behavior i want, but that is much too brittle - it depends
on an internal detail of read-buffer-to-switch.

offhand, i would like to have a reliable and simple way to detect that
buffer name reading is happening, so icomplete can be safely enabled
in that situation.  i'm not sure about the more general question,
which is classifying minibuffer reads as candidates for incremental
completion or not..  (in the remote-file reads, there are intermediate
strings which are invalid, and even many valid intermediate strings
would be expensive to complete.)
--
ken
http://myriadicity.net




reply via email to

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