[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: |
Mon, 05 Jun 2017 19:19:47 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) |
tags 26939 patch
quit
Frank Haun <fh@fhaun.de> writes:
> There is a wrong calculation of `icomplete-prospects-height` when Emacs
> starts as daemon and icomplete is enabled via the init file.
>
> Emacs daemon returns 10 for `window-width` and
> `icomplete-prospects-height` becomes 11.
This is a bit similar to #27210, window sizes are unreliable in daemon
mode. I think putting (window-width) as the standard value doesn't make
sense anyway. The code that uses this variable already add the
window-width:
;; Max total length to use, including the minibuffer content.
(* (+ icomplete-prospects-height
;; If the minibuffer content already uses up more than
;; one line, increase the allowable space accordingly.
(/ prospects-len (window-width)))
(window-width))
So I think we should just change the standard value to 2 (which would
currently be the default for window-width of 80).
>From ca5812c7f5fd222db48aa7f43986ae6240e3640a Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs@gmail.com>
Date: Mon, 5 Jun 2017 19:18:14 -0400
Subject: [PATCH v1] * lisp/icomplete.el (icomplete-prospects-height): Default
to 2 (Bug#26939).
---
lisp/icomplete.el | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/lisp/icomplete.el b/lisp/icomplete.el
index cd352de65b..00f8ed18a1 100644
--- a/lisp/icomplete.el
+++ b/lisp/icomplete.el
@@ -91,13 +91,10 @@ (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
"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
- bug#26939: 25.2; emacs --daemon, incorrect icomplete-prospects-height,
npostavs <=