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:12:18 +0900 Message-ID: <87ednv2qwd.fsf@gmail.com> References: <87zg6pln5l.fsf@gmail.com> <87h6sr2ra6.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="18731"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Platon Pronko Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 05 09:13:23 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 1pupd4-0004hw-Rn for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 05 May 2023 09:13:22 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pupcQ-0005w5-Uo; Fri, 05 May 2023 03:12:43 -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 1pupcI-0005ou-3d for help-gnu-emacs@gnu.org; Fri, 05 May 2023 03:12:34 -0400 Original-Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pupcF-0001SQ-1R for help-gnu-emacs@gnu.org; Fri, 05 May 2023 03:12:33 -0400 Original-Received: by mail-pg1-x535.google.com with SMTP id 41be03b00d2f7-51f597c975fso1284736a12.0 for ; Fri, 05 May 2023 00:12:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683270750; x=1685862750; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=wMnz+CS+lkw1VnDyeUognzC0k7pVKfsjQM0C/9eZl/w=; b=aZd2YVbIGC6SRpAqyg1yu9+PBx5FvoH1FhJCaUualV9XFNNjPH7kRZuB3Zx993n15R oL5f0vlFfo4892TzjYr3iUuE+6l87Oz89ooBAyGBajJw1RJvGk2ar6qj0U0aZgGj8qW5 J81vgJArCQ/HbikkIl8PofmdDHQRjw9axg/ahdV3BZvclJZVJMlTnU6XVboBG7NmiOp7 fBnnGfAJsqxJ0nlvVVzxreD6exqggz1WK7yl9tt+EoOYRuCdF02RzjcLDSzpy63J2kVZ RxPuFldAC7clD7iloZbGAJUTs6s2EizLrLy8T23/1CQI4N5QL5BqEtw7gxMipRAPe8fc WgYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683270750; x=1685862750; 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=wMnz+CS+lkw1VnDyeUognzC0k7pVKfsjQM0C/9eZl/w=; b=TQwcrMyayIAKqxJa/1vbzifASbx5VEWTsfERJOP2cyTddMlMTo7gBBZuUPTv0JWA8z 9qspiO0C/YjbqIhrNLo/ScTZLYiA456BfcBteS04Y0wUe2rE8ByzqIxXJVf+qsHGY/HY 77fVXIoxyZY2EeqguDnkL3BInLFapOjPEDS+pyGIfDNc46H6tJJyX0+8ZccTj+dapZm6 /BjQJb2QqO6BQvKF+5qqm8b/6t9Y7W9oGqdmEPMOkqF4DmpBR1XuJQvL0Xud02Esuwke x49jPuZLh2mgRIGmSE7O0PAvMk3KCyP2c4O9BpiTer0x4/+mRWBM1HoVZxI6mhgElpya W91w== X-Gm-Message-State: AC+VfDwh7FUZGcuu2BPmNC525vFiKGiVLp+PRNxkTNdwRrGTYDmr34EZ KVBS1vlhMc6dLYYkz1zw6Qc= X-Google-Smtp-Source: ACHHUZ7pROd0TZZEHZVdMi2djvAJygHw7FfoXUmlubK2FH5Ywc8WgqQ6PESz/5h6CU7BkfbeVI2Ztg== X-Received: by 2002:a17:903:1209:b0:1a8:1867:1f7c with SMTP id l9-20020a170903120900b001a818671f7cmr492705plh.40.1683270749713; Fri, 05 May 2023 00:12:29 -0700 (PDT) Original-Received: from localhost (softbank126171153174.bbtec.net. [126.171.153.174]) by smtp.gmail.com with ESMTPSA id s8-20020a170902ea0800b001a95928e9a5sm918181plg.121.2023.05.05.00.12.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 May 2023 00:12:29 -0700 (PDT) X-Google-Original-From: MaGelan In-Reply-To: <87h6sr2ra6.fsf@gmail.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::535; envelope-from=magel4n@gmail.com; helo=mail-pg1-x535.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:143520 Archived-At: MaGelan writes: It works! Ivy is able to show the options. You are right. I forgot to install ivy package when I launched emacs -Q. Thank you a lot!! > 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