bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#26939: 25.2; emacs --daemon, incorrect icomplete-prospects-height


From: npostavs
Subject: bug#26939: 25.2; emacs --daemon, incorrect icomplete-prospects-height
Date: Tue, 06 Jun 2017 08:33:10 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

> I suggest a comment there explaining the value.

Good point.  I also noticed that this default value was the last use of
icomplete-prospects-length which is marked obsolete since 23.1, so I've
completely removed its definition too.

>From 382fb609e1d72f802b0dbff07ed461cfc34261ff Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs@gmail.com>
Date: Mon, 5 Jun 2017 19:18:14 -0400
Subject: [PATCH v2] Give a fixed default value for icomplete-prospects-height
 (Bug#26939)

* lisp/icomplete.el (icomplete-prospects-height): Default to 2.
(icomplete-prospects-length): Remove.
* etc/NEWS: Announce removal.
---
 etc/NEWS          |  1 +
 lisp/icomplete.el | 15 ++++++---------
 2 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index cbd388b216..7cc773d5e0 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -926,6 +926,7 @@ of not providing replacement pairs via the history.
 *** make-variable-frame-local.  Variables cannot be frame-local any more.
 *** From subr.el: window-dot, set-window-dot, read-input, show-buffer,
 eval-current-buffer, string-to-int
+*** icomplete-prospects-length.
 *** All the default-FOO variables that hold the default value of the
 FOO variable.  Use 'default-value' and 'setq-default' to access and
 change FOO, respectively.  The exhaustive list of removed variables is:
diff --git a/lisp/icomplete.el b/lisp/icomplete.el
index cd352de65b..a4153e806d 100644
--- a/lisp/icomplete.el
+++ b/lisp/icomplete.el
@@ -56,10 +56,6 @@ (defgroup icomplete nil
   :link '(info-link "(emacs)Icomplete")
   :group 'minibuffer)
 
-(defvar icomplete-prospects-length 80)
-(make-obsolete-variable
- 'icomplete-prospects-length 'icomplete-prospects-height "23.1")
-
 (defcustom icomplete-separator " | "
   "String used by Icomplete to separate alternatives in the minibuffer."
   :type 'string
@@ -91,13 +87,14 @@ (defface icomplete-first-match '((t :weight bold))
   :version "24.4")
 
 ;;;_* User Customization variables
-(defcustom icomplete-prospects-height
-  ;; 20 is an estimated common size for the prompt + minibuffer content, to
-  ;; try to guess the number of lines used up by icomplete-prospects-length.
-  (+ 1 (/ (+ icomplete-prospects-length 20) (window-width)))
+(defcustom icomplete-prospects-height 2
+  ;; We used to compute how many lines 100 characters would take in
+  ;; the current window width, but the return value of `window-width'
+  ;; is unreliable on startup (e.g., if we're in daemon mode), so now
+  ;; we simply base the default value on an 80 column window.
   "Maximum number of lines to use in the minibuffer."
   :type 'integer
-  :version "23.1")
+  :version "26.1")
 
 (defcustom icomplete-compute-delay .3
   "Completions-computation stall, used only with large-number completions.
-- 
2.11.1


reply via email to

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