From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Visuwesh Newsgroups: gmane.emacs.devel Subject: Re: Add completion to compilation-read-command Date: Thu, 26 Dec 2024 18:48:13 +0530 Message-ID: <87ldw2d1m2.fsf@gmail.com> 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> <962064f8-fab7-4867-af04-135e48a9dd15@posteo.net> <87ldw390ql.fsf@posteo.net> <4a27c5d7-b207-4bf1-a01b-552bf88a6347@posteo.net> <877c7m8ygh.fsf@posteo.net> <25958644-5b99-4611-b6ae-ce8448fb662f@posteo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15387"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: philipk@posteo.net, juri@linkov.net, emacs-devel@gnu.org To: Spyros Roum Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Dec 26 14:19:02 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 1tQnlW-0003rs-8X for ged-emacs-devel@m.gmane-mx.org; Thu, 26 Dec 2024 14:19:02 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tQnkr-0004lS-Od; Thu, 26 Dec 2024 08:18:21 -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 1tQnkq-0004lE-3S for emacs-devel@gnu.org; Thu, 26 Dec 2024 08:18:20 -0500 Original-Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQnko-00049k-Be for emacs-devel@gnu.org; Thu, 26 Dec 2024 08:18:19 -0500 Original-Received: by mail-pl1-x642.google.com with SMTP id d9443c01a7336-21669fd5c7cso75238395ad.3 for ; Thu, 26 Dec 2024 05:18:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735219097; x=1735823897; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=w/KsO3qyfcgGCpZkcB6TTqrwB3ygZGVcihYYUfRTUCk=; b=nLQm5Maxbzi+JKkajhoPqknjIi4p5++EGq8G7mPCNICwpjoL4/LmWtdBUe4JlEcN3z LLRFvIZfCEAPGBPa1ORW9trp6yadipILTx67J0wrmalfA04snlTETZjWFPtirw3E5tC1 xEeCEOnK8rEd3R/mG+xTBbWn87mgErTbkMBfA6iRmz994KKBvqhNGO1nwHJ8tnwUpCcs h8RiGvKXSkO4Gzzv+1+DEAtaJhwXMg964DS+KpHxff5uI9eEy4GOcJeouUlq+8t8a4EY DdrXGGwLo1j5Hkl+0giSfASJFgC4IX7GFFEzG5Vjy+GCD2JN4LMpF940P+nE6wmXqrV6 c73A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735219097; x=1735823897; h=content-transfer-encoding:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=w/KsO3qyfcgGCpZkcB6TTqrwB3ygZGVcihYYUfRTUCk=; b=Z4voyYVlRWgwQPJgnDAbFEAXuoq1J55ebT9YFiH//NXHzUp/mpzdb3pdnOi4vSthKR Oa8xZg9CjNHKEYkguLaSW+HdttMPm2M1/nSazP3sIcbOJUI3WLYcOLB92PcBuA7GkIdt dfXapBmBhcMsRSmvYawkX15U4vWCfYOJfw6BUjJXgkCAHRrMalEHqEQw1oXN2hld+ja1 onNMXrDdXdb9bCLt1HhhDnzl1O4f7P8ezHwjn61P55Prd6N2rDxyD785cT36ThifKV3X tnUY3O9Ay1PWpYFlTb8OSvv7a6CKOvu2A1xxRt1S8R/VEKXjX60N283itkKMhl6O3Z5R GCfg== X-Forwarded-Encrypted: i=1; AJvYcCU1N1Xv832QzSzxi9hIuCe+L1Qb8INj021i1WPsDtxGtvZMvlqzonNTF6+42HRrWIT9C0D1xEEJtiNzyg==@gnu.org X-Gm-Message-State: AOJu0YyI32Rt4gTxF9PxwyQHkG/ysXNLjB0MjyMMUsOxKeIZRBIYDBmq eCNCpiZbSCS707ZLrZwMu6lB6fykH84D9qOrTjTjOzZsTCgiKc9ww5AhBoLJ X-Gm-Gg: ASbGnctNRyc/jifHKv0EfFqgHUOWoPqvkqlSEfjUbpwndTo8wpfTOaUN8pryUAzlZEa 0H5d83Rk0numYMajmpmPSBIdAueqQ2jJfEVyflZEfsPHBAwVpmzWMNBS6eTGIBly1hwosAwHzsg F6qI99uBfJhaprKAsn2PaRJhXoOtRMNThvCyAP1TpKNtfeQ5uARrYJHQ//ENdS/srZ1pB9KJ7V8 cyGk+SyedCvOdINMCso/+TRzSPJmsAHipiF23Lpf1jqsq/Ibb8= X-Google-Smtp-Source: AGHT+IFAfVmIm8rs+BxdQKYDJYpc8nVnZzJPKSr0kVTd0C6s/tHM0QQugOyydwz6KBU4nav8VKnfxg== X-Received: by 2002:a05:6a21:1693:b0:1e0:d89e:f5cc with SMTP id adf61e73a8af0-1e5e04605a0mr37004761637.11.1735219096758; Thu, 26 Dec 2024 05:18:16 -0800 (PST) Original-Received: from localhost ([49.205.85.12]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad6cc885sm12908269b3a.0.2024.12.26.05.18.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Dec 2024 05:18:16 -0800 (PST) In-Reply-To: <25958644-5b99-4611-b6ae-ce8448fb662f@posteo.net> (Spyros Roum's message of "Thu, 26 Dec 2024 13:13:30 +0000") Received-SPF: pass client-ip=2607:f8b0:4864:20::642; envelope-from=visuweshm@gmail.com; helo=mail-pl1-x642.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 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:327149 Archived-At: [=E0=AE=B5=E0=AE=BF=E0=AE=AF=E0=AE=BE=E0=AE=B4=E0=AE=A9=E0=AF=8D =E0=AE=9F= =E0=AE=BF=E0=AE=9A=E0=AE=AE=E0=AF=8D=E0=AE=AA=E0=AE=B0=E0=AF=8D 26, 2024] S= pyros Roum wrote: I don't really have much to say about the change but: > [...] > I based the entry on a similar entry from a few lines up: > > =C2=A0 > *** New user option 'completion-pcm-leading-wildcard'. > =C2=A0 > This option configures how the partial-completion style does > completion. > =C2=A0 > It defaults to nil, which preserves the existing behavior. When = it > is set > =C2=A0 > to t, the partial-completion style behaves more like the substri= ng > =C2=A0 > style, in that a string being completed can match against a cand= idate > =C2=A0 > anywhere in the candidate string. > > If you think however that the options are not necessary, I can keep > the first sentence only. > > Patch attached has the corrected `:version` and ChangeLog, no other > changes (also rebased to master). > From fa17714fcb12079bc37e5be54fe6b2a68bcd34ff Mon Sep 17 00:00:00 2001 > From: Spyros Roum > Date: Wed, 25 Dec 2024 17:32:31 +0200 > Subject: [PATCH] Add option for making compilation-read-command use > completing-read > [...] > diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el > index 6784a12fd63..d0da96069af 100644 > --- a/lisp/progmodes/compile.el > +++ b/lisp/progmodes/compile.el > @@ -1797,12 +1797,38 @@ compilation-mode-font-lock-keywords > '((compilation--ensure-parse)) > compilation-mode-font-lock-keywords)) >=20=20 > -(defun compilation-read-command (command) > +(defun compilation-prompt-read-shell-command (command) > (read-shell-command "Compile command: " command > (if (equal (car compile-history) command) > '(compile-history . 1) > 'compile-history))) >=20=20 > +(defun compilation-prompt-read-with-history-completion (command) > + (completing-read "Compile command: " compile-history > + nil nil command > + (if (equal (car compile-history) command) > + '(compile-history . 1) > + 'compile-history))) > + > +(defcustom compilation-read-command-function > + #'compilation-prompt-read-shell-command > + "`compilation-read-command' uses this function to get user's input. > +Defaults to `compilation-prompt-read-shell-command', > +but 'compilation-prompt-read-with-history-completion' can be used instea= d for > +a completing version based on past runs." > + :version "31.1" > + :type 'function > + :options > + (list > + #'compilation-prompt-read-shell-command > + #'compilation-prompt-read-with-history-completion)) It would be nice to say what these options mean in plain English (with :tag IIRC).