From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: Subprojects in project.el Date: Tue, 29 Nov 2022 10:17:59 +0000 Message-ID: <87r0xmqd2g.fsf@gmail.com> References: <87zgcq68zp.fsf@ericabrahamsen.net> <2ba04533-097a-a1da-ff3f-2c9506fd488e@yandex.ru> <875yf9bbzb.fsf@gmail.com> <87wn7oa0aw.fsf@gmail.com> <7a5b76fd-fb15-8c1e-ea29-bf11f7e0d2ae@yandex.ru> <87bkoya815.fsf@gmail.com> <0024a67d-b8e5-b35c-1b22-82541a170eb3@yandex.ru> <871qptai4d.fsf_-_@gmail.com> <33292672-2a59-ba63-05ab-a7995118a822@yandex.ru> <87pmdau6wo.fsf@gmail.com> <87zgcesg8l.fsf@gmail.com> <79a17a5c-d1c1-ce69-d29a-9127150fb1d7@yandex.ru> <87edtqrr0b.fsf@gmail.com> <0323877a-2198-c295-61c1-5fcb1813f409@yandex.ru> 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="5550"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Stefan Monnier , Danny Freeman , Eric Abrahamsen , emacs-devel To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Nov 29 11:17:47 2022 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 1ozxgQ-0001Cs-2P for ged-emacs-devel@m.gmane-mx.org; Tue, 29 Nov 2022 11:17:46 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ozxfg-0003CC-Tl; Tue, 29 Nov 2022 05:17:00 -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 1ozxfT-00038J-73 for emacs-devel@gnu.org; Tue, 29 Nov 2022 05:16:56 -0500 Original-Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ozxfR-0006PH-2m for emacs-devel@gnu.org; Tue, 29 Nov 2022 05:16:46 -0500 Original-Received: by mail-wm1-x336.google.com with SMTP id c65-20020a1c3544000000b003cfffd00fc0so13941492wma.1 for ; Tue, 29 Nov 2022 02:16:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=RdyE69CnLaxRouXUquoNCFq4+ehqemwhMKxaAuo6HlM=; b=eo4VF+9xyv+d/X5x9PaXVtVSf+LFx7Nsd5MAWvjDAtt4yyjPIzBpi/Eez2xEyMBFoV Dc1RupPFVlrnfw6xSu016XcQa01LFG2NopX8zaxEjdhOYeodkVQy4IGyWdOznJ6uVUY8 9SlaAYWzmo9UP8mnKtt2lp2ceKXBP79rrYzFLRTRfqiB5kEJF8ISn9kJ8U2wSEVustfC uYpbaLIi/Lvr6/MQgSVZDAtzxXmcTO5hiiM48lnLkXDwmVJ5NEcifJAsgwEVF6pdHflH /iGrLP2nGLfNhq0STDtSKKJ5mkt0R/7hGaYYIfHhx21sHpYPXShzG4vaBWFmMP5Xk5uQ x7Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=RdyE69CnLaxRouXUquoNCFq4+ehqemwhMKxaAuo6HlM=; b=dJg85rOJ1hSgkv/27Pyk+JzJGD+yX9VAepXgKJzPISdIx6JR4qnFecVr6ooSOIllJX LymfvVsYfo4yfFdcANUPZuw0YCoF2HAtkufLuWAy6zqsXE8xOs1EufNKdP84acO7wjqY S3OvamnB6JgbNa9eULapgDRGq+rE7XCHvEf4ixYiO3AFn2ZNe1GO66I5hHQOU6ky6tLv fAFqArJexWPGXRLcrE8IN3dVSiDTwO4nWwrSdpsI7aT74cMbCI1xXAi2DskE5QW+L86q NL7ssez8MHnAqBxSNDkha9XFSlzD/cNR232AX/Ed3YD7MY22iUhoeQgKYG9SE+8hPUIz Q4CQ== X-Gm-Message-State: ANoB5pnDYaWiG1ZervC+tHDBg2BWT8zmTD1YZ0MIjH/lnHPSEZ2FTxSo D/vg3s1Eh+fIpreodRg9ym7DnBfOUnI= X-Google-Smtp-Source: AA0mqf6YzO1+g8eeAjgax75LwMaVuVVKRmQt5Zn7oicHV16gXR/Hp/BCU026uW0HzDuUtQPSrYWEzA== X-Received: by 2002:a05:600c:a4a:b0:3cf:e138:cd80 with SMTP id c10-20020a05600c0a4a00b003cfe138cd80mr29058192wmq.78.1669717003237; Tue, 29 Nov 2022 02:16:43 -0800 (PST) Original-Received: from krug ([87.196.72.71]) by smtp.gmail.com with ESMTPSA id c12-20020adfed8c000000b00236b2804d79sm13251604wro.2.2022.11.29.02.16.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Nov 2022 02:16:42 -0800 (PST) In-Reply-To: <0323877a-2198-c295-61c1-5fcb1813f409@yandex.ru> (Dmitry Gutov's message of "Sat, 26 Nov 2022 14:38:22 +0200") Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=joaotavora@gmail.com; helo=mail-wm1-x336.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:300708 Archived-At: Dmitry Gutov writes: >> Hysterical raisins. >> >> But 'C-x p f' and 'C-x p g' call 'project-current' directly. What's >> that about some new command? > Don't know what you are talking aboutIt seems very reasonable to do > this instead: >diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el >index c7b2c386ccd..02f5d25e054 100644 >--- a/lisp/progmodes/project.el >+++ b/lisp/progmodes/project.el >@@ -1151,11 +1151,11 @@ project-compilation-buffer-name-function > (function :tag "Custom function"))) >=20 > ;;;###autoload >-(defun project-compile () >+(defun project-compile (project) > "Run `compile' in the project root." > (declare (interactive-only compile)) >- (interactive) >- (let ((default-directory (project-root (project-current t))) >+ (interactive (project-current t)) Sorry I hit "send" before I wanted to. This line of course be (interactive (list (project-current t))) And the docstring should be "Run `compile' in PROJECT's root." 'project-current', when called with MAYBE-PROMPT, is running in an interactive setting. It could then consult the value of the prefix argument and decide to prompt the user about which project to use (including super-projects). You can use this technique to a add PROJECT argument to all the other relevant project-* operations without breaking backward compatibility, even for non-interactive Lisp uses. In cases where a "P" prefix argument is already in use, like C-x p f, we'd have to repurpose the "negative prefix" part to _not_ mean INCLUDE-ALL. You'd affect only the people who are currently using M-- C-x p f instead of C-u C-x p f. Jo=C3=A3o