unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'ken manheimer'" <ken.manheimer@gmail.com>,
	"'emacs-devel'" <emacs-devel@gnu.org>
Subject: RE: reenabling icomplete operation during read-buffer
Date: Mon, 9 Feb 2009 17:01:25 -0800	[thread overview]
Message-ID: <000201c98b1b$19a6a7e0$0200a8c0@us.oracle.com> (raw)
In-Reply-To: <2cd46e7f0902091527p7886f1fap33e330e73165f039@mail.gmail.com>

> 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))

Typo - (or (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?

1. Please consider doing this for `icomplete-with-completion-tables':

* Make it a defcustom.
* Document `t' as a possible value.

The doc of `icomplete-with-completion-tables' does not mention what it means for
the value to be `t', and the above code is the only place where the variable is
used.

I was not aware of this variable, which has apparently existed since Emacs 22. I
might even try using `t' as the value - at least for a while. ;-)


2. FWIW, this code seems a bit weird, to me:

(defvar icomplete-prospects-length 80)
(make-obsolete-variable
 'icomplete-prospects-length 'icomplete-prospects-height "23.1")

(defcustom icomplete-prospects-height
  (+ 1 (/ (+ icomplete-prospects-length 20) (window-width)))
  "Maximum number of lines to use in the minibuffer."
  :type 'integer :group 'icomplete :version "23.1")

The CURRENT-NAME for the OBSOLETE-NAME `icomplete-prospects-length' is said to
be `icomplete-prospects-height' (using the terminology of the doc string of
`make-obsolete-variable'). I recognize that this really means only that the
compiler warning will advise you to use the latter instead of the former, but at
least some users might (mis)understand this as saying that they are just
different names that represent the same thing (have the same value). Better to
have an explicit message that describes the relation (see below).

The default value of the option seems problematic anyway, since it is based on
the width of the window that happens to be current at the time the defcustom is
evaluated. Does that make sense? I guess this assumes that that window is the
minibuffer window, and it assumes that that particular minibuffer window is
representative of other possible minibuffer windows.

If something really smart and foolsafe can't be done here, perhaps just (a) have
a fixed default value for the option of, say, 1 or 2, and (b) tell users at
byte-compile time that `icomplete-prospects-length' can no longer be used. IOW,
something like this:

(defvar icomplete-prospects-length nil
  "Obsolete internal variable - do not use this.
You can no longer control the icomplete display length
directly.  You can instead control the height of the
displayed prospects, using option `icomplete-prospects-height'.")

(make-obsolete-variable 'icomplete-prospects-length
  "You can no longer control the icomplete display length.
You can instead control the height of the displayed
prospects, using option `icomplete-prospects-height'." "23.1")

(defcustom icomplete-prospects-height 2
  "Maximum number of lines for icomplete to use in the minibuffer."
  :type 'integer :group 'icomplete :version "23.1")

Or is it "not done" to just cut off an obsolete variable completely and
immediately like that?





  reply	other threads:[~2009-02-10  1:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-09 23:27 reenabling icomplete operation during read-buffer ken manheimer
2009-02-10  1:01 ` Drew Adams [this message]
2009-02-10  2:11 ` Stefan Monnier
2009-02-12  0:08   ` ken manheimer
2009-02-12  2:21     ` Stefan Monnier
2009-02-12 23:28       ` ken manheimer
2009-02-13  0:00         ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000201c98b1b$19a6a7e0$0200a8c0@us.oracle.com' \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=ken.manheimer@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).