From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Platon Pronko Newsgroups: gmane.emacs.help Subject: Re: completing-read does not display options in new frames Date: Mon, 1 May 2023 13:52:10 +0800 Message-ID: References: <87zg6pln5l.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18533"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Cc: help-gnu-emacs@gnu.org To: Ma Gelan Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 01 07:53:01 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 1ptMT6-0004fc-ID for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 01 May 2023 07:53:00 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ptMST-00030f-63; Mon, 01 May 2023 01:52:21 -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 1ptMSQ-000308-C3 for help-gnu-emacs@gnu.org; Mon, 01 May 2023 01:52:18 -0400 Original-Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ptMSO-0007fu-Ns for help-gnu-emacs@gnu.org; Mon, 01 May 2023 01:52:18 -0400 Original-Received: by mail-pg1-x532.google.com with SMTP id 41be03b00d2f7-51b603bb360so1832922a12.2 for ; Sun, 30 Apr 2023 22:52:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682920335; x=1685512335; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=rCZsck51FQDsRFNDq03BdqZwAHgbwGThnj2PELlWjSA=; b=AbLF5/eNA1cxOJvM1GlwhcReXkPYVnXBrKqbyj2zLTn7Tr087OM4KyeEIfBnRs5ZUQ Z0kJ2oA21cdXw06yRPirclQTLZd+wX+HjxTYxeVGfTf6DxNPz8kDH3c9qvtgeqZgkqRj wnUfdpdVGQkxM9zj+vHf03A01j1fuUyNJSPoqM3yatoRhpfgfNMY1epZnjdNMRxPK3SF alLcxtWtFGToDvAp9PYxi4aM0gGYnLEkPldOpmiK3x/PwD5p8ONPie9KccE9Dgu+otV9 VPGTsJoJ97TVKUGMLsaVgYi4BGU6ThKeqyBmYzqF9msW/dRmTqBtq6JOVOm9bUly2+af LctQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682920335; x=1685512335; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=rCZsck51FQDsRFNDq03BdqZwAHgbwGThnj2PELlWjSA=; b=Ubr+foywRl5GNq4tsCzxM1TxC/aqM+Mk/rxR4LLc2O/NCbpSBdZ0fX5PxLy0tH4GCM BI8sUHGwWqOQ85R7xAWpuPu3x4815nX2Xk3VWq6x9CAPs3nHBy3j59yRp5DAj3k8coiQ ulIiNaMyEEEn34hrAj8mcdAjl0yBiflmqlCjXrPW/1qkob5+K/PrIaTqwFeaLXrFgiyt KSTo/V+ETgk2XEHjHO/eyFZFm6sefrL2+MKGCMITpYvuieORk7WAxQCTTkPZD8K0K5ur ixdcznG86ocZ+4nNiNLBLsD+vE89hzjU799Du7JIcKgKd9fWRbEwvt6pe82vaG6tYjbr Wjrw== X-Gm-Message-State: AC+VfDzU/sGN8n/aVV9SHHtgJYQXiugVuQkwQ/dMoVizg5tP39aqypG1 6SreRIl9NTjjUgBR47V4rGE= X-Google-Smtp-Source: ACHHUZ5KFlUPqfz1UFw/OLuYpeb7CncPnicN0FQ9TtTq0eu0ga06Y6t5sjSq6Go4cZWUiF1FW9E6+w== X-Received: by 2002:a17:902:d4c6:b0:1a6:71b1:a0b9 with SMTP id o6-20020a170902d4c600b001a671b1a0b9mr15400709plg.47.1682920334800; Sun, 30 Apr 2023 22:52:14 -0700 (PDT) Original-Received: from [192.170.1.133] ([103.24.106.35]) by smtp.gmail.com with ESMTPSA id w15-20020a1709029a8f00b001aafa2e4716sm691809plp.264.2023.04.30.22.52.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 30 Apr 2023 22:52:14 -0700 (PDT) Content-Language: en-US In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::532; envelope-from=platon7pronko@gmail.com; helo=mail-pg1-x532.google.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 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, NICE_REPLY_A=-1.422, 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:143473 Archived-At: 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