From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Add completion to compilation-read-command Date: Wed, 25 Dec 2024 19:32:43 +0200 Organization: LINKOV.NET Message-ID: <87pllf1yrw.fsf@mail.linkov.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> <962064f8-fab7-4867-af04-135e48a9dd15@posteo.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4671"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) Cc: philipk@posteo.net, emacs-devel@gnu.org To: Spyros Roum Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Dec 25 18:50:48 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 1tQVWy-00016h-5A for ged-emacs-devel@m.gmane-mx.org; Wed, 25 Dec 2024 18:50:48 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tQVWR-0005vs-Kf; Wed, 25 Dec 2024 12:50:15 -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 1tQVWP-0005va-Kv for emacs-devel@gnu.org; Wed, 25 Dec 2024 12:50:13 -0500 Original-Received: from relay8-d.mail.gandi.net ([2001:4b98:dc4:8::228]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tQVWN-0008Rv-TJ for emacs-devel@gnu.org; Wed, 25 Dec 2024 12:50:13 -0500 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 47B061BF203; Wed, 25 Dec 2024 17:50:04 +0000 (UTC) In-Reply-To: <962064f8-fab7-4867-af04-135e48a9dd15@posteo.net> (Spyros Roum's message of "Wed, 25 Dec 2024 15:44:42 +0000") X-GND-Sasl: juri@linkov.net Received-SPF: pass client-ip=2001:4b98:dc4:8::228; envelope-from=juri@linkov.net; helo=relay8-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-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:327116 Archived-At: > -(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))) > > +(defun compilation-prompt-read-command-with-completion (command) > + (completing-read "Compile command: " compile-history > + nil nil command > + (if (equal (car compile-history) command) > + '(compile-history . 1) > + 'compile-history))) Thanks. The only problem I see is that the function name doesn't indicate that it's completing on compile-history. Probably a better name would be: compilation-read-command-with-history-completion