From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ergus Newsgroups: gmane.emacs.devel Subject: Re: feature/icomplete-vertical Date: Sat, 19 Sep 2020 15:42:02 +0200 Message-ID: <20200919134202.xg3s6lj7kwgjzeki@Ergus> References: <20200919015957.prffuac2jke3hp6a@Ergus> <20200919061531.oyjlbdvkbeif5fsg@Ergus> <20200919114359.7kph6xt2gdmah2pp@Ergus> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33620"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Gregory Heytings , Eli Zaretskii , casouri@gmail.com, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Sep 19 15:43:01 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 1kJd8l-0008b1-IY for ged-emacs-devel@m.gmane-mx.org; Sat, 19 Sep 2020 15:42:59 +0200 Original-Received: from localhost ([::1]:42312 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJd8k-000399-Jz for ged-emacs-devel@m.gmane-mx.org; Sat, 19 Sep 2020 09:42:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52386) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJd85-0002iW-33 for emacs-devel@gnu.org; Sat, 19 Sep 2020 09:42:17 -0400 Original-Received: from sonic315-13.consmr.mail.bf2.yahoo.com ([74.6.134.123]:37494) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kJd82-0005sr-KF for emacs-devel@gnu.org; Sat, 19 Sep 2020 09:42:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1600522931; bh=6kdwyxE77tCx6uccf/twM4oaRLNTQ9cT3+RMF80fpak=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject; b=kQDL9Jbavz8yIelYTRDPq5L0gihKbk0MAMohkDrmIVxQoUaIjXOuJm7fGOgLuzCw5UVEKcociriHQx70nyfhvFWX8/I9pgunzj1xlhBY3vU8bs/U5xXhMK77YvvQuv1RZbVB5VT8Iib96pjuUqs3xXW4aA9rfuhRveE4OJrPxmwhHqZf0ttxntZKlYIe74pOceX8Uu1qdSq8SgX/dyjg+sfevQy5MFKESOGcF9IqeA28U1QEOQt9QSwQlQAOY65afF169IeXmFs1koaLv5HoaGS4eQ2etX6OBmrNmXQ+a+piV72b9CIINyHjsDR5No6wG9AYAw4G/4jvs6cnbf6DiQ== X-YMail-OSG: 6b6l4jMVM1kgeOGnfvgEGa4H_YcLLxRvWEyfAcc1ZCApzEMjthCj07ervC3gVLt lCv64SD1RkKpBLo4_ZoDJsSPsabz5G53uUYP8STxcRkKsWvPumNslbGFTzHjbkux.gyD9n3EbBcd tuAcM21GeXSwWH1pq0x84nMjq5wAfu7hL7WE1djw1UthTP0Ecfx6Fkn674E7AWQeASQIwPuKTzyz 3so61y3Hrtw93EsdqUhWcKm7N4ZY46rZKfNr_ak6C2YRI6W8wV8eVAWVxPfdc9oIokwS346VD0Mw 7wW0mqiDR.PJkHniiSij96IsmO9W.OUvcK.fKTTz3w3g2Msu1AUBkSY2f4UrshlHvW6.XPi2.Fpd 23YQs5MNH2zgex2qozcP1xKVhm89RCIPPzUEn3AFWAQBMmtcxzyqRTA7jmGfz1Dyqn_BaL.1B5Bh 8sRkcFc08qgv4g_yE1nCQK754I80lj1W032p33k1AoHuVZWxcdZTZZfFks6JvV5WDUy9A8O.lBBi OeD6b07SjJ0hBC49oXK7bdGfqotp0ZPy1.8vbpWexXcaJmefK8a3E.vC3SZtzK.bvr_NZUzlWCud a2nSZUXGnLGTDMCcrnZocLfByd6khDPiHtbOO5i14oSpNofFB.VLxouh5IYQE7PZGXUFg36MaaCy wj4wTmv_AF2BJsjFiqrK47CnETg8wWJ_H10kJswMmRzME9v5h557vw8OPK27q2Wpv4T1gAW87Ddo s.jKSIIa6Ujc_pSGjW6Xf3de07UOoEuu2eJoazkuyFcWb5phYdePHpT93FAGUNuMROka.Y4bF42C lXrcFR.5WP_9SdPjbm658N2KIa45ptgjO2eVWG90r9 Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic315.consmr.mail.bf2.yahoo.com with HTTP; Sat, 19 Sep 2020 13:42:11 +0000 Original-Received: by smtp424.mail.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 80ae85582e7cf9ab65f05f2c0c16484b; Sat, 19 Sep 2020 13:42:09 +0000 (UTC) Content-Disposition: inline In-Reply-To: X-Mailer: WebService/1.1.16583 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.aol Apache-HttpAsyncClient/4.1.4 (Java/11.0.7) Received-SPF: pass client-ip=74.6.134.123; envelope-from=spacibba@aol.com; helo=sonic315-13.consmr.mail.bf2.yahoo.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/19 09:42:11 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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:256166 Archived-At: On Sat, Sep 19, 2020 at 09:00:05AM -0400, Stefan Monnier wrote: >> + (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))))) Hi Stefan: > >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. > That's why I work with pixels. Because we can get the height of every added line and do a better estimation... but we need to add the text properties before the increment... which is a different topic because ATM this is not happening. >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 > I actually added the cl-count for the opposite reason; in case the user adds a separator with more than one \n. Because the idea was to change the condition to enable vertical mode for when the separator contains at least a \n. Because otherwise the horizontal formatting could be more accurate. So having both (format and separator) may conflict unless we prioritize one of them; which IMO should be the separator as it is the already existent variable. My intention is to remove the icomplete-format variable completely and use the right condition based only on the user's separator because that's something that 2 users mentioned when I asked in this mailing list to try the branch. This is needed to keep compatibility with the external package. OTOH the problem of adding too many candidates (IIUC) is the hiding prompt issue which comes from there but also the ... will be hiden. So we need to add the exact amount of lines as accurate as possible.