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: [PATCH] completions-max-height Date: Wed, 9 Mar 2022 12:34:16 +0100 Message-ID: <20220309113416.nwqpfhbdvzmxho6h@Ergus> References: <20220307210740.veiocemir46mmerk.ref@Ergus> <20220307210740.veiocemir46mmerk@Ergus> <87v8wpxvkj.fsf@posteo.net> <87fsntvxg6.fsf@protesilaos.com> <3723C952-ECE7-467B-AE89-73EB0819B7F0@aol.com> <878rtk3k6m.fsf@posteo.net> <20220308132910.iatgy7fzqkbgw4df@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="22865"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Protesilaos Stavrou , emacs-devel@gnu.org To: Philip Kaludercic Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Mar 09 12:36:56 2022 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 1nRuch-0005ll-PC for ged-emacs-devel@m.gmane-mx.org; Wed, 09 Mar 2022 12:36:55 +0100 Original-Received: from localhost ([::1]:58388 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRucg-00047i-OD for ged-emacs-devel@m.gmane-mx.org; Wed, 09 Mar 2022 06:36:54 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:46816) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRuar-0001IP-Mk for emacs-devel@gnu.org; Wed, 09 Mar 2022 06:35:01 -0500 Original-Received: from sonic310-13.consmr.mail.bf2.yahoo.com ([74.6.135.123]:46403) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRuao-0001PF-JK for emacs-devel@gnu.org; Wed, 09 Mar 2022 06:35:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1646825697; bh=TMeAS8HWT4MPwNZAVoFA+hPuVf4NLr9MIiyJBgGBe1s=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject:Reply-To; b=n9JKNgy17NKrk3PmrCzKb6XBO7r45SgqvH21/kVXcUXjq02iY9kpF6ZR97j5boueVEgDL0aloWnnhBIEryzacDqh9nxJjk+prNWnhZp62cEhDSlSzAytb9JocrpbEZNBocqVWD4up2eUlmvpY4+BUIwymX6w+hBDtC2s2rxHLI/tF1KW/KGVFv0Af4jscZIh9FEsZQcGwoPyuIGymu/bvHAn9kJJuP6jzCBz/fnilAZ+r6793UUYXRNEwlZPuQWCb8cwBykMEH7qbC/8iwwFYjPh1XRJHyIYdc2hANWwGZ/GAJxwQGVMk5gm6HY83ZXQ9asACH8VkQY7d+4eWnLahg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1646825697; bh=pQJqrWXmeKzZQPQEsCZmcrhyvx81DOr+Tsfst5+5el9=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=tjckPcSjnKfMkoX5iw94PQ0X/H9lyN+OKOceRcd88OKEqJuDU03e9wNuFeIpHIoa+4Y98ObQshtopjv/hT3r4EcKUB/04wRZQrIoXibWDf/rxW5C61diP5m+GX89XA8kcQnGtCrKQJrWZwfIY8jT4l4yO48opUKzJSm8GgdziBWN1evECgmFSBvcXUTvTBkAGisvuWmLA2INCtO6zMcrDcFXyIxS5q1u62jHukVcSd03No2GZSORERy/4/w1rvA7AGmt9A7E1cWVXBJpciuWPzqqbiFrR+SlM3UA0ZDYpeXxoNkbReaIMOd8k1kMVUvHfrEgpFUZ9qQueYy4tqubVg== X-YMail-OSG: vRDmz9cVM1lsKko4BskWy6Uq_JauwYwVhUg6GF1Bl_sXPE8pqVzxrFEX0AOsjzA rlgW_npQnWmvultfmINiUJAM_iml3mdUf6vO4Ew8fCVS7M3U9qWHiRwj9MaJTpXLnN2BS5r9LRpe 3rYNrbRy2JbL2fPGu0UC.bFZsPxrlQF7y8JFFFinHrtjBak5uxgKWXHudoSylNlAAlxLl17b5rEu ZmQ_YgOP5C2Wa5zNczhW1EACXxreFIL1DzJ9kBCufhPH4w.VUGoqXK3lRQ8aqixO084gOHxiOBmS nUwT8Y8YDXjFPEAG55NL8rm1SIOcmYBrYmUKc06_rkXjrRa0wlLuc2blHFYXoivtPrNgMiiW.j2Y yQbOfUKQnF8yVaMXkD6m09FJq6xl2AH4nctEJLStACTqO5taoaOPSroA7MPQAtCxgPuJkKAg_qz2 zqGfjW4KCSasZtUYgJVcRs7cwJSttVNOHH3aOsg49sYpFPrP6GxrWi0ee7uTrNpzyLodH7tQXcF7 QskqGcBATpGrAT37doeMG4mMhpj9RzbscOvOBQFM5u7VPx51KZq2EO2MWNLLaI2MONfUv460FmXX 7WgebsxwRdwZ52dobNgzT6C0xTRMEpNaqXW349AEQKBgoM8R0bmWmC4Kvlx2DsFoC5wHo4dhEMcm u3MyseYw2y.hgSwTdiVD9un1RYHkuTqks_rz5zd52RQ3Z02BSUzj5_nCpT65vuBYZ8Z2o10mGrJ7 ZAohsCEzmrOBJyYi..fGUU0lq9e0W2aTN.KqVdwwIW0swl_5y07DfpF7Z0mdVFtmapKWk3T0Jnkz zZCTEPujaQJQne6U6jQm9X2Q1QtrEdGNowCOY_TW52 X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic310.consmr.mail.bf2.yahoo.com with HTTP; Wed, 9 Mar 2022 11:34:57 +0000 Original-Received: by kubenode507.mail-prod1.omega.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 91659ab97ce618984bba5379af950033; Wed, 09 Mar 2022 11:34:55 +0000 (UTC) Content-Disposition: inline In-Reply-To: <20220308132910.iatgy7fzqkbgw4df@Ergus> X-Mailer: WebService/1.1.19878 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.aol Received-SPF: pass client-ip=74.6.135.123; envelope-from=spacibba@aol.com; helo=sonic310-13.consmr.mail.bf2.yahoo.com 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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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:286946 Archived-At: On Tue, Mar 08, 2022 at 02:29:10PM +0100, Ergus wrote: >On Tue, Mar 08, 2022 at 08:47:13AM +0000, Philip Kaludercic wrote: >>Ergus writes: >> >>>I understand your intention, but in practice making this more complex >>>is useless. The mini buffer is always down and making the completions >>>to move somewhere else is uncomfortable and may require more >>>lisp/emacs knowledge to change the default behavior from the >>>user. Which is completely the opposite to my intention. Actually this >>>same result may be reached with an advise as I discussed on yesterday >>>on emacs help. But a simple custom is better. >>> >>>I am totally fine if you propose something else more general if that don't forces the user to write a function to change a simple height. >> >>What I proposed would just require something like >> >> (setq completion-display-buffer-option '(display-buffer-at-bottom (window-height . 10))) >> > >This just works: > >(setq display-buffer-alist '(("^\\*Completions\\*$" . > (display-buffer-at-bottom > (window-height . 10))))) > >For the simplest case this works... But there is not a way to handle the >conditionals without affecting some users. For example when using inline >completion or the ones using resize-temp-buffer-window > >We can use a function instead, but in that case the user customization >may need a more complex approach instead of just a setq. > >Maybe a better lisper could propose something better that allows to set >this without a defun, an advise or defining a tricky alist that may >conflict with something else? > > After a day with this config I found several issues. At the end it required to do: (add-to-list 'display-buffer-alist '("^\\*Completions\\*$" . ((display-buffer--maybe-same-window display-buffer-reuse-window display-buffer--maybe-pop-up-frame) (window-height . 10)))) Otherwise many things happen (completions buffer replication for not reusing window, not popup frames and so on.) So at the end I think that the initial patch is the best simpler approach (the code could be simplified even more by a better lisper probably) because otherwise the user may need do a complex config for a most simple need, creating conflicts and changing some of the default behaviors... Simple is better than complex. Complex is better than complicated. Best, Ergus