From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Spyros Roum Newsgroups: gmane.emacs.devel Subject: Re: Add completion to compilation-read-command Date: Wed, 25 Dec 2024 15:44:42 +0000 Message-ID: <962064f8-fab7-4867-af04-135e48a9dd15@posteo.net> References: <87ttatb9g0.fsf@posteo.net> <87a5clm3p5.fsf@mail.linkov.net> <8734icaegs.fsf@posteo.net> <9a4bb215-561c-468f-97de-7d84fe7adc43@posteo.net> <87ttas80au.fsf@posteo.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------g2OEW5RCzEzVBgFOSg0kAYXQ" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28580"; mail-complaints-to="usenet@ciao.gmane.io" Cc: juri@linkov.net, emacs-devel@gnu.org To: philipk@posteo.net Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Dec 25 16:45:41 2024 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 1tQTZt-0007KH-IW for ged-emacs-devel@m.gmane-mx.org; Wed, 25 Dec 2024 16:45:41 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tQTZ3-0004dh-MW; Wed, 25 Dec 2024 10:44:49 -0500 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 1tQTZ1-0004dJ-F9 for emacs-devel@gnu.org; Wed, 25 Dec 2024 10:44:47 -0500 Original-Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tQTYy-0004r2-Ab for emacs-devel@gnu.org; Wed, 25 Dec 2024 10:44:47 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 8BD6F240101 for ; Wed, 25 Dec 2024 16:44:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1735141472; bh=HxM1rbdBB3IToi337ntALFbpOnDX1eRJK97AMfEWVj4=; h=Content-Type:Message-ID:Date:MIME-Version:Subject:To:Cc:From: From; b=rnmIUz/0SBVpUMqrmG2ndmviYHgjbWjmEA9Ai7AvDqICj9cARkSztDLHm8vQvm7bU 9uE51s2GDx+IKTo0NQluf006I016kcOyIUfzUXSPhMtCzyTjantN7TeleP5i68/oYn n/g2/5MNmU63i8xqyM/XaQBN8j9KRdf55b4k18fge3BIF/MlcMSywHhXp1VViTA07L bSMepFRqGh1csc0J2ECb1JFejTOCpBKtdo1GtF+3fmZyZA10lY5kdX2liHmua/kDjY fjq1xOKe2jZ2zml68S9Eha4KUVaKN1eXrBi9t0nAGGvSwChaz6JG9DvYvCxj0Qp6eN jLh7jeF/VDfow== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4YJGKD0DRJz9rxD; Wed, 25 Dec 2024 16:44:31 +0100 (CET) Content-Language: en-US, el, el-en In-Reply-To: <87ttas80au.fsf@posteo.net> Received-SPF: pass client-ip=185.67.36.66; envelope-from=spyros.roum@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:327107 Archived-At: This is a multi-part message in MIME format. --------------g2OEW5RCzEzVBgFOSg0kAYXQ Content-Type: multipart/alternative; boundary="------------KR3YclB1TvQSpnQudP8URbfT" --------------KR3YclB1TvQSpnQudP8URbfT Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Philip Kaludercic wrote: >> To make sure I understand correctly, when using `completing-read` to >> read user input, that is narrowing, >> while the `C-x ` and *Completions* buffer is completion. > No, `completing-read' just invokes an interface, that frontends can > implement a UI for. The default UI provides a completing/expanding > interface, while Vertico, Helm, Ivy, etc. do selecting/narrowing. When > using `completing-read' you cannot really assume one or the other, so in > effect one has to find a middle ground. It is best you try your code in > emacs -Q without any changes and see how it behaves. Things like SPC > doing something else than you would expect is just one pitfall, others > I can recall are providing text that is difficult to input (I wrote a > package a few years back called "insert-kaomoji" that used > `completing-read' to prompt the user eastern-style emoticons; it is easy > to use with a selecting framework, but more inconvenient if the user is > first made to complete a string that is difficult to write, as most of > the characters are not easy to type). I tried the attached patch with `emacs -q` and now I understand how this would be very annoying without something like vertico installed haha. Nevertheless, it seems to work! I'm attaching a patch based on the conversation so far to get feedback on. I believe I should also write something to the NEWS file. Also, I'm wondering if this counts as non-trivial enough that I would need to sign the FSF copyright. Regarding testing, as far as I can tell, there are currently no tests for `compilation-read-command`. Should I add anything? If yes, I'll probably need someone to point to existing tests for similar things that I can copy from. Am I forgetting anything else? --------------KR3YclB1TvQSpnQudP8URbfT Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit
Philip Kaludercic wrote:
To make sure I understand correctly, when using `completing-read` to
read user input, that is narrowing,
while the `C-x <up>` and *Completions* buffer is completion. 
No, `completing-read' just invokes an interface, that frontends can
implement a UI for.  The default UI provides a completing/expanding
interface, while Vertico, Helm, Ivy, etc. do selecting/narrowing.  When
using `completing-read' you cannot really assume one or the other, so in
effect one has to find a middle ground.  It is best you try your code in
emacs -Q without any changes and see how it behaves.  Things like SPC
doing something else than you would expect is just one pitfall, others
I can recall are providing text that is difficult to input (I wrote a
package a few years back called "insert-kaomoji" that used
`completing-read' to prompt the user eastern-style emoticons; it is easy
to use with a selecting framework, but more inconvenient if the user is
first made to complete a string that is difficult to write, as most of
the characters are not easy to type).

I tried the attached patch with `emacs -q` and now I understand how this would be very annoying without something like vertico installed haha. Nevertheless, it seems to work!

I'm attaching a patch based on the conversation so far to get feedback on.

I believe I should also write something to the NEWS file.

Also, I'm wondering if this counts as non-trivial enough that I would need to sign the FSF copyright.

Regarding testing, as far as I can tell, there are currently no tests for `compilation-read-command`.
Should I add anything? If yes, I'll probably need someone to point to existing tests for similar things that I can copy from.

Am I forgetting anything else?

--------------KR3YclB1TvQSpnQudP8URbfT-- --------------g2OEW5RCzEzVBgFOSg0kAYXQ Content-Type: text/x-patch; charset=UTF-8; name="0001-Add-option-for-making-compilation-read-command-use-c.patch" Content-Disposition: attachment; filename*0="0001-Add-option-for-making-compilation-read-command-use-c.pa"; filename*1="tch" Content-Transfer-Encoding: base64 RnJvbSBlMTA2ODIwNjY2MjkxMzk3OGQ1NDFmOTI0MjA1YTA2MTVmOGQyZDk1IE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBTcHlyb3MgUm91bSA8c3B5cm9zLnJvdW1AcG9zdGVv Lm5ldD4KRGF0ZTogV2VkLCAyNSBEZWMgMjAyNCAxNzozMjozMSArMD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