From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#43572: Feature request: make it possible to choose whether the first lines of the minibuffer should be displayed instead of the last ones Date: Tue, 22 Sep 2020 20:57:13 +0000 Message-ID: Reply-To: Gregory Heytings Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="-212064758-314916080-1600805831=:32542" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13757"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Alpine 2.22 (NEB 394 2020-01-19) To: 43572@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 22 23:09:45 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1kKpXl-0003TV-Bn for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 22 Sep 2020 23:09:45 +0200 Original-Received: from localhost ([::1]:55396 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kKpXk-0003KZ-Bt for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 22 Sep 2020 17:09:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36208) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKpMR-00084R-3o for bug-gnu-emacs@gnu.org; Tue, 22 Sep 2020 16:58:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50270) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kKpMQ-00045F-Ps for bug-gnu-emacs@gnu.org; Tue, 22 Sep 2020 16:58:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kKpMQ-0001ct-Ny for bug-gnu-emacs@gnu.org; Tue, 22 Sep 2020 16:58:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 22 Sep 2020 20:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 43572 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16008082516209 (code B ref -1); Tue, 22 Sep 2020 20:58:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 22 Sep 2020 20:57:31 +0000 Original-Received: from localhost ([127.0.0.1]:33583 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kKpLu-0001c5-J1 for submit@debbugs.gnu.org; Tue, 22 Sep 2020 16:57:30 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:49790) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kKpLr-0001bx-MS for submit@debbugs.gnu.org; Tue, 22 Sep 2020 16:57:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36050) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKpLp-0007m7-T3 for bug-gnu-emacs@gnu.org; Tue, 22 Sep 2020 16:57:27 -0400 Original-Received: from mx.sdf.org ([205.166.94.24]:63217) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKpLm-00041H-G9 for bug-gnu-emacs@gnu.org; Tue, 22 Sep 2020 16:57:25 -0400 Original-Received: from sdf.org (IDENT:ghe@otaku.sdf.org [205.166.94.8]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 08MKvFDn017898 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Tue, 22 Sep 2020 20:57:15 GMT Original-Received: (from ghe@localhost) by sdf.org (8.15.2/8.12.8/Submit) id 08MKvS6X003173; Tue, 22 Sep 2020 20:57:28 GMT Content-ID: Received-SPF: pass client-ip=205.166.94.24; envelope-from=ghe@sdf.org; helo=mx.sdf.org X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/22 16:06:35 X-ACL-Warn: Detected OS = ??? X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:188749 Archived-At: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---212064758-314916080-1600805831=:32542 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-ID: In Emacs 27.1, the mini-window displays the last lines of the minibuffer. This is, in general, the desired behavior, but in some cases it is not. One case in which this behavior is not desirable is when completion candidates are displayed with an overlay at the end of the buffer. When this overlay is taller than max-mini-window-height, the prompt and the user input so far disappear. A simple example: M-: (setq max-mini-window-height 1), M-x icomplete-mode, M-x a. Because of this behavior, and because it is counter-intuitive / not user-friendly when the prompt and user input so far disappear, those who create programs that display such completion candidates have been struggling to create overlays in such a way that they are (together with the prompt and the user input so far) not taller than max-mini-window-height. Doing this is, in general, far from trivial. The attached patch makes it possible to (selectively) choose to display the _first_ lines of the minibuffer instead of its _last_ lines (which is and remains the default behavior). This means that displaying completion candidates becomes a trivial task: it suffices to create an overlay with completion candidates, without worrying at all about its size (or about the size of the prompt and user input), and as many of these candidates as possible will automatically be displayed. For example, implementing vertical icomplete only requires: (setq icomplete-separator "\n") (add-hook 'icomplete-minibuffer-setup-hook (lambda () (setq start-display-at-beginning-of-minibuffer t))) This feature request follows the discussion in bug#43519. The change proposed there by Eli Zaretskii improves the behavior w.r.t. Emacs 27.1, but it is still suboptimal to display completion candidates in a user-friendly way. For example: Find file: | (where | represents the cursor) will become: | when the user input becomes larger than a line. That is, the "Find file:" prompt and the user input on the first line will disappear. The attached patch does not change the behavior of Emacs in any way, unless the feature it introduces is used. ---212064758-314916080-1600805831=:32542 Content-Type: text/x-diff; name=start-display-at-beginning-of-minibuffer.patch; charset=us-ascii Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=start-display-at-beginning-of-minibuffer.patch ZGlmZiAtLWdpdCBhL3NyYy9taW5pYnVmLmMgYi9zcmMvbWluaWJ1Zi5jDQpp bmRleCBmOTU3YjJhZTE3Li40NDg1MjEyN2VkIDEwMDY0NA0KLS0tIGEvc3Jj L21pbmlidWYuYw0KKysrIGIvc3JjL21pbmlidWYuYw0KQEAgLTY1Nyw2ICs2 NTcsOCBAQCByZWFkX21pbmlidWYgKExpc3BfT2JqZWN0IG1hcCwgTGlzcF9P YmplY3QgaW5pdGlhbCwgTGlzcF9PYmplY3QgcHJvbXB0LA0KICAgaWYgKFNU UklOR1AgKGlucHV0X21ldGhvZCkgJiYgIU5JTFAgKEZmYm91bmRwIChRYWN0 aXZhdGVfaW5wdXRfbWV0aG9kKSkpDQogICAgIGNhbGwxIChRYWN0aXZhdGVf aW5wdXRfbWV0aG9kLCBpbnB1dF9tZXRob2QpOw0KIA0KK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