From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: MaGelan Newsgroups: gmane.emacs.help Subject: Re: completing-read does not display options in new frames Date: Fri, 05 May 2023 16:04:01 +0900 Message-ID: <87h6sr2ra6.fsf@gmail.com> References: <87zg6pln5l.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16902"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Platon Pronko , Ma Gelan Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 05 09:04:58 2023 Return-path: Envelope-to: geh-help-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 1pupUv-000499-Df for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 05 May 2023 09:04:57 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pupUQ-0003cU-MD; Fri, 05 May 2023 03:04:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pupUJ-0003cB-KK for help-gnu-emacs@gnu.org; Fri, 05 May 2023 03:04:21 -0400 Original-Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pupUH-0007ot-Sc for help-gnu-emacs@gnu.org; Fri, 05 May 2023 03:04:19 -0400 Original-Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1ab01bf474aso10206785ad.1 for ; Fri, 05 May 2023 00:04:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683270255; x=1685862255; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=dfk/kPYLq0tF/14S3rjU7mRtTE5PZ7aHHG9eWBuazXw=; b=EcjZf1k2vekm/VfTqwHKd96qlJN0e4fNF/Ae6B2ooWWkrRJa90vP5B3qje0PxucgWM aUidxg1LdGGNOGfdbkuyz1/Z/PicGlhdqoSni4Vczl39xyyEvgxRVF8g8K+XgTEwdBUj 4Jn8zj1eQ3CNYMzzQC7n9GlGQQSRMbwNSRYYDX6Jo/FRPPiKBYyn3/skPicGw0Mdvo60 82WFMVMggxxeasH2pmFIrJ5kDW53hToTGavcAMEc+QR9PX1jK9QU/WfaysEz1RDhOm95 QLpUirF4Ox6iOJYqVD8YbZAACYOXE934avdoxFrEWiPbzmbjISJeq83rRtgO2JGwyfTN Vgig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683270255; x=1685862255; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=dfk/kPYLq0tF/14S3rjU7mRtTE5PZ7aHHG9eWBuazXw=; b=N6tylkumNELoOHeeyp4H0wfUHZqaDfqLCc5GdK7kpRRgGrT08E9/u/UYEnDhkmJNXL N4eY26x4uu/QbLEbWuunbz5d0zIuA3lw2dYR9wGbBUPMQeqn+PIQL9oNjSYV29DsfKLN xbyDMEqTtCT1U+aaHAR62AM7wlGRA/LAmsJT4/k4bwAJZprMJdHYJsN/oNedIiUkj/1n Yi0vhdWi0mAW1l9xnBDfrdvCRM1ZUOK64fGPQQhxlIdsx2xsOUvEv5ZL6tATcQa0Wisj XVbuvjJt5dwvpNMdLAADadxEv8/cQjaPB8nG96lM+ZszOVi4r3vjhoAM2oqKMN+WqZ2M 5PVA== X-Gm-Message-State: AC+VfDy29EOR+hHCM9dnIAFlp8dfaUfaN8X72sN8AuUAh5aKwTfcw1Tm cEVseJcEE1ZMuZxbOP5X5+JmfMcgF1w= X-Google-Smtp-Source: ACHHUZ4E4+aoQ3DoXkEUsz8melpaQY0W90Gsvq1vZe3ILz8nN7kh6Fu408G49QRZqAx9eL6tilqgzQ== X-Received: by 2002:a17:903:50d:b0:1a2:8c7e:f315 with SMTP id jn13-20020a170903050d00b001a28c7ef315mr491042plb.21.1683270254672; Fri, 05 May 2023 00:04:14 -0700 (PDT) Original-Received: from localhost (softbank126171153174.bbtec.net. [126.171.153.174]) by smtp.gmail.com with ESMTPSA id jk1-20020a170903330100b0019e60c645b1sm876325plb.305.2023.05.05.00.04.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 May 2023 00:04:14 -0700 (PDT) X-Google-Original-From: MaGelan In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=magel4n@gmail.com; helo=mail-pl1-x634.google.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, 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: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:143519 Archived-At: Platon Pronko writes: Thank you for trying to help but I could not make this work. I don't know why but even with emacs -Q I cannot show the options right away. I think that once the completing-read gets the focus, the minbuffer is blocked and only after I force the refresh with Tab the options are shown. I tried with ivy and vertico so far. None of them solve the issue because it the issue is with the completing-read, I think. > On 2023-05-01 11:52, Ma Gelan wrote: >> Thank you for trying to help. >> >> I feel that I did not explain my issue well. >> >> I tried this: emacs -Q -l test.el >> >> With test.el having the code. >> >> What I get is two emacs frames. The main frame is on *scratch* buffer, >> and the other frame is just a miniframe. If I focus the miniframe I get >> the 'Select:' prompt, no options are shown. I expect to see a list of >> vertical options but they only show if I press tab. In this case they >> show in the other window, because that is the vanilla behavior in emacs, >> but In my version I have the completion directly in the minibuffer. In >> both cases, my configuration and emacs -Q, the options do not show right >> away, which means that I have to actively press Tab to show them. >> >> My question is: How do I show the options without having to press Tab? >> >> I would like to see them listed as soon as the minibuffer shows up. >> >> This happens in the same frame in my config, but it does not happen if >> I create a new frame. >> >> Here is more info: >> >> OS: Arch Linux >> Emacs: 28.2 >> WM: Sway 1.8.1 > > On my machine the completions are never shown right away, both in new frame an in current frame. > Here's the code I used to test completions in current frame: > > (defun test-this-frame-completing-read () > (interactive) > (completing-read "Select: " '("first" "second" "third"))) > > ;; invoked via M-x test-this-frame-completing-read > > My version is a bit newer (30.0.50, a57a8b75f50b), so there might be some changes between versions that resulted in options not being shown immediately. > > > Maybe you can try using Ivy package? It provides an improved completion backend. I've tested it with the following code, works for me (completions are shown immediately): > > (defun test-miniframe-completing-read () > "Test miniframe completing read" > (interactive) > (with-selected-frame (make-frame '((name . "emacs-miniframe") > (minibuffer . only) > (width . 120) > (height . 33))) > (unwind-protect > (let ((choices '("first" "second" "third"))) > (completing-read "Select: " choices)) > (delete-frame)))) > > (require 'package) > (package-initialize) > (ivy-mode 1) > > ;; M-x test-miniframe-completing-read