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: Sun, 20 Sep 2020 16:49:03 +0200 Message-ID: <20200920144903.rqozepstuujkfz6w@Ergus> References: <20200912133311.6ujtgczj6wyclufy@Ergus> <20200920130435.heye7bk73pm252km@Ergus> <83sgbczj0i.fsf@gnu.org> 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="36016"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , casouri@gmail.com, joaotavora@gmail.com, emacs-devel@gnu.org To: Gregory Heytings Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Sep 20 16:51:10 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 1kK0gF-0009EO-No for ged-emacs-devel@m.gmane-mx.org; Sun, 20 Sep 2020 16:51:07 +0200 Original-Received: from localhost ([::1]:49282 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kK0gE-0002DE-Oc for ged-emacs-devel@m.gmane-mx.org; Sun, 20 Sep 2020 10:51:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47012) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kK0eX-0001X1-Bp for emacs-devel@gnu.org; Sun, 20 Sep 2020 10:49:21 -0400 Original-Received: from sonic306-2.consmr.mail.bf2.yahoo.com ([74.6.132.41]:40301) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kK0eT-0003ol-M0 for emacs-devel@gnu.org; Sun, 20 Sep 2020 10:49:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1600613355; bh=nUrY/EHG8zota73xv0zLUbxHzmM18h4rIZpDbHxHhZE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject; b=HYtVy2BbJsOACO2L8j4xNLZETyWgIgPEgOSYQO5AOUb1fzw2chaQaSKbUywpX1a0ZJvfizlKuvnGQ8g7AQshFp4y2adqVO05CaY8YECChJoIsQbwi6KFaBT9Va4O3RCLp8lbM1CvBBHSahmt//cIBLpYOcXlWsX3LGH9shJdFDsLk7Q+6Wf/SaVm8Iwkgc6EBPXBD+nndQTnpxd0N65xO+g9rBljU9tH6I4i6C/gvIorZxzEiXmEwDNE664kuvMVHdvAHz/AdlKQSIcARdbXrknWH6Xloml238Ez5ixwiucfUi3sDxRKbGwuOxego/aWrXMGf3fsGjPGruaTSJ63MA== X-YMail-OSG: 2TRNChcVM1mtY00VeUXhtRYjRa6n6zEBSvDB9ZG4yvhiTiCJOsqBtXiTqo6I.z4 orQo5CzKvMzAPX.Z5eC9I4EMKsKMM8uF6yu0BCbPu77Lxil2Dvl.JD0JlElgiutzaCZBZp39IZZx b35C2pN8vRvXmBaPyKE2cyaXs2d.qM1hRH_mPnzCz80cndxjwXfpN.6MVhrUaV9SRrTOmn9gd1BQ 3yyrwG7bQx5HIevLTJzzXGOI8Nyrs8b1hDkKYsdXYaWnyzWBYHRz0hpb8vdCnGqTeTN8JGSaodl3 m5jOyufzDhaRcNO40P4jP7Ub24dcTkQRRBuD0HORUFFtWT97cdKsoYyDWaNARjB4t5vc_ja.wSXH 77or3bAiJYU4glzLugmML6SMotJURhJmg73ph5m0Htk7kCkHDoTQDAXu9rl3fU2KQ8fy8yQiXe6k Mz89HYFU3cJMrpEbdF43nLMvdTFTPTdS1B.hdMx5iZV30AJK3Dx2a76M0KVv3ZrJn.T58CvYOdnI 7LihCXEgv3XmuiIMS8aJjKHXFaRHgbuikk51t1SUK8vvN2D5lLcE7.THsL551fwzSru1Ttk68l_d FLBEvhM6YWlfnDGoiH6dDz1TzxvK3knau.keIzNworyZrkQs6EK8gq9.m9WVPB.lOwlfTWynR7Sm BBQI1ZEX0gtePKiD9IkNlKcryLdweEgKmuiReuG1odjTdj.pJ776On4ExKR96Gf7DLXahh5V3EwG WAxlwjnsHRlbgY.RUq40icfW8vTpWiASG9C3HsinuqQCYoxDkVRnr4ObjEL0.RnZSPWhMZ9SxUpB hjHoNByduBR5kuQn1f6cNidesOCwn3ecUr3cSo8lck Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.bf2.yahoo.com with HTTP; Sun, 20 Sep 2020 14:49:15 +0000 Original-Received: by smtp401.mail.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID f58faaf720426ddaa0af4697fe1d7cb6; Sun, 20 Sep 2020 14:49:10 +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.132.41; envelope-from=spacibba@aol.com; helo=sonic306-2.consmr.mail.bf2.yahoo.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/20 10:49:15 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=unavailable 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:256254 Archived-At: On Sun, Sep 20, 2020 at 02:07:45PM +0000, Gregory Heytings wrote: > >>>Initially I separated icomplete--prospects only, but then all the >>>height calculation complexity came and that's why I ended with the >>>complex approach. I didn't know that the prompt issue disappeared >>>with >>> >>>(setq resize-mini-windows nil) >>> >>>What I wonder about this is the potential conflicts when another >>>package or function relies on resize-mini-windows. And that the >>>... is not shown to indicate that there are more candidates. >> >>resize-mini-windows is a user option, so resetting it globally is >>almost certainly a non-starter. >> > >The three lines I sent: > >(setq icomplete-separator "\n") >(setq icomplete-prospects-height 10) >(add-hook 'icomplete-minibuffer-setup-hook (function (lambda () (setq resize-mini-windows nil) (enlarge-window icomplete-prospects-height)))) > >had no other purpose except demonstrating that (setq >resize-mini-windows nil) solves the problem of disappearing prompts. >Of course I do not consider that these lines should be blindly used, >in fact I wrote "It needs some tweaking, but it works." Indeed one >should do something with user preferences, and use a setq-local. The >point is that doing this is much simpler than trying to calculate the >height of the completion candidate list, which amount (as Stefan >wrote) to redoing what redisplay does. Hi Gregory: When the display engine have resize-mini-windows not nil it will try to resize the windows after an action in minibuffer. This happens automatically and setting it as local or so will still overwrite the user choice. What we need is to inhibit that behavior while icomplete is active We could add a hook to minibuffer-exit-hook to reset resize-mini-windows to it's original value (and remove itself) Something like (untested) (setq icomplete-separator "\n") (setq icomplete-prospects-height 10) (defvar icomplete-saved-resize-mini-windows nil) (defun icomplete-minibuffer-exit-hook () (setq resize-mini-windows icomplete-saved-resize-mini-windows) (remove-hook 'minibuffer-exit-hook #'icomplete-minibuffer-exit-hook)) (add-hook 'icomplete-minibuffer-setup-hook '(lambda () (setq icomplete-saved-resize-mini-windows resize-mini-windows) (setq resize-mini-windows nil) (enlarge-window icomplete-prospects-height) (add-hook 'minibuffer-exit-hook #icomplete-minibuffer-exit-hook))) Should probably work. (But this still looks like a workaround more than a solution to me.)