unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: npostavs@users.sourceforge.net
To: Frank Haun <fh@fhaun.de>
Cc: 26939@debbugs.gnu.org
Subject: bug#26939: 25.2; emacs --daemon, incorrect icomplete-prospects-height
Date: Mon, 05 Jun 2017 19:19:47 -0400	[thread overview]
Message-ID: <87r2yyxbsc.fsf@users.sourceforge.net> (raw)
In-Reply-To: <86o9uuz2ob.fsf@m8000.fhaun.de> (Frank Haun's message of "Mon, 15 May 2017 15:10:12 +0200")

[-- Attachment #1: Type: text/plain, Size: 994 bytes --]

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 1136 bytes --]

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


  reply	other threads:[~2017-06-05 23:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-15 13:10 bug#26939: 25.2; emacs --daemon, incorrect icomplete-prospects-height Frank Haun
2017-06-05 23:19 ` npostavs [this message]
2017-06-06  2:37   ` Eli Zaretskii
2017-06-06 12:33     ` npostavs
2017-06-14 11:04       ` npostavs

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=87r2yyxbsc.fsf@users.sourceforge.net \
    --to=npostavs@users.sourceforge.net \
    --cc=26939@debbugs.gnu.org \
    --cc=fh@fhaun.de \
    /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).