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: Question about completion behavior Date: Wed, 9 Mar 2022 02:46:19 +0100 Message-ID: <20220309014619.bptamkv47xdiyhzp@Ergus> References: <20220309001013.gxyh2uasbuxiz6ww.ref@Ergus> <20220309001013.gxyh2uasbuxiz6ww@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="10167"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Mar 09 02:48:07 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 1nRlQs-0002X0-HP for ged-emacs-devel@m.gmane-mx.org; Wed, 09 Mar 2022 02:48:06 +0100 Original-Received: from localhost ([::1]:56704 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRlQr-0007TK-Jf for ged-emacs-devel@m.gmane-mx.org; Tue, 08 Mar 2022 20:48:05 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:45416) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRlPw-0006mm-E2 for emacs-devel@gnu.org; Tue, 08 Mar 2022 20:47:08 -0500 Original-Received: from sonic314-14.consmr.mail.bf2.yahoo.com ([74.6.132.124]:36245) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRlPt-0001LO-NJ for emacs-devel@gnu.org; Tue, 08 Mar 2022 20:47:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1646790423; bh=9660LTnO+jjsfAakD3Hfsi8jgwHJk6luCGZZ+Z2VgHs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject:Reply-To; b=Un5KfOv0trwQ4xzDEh2QkmatXEE8vSRVNL/X5IELLPOGYlgMEdn37whgMpCQxHX/w/HDo6rQOhxgra+xOTujSDOOprt0AJyIHWVQ9AWXnDQJNnbCnvy6bxxGuQgT7n5qNUCL8TxUx3gSxb2jOwkHcW3ccINNlMBe4W7g1zRqFXz12MMddvcN/PdN4LlPbgCelHGdJghU+zTjjed4XP90VQbkbGH6+HGNzfherqUrcET5bHuT8+GB/AQrqnjWNrk5U95ZUswcJwo4vm/yGjz0FAFg1DoHDwQ23DRNfdPfODUYu8F8aZjI+WVhB8gbT3o1urf9FGkqHaZIJyt3+xvNtw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1646790423; bh=S5vsGL46ZpUWVWX1Cwp+3cn8R2UUo0n1RnRkYKcrol0=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=VcqtsQCqMrAb7fVzV2kkuxFoQ1CkE2dGYBICzHYi2Rdu/puTQZR8C8O+yNNlKVz7YgaMb/fBEyw0/m2OHs55WHnmbjyXKbNQt2gPDXHfW8n1ER5zWODWD/3Z7POyil5luGtwp2igpUIpra8FfNFNVfSzTIpZdmxevgNu7rLcLpFk7E408sBhGTdTCZilun6Qv51RUsLN7L0e2D6lfljbwROKOi5etnOh2EYTunO37UPjiFXXFv6GNL/LmZu/g6lBKrg+Eq38fK3POUJ7e1aqjszplM7ch2MnPR0ppsYdAW/XO7qrXHGZ4FRh3Ju0SzFb+AqqeBMRVrbnOUt7EBduBA== X-YMail-OSG: DFsY3X0VM1nEGlrfzrbM6wgx1YKWL2g39w_wGzmKR.LLSg_yFHl0HKHLJ..Rhf9 3wrGVqsZLrpcNDpVyzyFmMWYxUXktNUmVRuHomf2szob1lkzQyIZulBi99lhairIZNGCVYW5jfAY d_42N_jOBINrBGWO1MLc_e67aZv3_07MhffL.ECPoC0RkbbMO4TpNvVFonFNSRSuSIBPvf_5dCR0 syEbBj9cLdmK4ZvSdMghM8eLbdhh38jStahTqbYTPcVZzUfdfxpXUkgdyoyZb3fm1DsPmeBMMS3i rE7xpKqHJW0wb18l0YiGsc.Ce87_rvI3uaVU3miccFNobzcMWWY7sp8VvDEUaOe6fo7VXhOwLF9K .gKApd0tIRKk595IP7Aj2J_Hm9qvFtQY6CFtj8XbW9.EZ0bbI2QHbBJaDadoqL09XblhtpaPvDK7 luR5RTFNt3k0mFuHrL6yMSFK.oY9ODLDT7od6IO2wzedmk7LeP34rwjGE6KudiqJzl_oMceLT1nD ZK4GYCEt28vYTgylfQM902bKBJvMZWOG5oDmYkYvqVyxsBFcA.lGZufqX8nqz4K1imrTlinVxZFK jWHzVzv6DShQ8XLJFoZKg7FgN3jujRXnZOxNgxpaKjeZh2h29hziHSIpnP.Yld9ijO2EzxR24UB5 IpLd.98Y6y0Pu.ZhQOAvudzqFQiMV47c3t9OkLUS19j9zOBfHBBH4Gvok0FFZeP8lg.Y8H_3MYMa zZ3yoaLs8tpAppl48_qH4Ckda2oAnW71NiZR3Lxrd3CuWRdopipXlJ.fPCEBR1dr6zh.6qR2pbNp Twm57SNR.ST_iJjhqO7Fp1IVr6PzXiE2RY4VdagZV8 X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.bf2.yahoo.com with HTTP; Wed, 9 Mar 2022 01:47:03 +0000 Original-Received: by kubenode516.mail-prod1.omega.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 05b945f479455c902b673ddbeffe4ae4; Wed, 09 Mar 2022 01:46:58 +0000 (UTC) Content-Disposition: inline In-Reply-To: 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.132.124; envelope-from=spacibba@aol.com; helo=sonic314-14.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:286941 Archived-At: On Tue, Mar 08, 2022 at 07:22:11PM -0500, Stefan Monnier wrote: >Ergus [2022-03-09 01:10:13] wrote: >> In the code that hides the completions there is actually a comment about >> this: >> >> ;; We could also decide to refresh the completions, >> ;; if they're displayed (and assuming there are >> ;; completions left). >> >> Is anyone working on this? > >When I wrote that code (and that comment), my main goal was to rewrite >the C code into ELisp, introduce the `completion-styles` system and add >`partial-completion` to the default. > >To maximize the chances that it be accepted, I made every effort to try >and preserve the old behavior w.r.t everything else. > >> Was all this behavior intended or how do you propose to solve this? > >I think this can be changed. >Patches welcome. > I am struggling how to preserve the old behavior indeed, because what I find a bit confusing is actually the default behavior. We could just add an extra custom to change this detail on demand, but my initial concert was about the inconsistency itself in the default behavior. For me it seems like the hide-completions may be inside the if. Something like: ``` (completed (when exact (minibuffer-hide-completions) ;; If completion did not put point at end of field, ;; it's a sign that completion is not finished. (completion--done completion (if (< comp-pos (length completion)) 'exact 'unknown)) )) ``` gives a consistent behavior IMO. But as I know that changing a behavior may be impossible maybe we need another custom with something like: ``` (completed (when (or exact the-new-custom) (minibuffer-hide-completions)) (when exact ;; If completion did not put point at end of field, ;; it's a sign that completion is not finished. (completion--done completion (if (< comp-pos (length completion)) 'exact 'unknown)))) ``` Do think that you any of those may be valid? Some side effect I am not aware of? > > Stefan > Thanks, Ergus