From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: feature/icomplete-vertical Date: Sat, 19 Sep 2020 09:00:05 -0400 Message-ID: References: <20200919015957.prffuac2jke3hp6a@Ergus> <20200919061531.oyjlbdvkbeif5fsg@Ergus> <20200919114359.7kph6xt2gdmah2pp@Ergus> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23965"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Gregory Heytings , Eli Zaretskii , casouri@gmail.com, emacs-devel@gnu.org To: Ergus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Sep 19 15:02:03 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kJcV9-00067Y-GP for ged-emacs-devel@m.gmane-mx.org; Sat, 19 Sep 2020 15:02:03 +0200 Original-Received: from localhost ([::1]:59310 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJcV8-0004oS-GO for ged-emacs-devel@m.gmane-mx.org; Sat, 19 Sep 2020 09:02:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46006) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJcTN-0004F1-Em for emacs-devel@gnu.org; Sat, 19 Sep 2020 09:00:13 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:56801) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJcTK-00019i-SV; Sat, 19 Sep 2020 09:00:12 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id D7AED810D1; Sat, 19 Sep 2020 09:00:07 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 830D880D0E; Sat, 19 Sep 2020 09:00:06 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1600520406; bh=2uQXoBaCtUwAOTLE9WSjLlzGpxfX/nqdCAmJ4F3p7NU=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=GZI3wcsmoxeQrxSei6EShLXFsaTc01dLp2ICK7jPIiKcUkf39/ps4h8vxMbPX+ZVP +E/eE9ilRLpPrX72OEWCQ+jjWS4kjfAxcJwP6YHv40LAsFtU/JDw/SXAqj6raAV5X3 ow8XG0Gd14enrxiwFQ24VPULjWZl9XFOuygg/rw2N4o+lXy7A5t859fTaQ3Iv6pT2P q7x3DG1e+Z+EqQisTd/Mnf2JaGiqzgQsD836xey+OvS85kSAK1oKWdIRoerrmUJd6k ql4W4LAjS4vZffYvB9tbHmOqYoYqP7Ex2zIidHC2GmAxC2QHl0YMQwmWujaJAIElCH 8EIL+MUbVlL5w== Original-Received: from alfajor (unknown [45.72.232.131]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 13A141203D6; Sat, 19 Sep 2020 09:00:06 -0400 (EDT) In-Reply-To: <20200919114359.7kph6xt2gdmah2pp@Ergus> (Ergus's message of "Sat, 19 Sep 2020 13:43:59 +0200") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/19 08:43:37 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:256164 Archived-At: > + (let ((minibuffer-parameter (frame-parameter nil 'minibuffer))) > + (min (floor (cond > + ((eq minibuffer-parameter t) > + (if (floatp max-mini-window-height) > + (* max-mini-window-height (frame-pixel-height)) > + (* max-mini-window-height (frame-char-height)))) > + ;; TODO : minibuffer-parameter can have other values. > + ((eq minibuffer-parameter 'only) > + (frame-pixel-height))) > + (* (cl-count ?\n icomplete--separator) (line-pixel-height))) > + (+ 2 icomplete-prospects-height))))) Why do we care about (cl-count ?\n icomplete--separator)? I mean, the purpose of this code AFAIK is to *estimate* an upper bound on the number of candidates that will be visible. Depending on various factors (special fonts, text-properties, you name it), this estimate will at time be wrong, so in any case we will have to make sure that the resulting behavior is still acceptable when we end up displaying more (or less) candidates than fits. Using 1 instead of (cl-count ?\n icomplete--separator) will err on the side of putting too many rather than too few candidates, which should have as sole negative impact a negligible performance hit. Stefan