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 20:34:21 +0530 Message-ID: <87cyhecwp6.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> <87ldw2d1m2.fsf@gmail.com> <0a433f95-62cb-4941-a1fb-0a5266a3c9b2@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="40463"; 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 16:05:28 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 1tQpQV-000AQX-W9 for ged-emacs-devel@m.gmane-mx.org; Thu, 26 Dec 2024 16:05:28 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tQpPZ-0008Q8-QY; Thu, 26 Dec 2024 10:04:29 -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 1tQpPX-0008Pm-L0 for emacs-devel@gnu.org; Thu, 26 Dec 2024 10:04:27 -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 1tQpPW-0004hC-3a for emacs-devel@gnu.org; Thu, 26 Dec 2024 10:04:27 -0500 Original-Received: by mail-pl1-x642.google.com with SMTP id d9443c01a7336-2166360285dso76409145ad.1 for ; Thu, 26 Dec 2024 07:04:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735225464; x=1735830264; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=udB2ob4J5oOu0zOTnpAmLrR9fiYI56FtQWDPamuwdXg=; b=W75arxQ/pYMSse7hfrcRbRavvJgVENDQmZ3LY+Chih+Tcdxke5NgDVDrnHoFR+EjBN RHSgCJbNVvEWkNW4hPcqXVo9SWh4oeEYpHn61l/oChPNgSNjk7Td/9FOQHiAf6l2qkzR nviY+ZS/hnJwhNDw08riiY4FG/goXQcLr93v3fMSVE8TLHigZ9WtC9iLpQSppoPIWVS3 Ld4OJSmRBg1OYXo1LtV2WTHoV/JrTA26feeGCF2cWdoyyhu+44pHcaED7y8rtiNjtflV yoYpuAFCJ0JVJkrXpe7F11gQ6O1tagPNW9C20Av1yK9b77YqphSa5WZmu3pFqLO/7Z8L RFyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735225464; x=1735830264; h=content-transfer-encoding:mime-version:user-agent: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=udB2ob4J5oOu0zOTnpAmLrR9fiYI56FtQWDPamuwdXg=; b=gY9y5Ekv7jzKKETUKVGhjh9dcXP8RyIo+oszJMLEfFCG/Q3SamvWyoN6ezMFK6wP0B IdCH5yQ/FiEBese1/6rKq/TyN8t542VAGs3x/Iqi1H0jg8soAsjxXTHSWiq3VuuFZW12 epGTqt63Y0S5+yh4i3UwjHT6duScnBnPUcaQ3lz4QQlpOHSe57tzkNIUf4glbaWBJLO8 IsfNZk17iqvAX3AbClSnqpOzw9hcKhSyKz7yt7VwiNfVXQSXSC6N6BaFJYGaaWvduS26 B+kglga97Nb8OgVkUlLGecp+rB+PeUuelTS8nGf7Tt3wfQ6iIWH5ZnSE+iOOwZcJlmBY ibaw== X-Forwarded-Encrypted: i=1; AJvYcCVjtrmyLXn1kjdVCKoiWQ6zpoQBumiGNwlaDCpbbmDB8Bm/IfFwdAyS0axduJFqEv/dDBN7bcGiHyCXPA==@gnu.org X-Gm-Message-State: AOJu0YzL5N30ftehnynu0xbJ27nP1/PUdsuzmnkDAhlJ+xpsHeEnulPa FsWgJkWbiNmyBAPz3v5h0th0vODwsT5FUlUOQlmzfVNJNip0eBSH X-Gm-Gg: ASbGncsvfZDjHvKH6hofOZQXNzX/AZBmloGdPKB2XclWYjL7sPUD+ff/InGRKpSjJ5i i1H8ALh2on2pKWA9FexsGhl88dY4DDk9SzlGP90hyj9mhPm//+LJ/y57yKS+kXbbnd2xmdg9X1r YExadtAZacAlpNcDzBVsLzYWctsuzyEmuLmPc8QsnadYacnruczWvoxq73voiKbqg/P3v10DtA+ kaUf/xtEdhTqjQmUT9mZH0NHYxq6jcJw2BAovTJQRel4A0pU/E= X-Google-Smtp-Source: AGHT+IGUesujVGV12dUDU0dgmXmshkC6J1Kc/ukr3j+HpXxQ9sRvx93SWyS5xwDGZbE8hFFU1IB6Ew== X-Received: by 2002:a17:902:eccf:b0:215:e98c:c5c1 with SMTP id d9443c01a7336-219e6eb45e0mr273311375ad.30.1735225464325; Thu, 26 Dec 2024 07:04:24 -0800 (PST) Original-Received: from localhost ([49.205.85.12]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc9cdf02sm120960585ad.151.2024.12.26.07.04.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Dec 2024 07:04:23 -0800 (PST) In-Reply-To: <0a433f95-62cb-4941-a1fb-0a5266a3c9b2@posteo.net> (Spyros Roum's message of "Thu, 26 Dec 2024 14:46:03 +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:327151 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: >>> +(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 inst= ead 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). > > I like this suggestion, and it made me realize that even though I use > `:options`, there is no actual list of > options in the customization interface, which seems weird. > > [...] > +(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 > + '(choice > + (function :tag > + "Read command using read-shell-command" > + compilation-prompt-read-shell-command) > + (function :tag > + "Read command using completing-read, completing on compile-history" > + compilation-prompt-read-with-history-completion))) I *think* this prevents adding a custom function from the Customise interface since we don't have a "any function" choice, and would warn when you say (setopt compilation-read-command-function #'any-other-function-other-th= an-two) Unfortunately, I do know how to go about adding it myself since I am unfamiliar with defcustoms.