From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: "Philip K." Newsgroups: gmane.emacs.bugs Subject: bug#41408: Add a project-compile command Date: Tue, 19 May 2020 20:24:48 +0200 Message-ID: <87blmjbx5b.fsf@warpmail.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="129038"; mail-complaints-to="usenet@ciao.gmane.io" To: 41408@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 19 20:29:51 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1jb6zt-000XKW-Ss for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 19 May 2020 20:29:50 +0200 Original-Received: from localhost ([::1]:41986 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jb6zs-00039M-Py for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 19 May 2020 14:29:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42172) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jb6wF-0005rU-1R for bug-gnu-emacs@gnu.org; Tue, 19 May 2020 14:26:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39388) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jb6wE-0000gI-N3 for bug-gnu-emacs@gnu.org; Tue, 19 May 2020 14:26:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jb6wE-00025v-7G for bug-gnu-emacs@gnu.org; Tue, 19 May 2020 14:26:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Philip K." Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 May 2020 18:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 41408 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15899127077957 (code B ref -1); Tue, 19 May 2020 18:26:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 May 2020 18:25:07 +0000 Original-Received: from localhost ([127.0.0.1]:50927 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jb6v9-00023h-TK for submit@debbugs.gnu.org; Tue, 19 May 2020 14:25:07 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:50744) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jb6v8-00023Z-EU for submit@debbugs.gnu.org; Tue, 19 May 2020 14:24:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42064) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jb6v8-0003Xs-3f for bug-gnu-emacs@gnu.org; Tue, 19 May 2020 14:24:54 -0400 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]:44895) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jb6v7-0000PU-1u for bug-gnu-emacs@gnu.org; Tue, 19 May 2020 14:24:53 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 2D4605C019A for ; Tue, 19 May 2020 14:24:52 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Tue, 19 May 2020 14:24:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=warpmail.net; h= from:to:subject:date:message-id:mime-version:content-type; s= fm3; bh=IE6FrRWdK/WIxfq+EK1TQzY8bvP9qWBK9PwM8jQdvaY=; b=NIgYtE/m Ci8nh9GUUVOIocV5aZCX1rHemm+jeVW4Fl5qqcryDokVJ8NjPy4UcKrmgNe5DG86 I2qMuH/xklIkNzm54hJBcWCEdECUwlwTtmBQWDcERG8ou5E+1OzNhecrSd1lSixu hjo4sLCrEnejDDFcFQynUpcN3ZM5IqXdfB2opHA65Q/PAnvKZ61rGddNfrkedwz0 aIXvGN03DbDInwv2XfWIJ4iBi0uLmhVlLtcGuyCEPLtfdtsA+ht5K6ieXKVndyWh WvmeaVwB1YBGnXOWZTgEkw24bfzrDgcO1I10X0RrkdSIhIw6QJw123BkWsquGpj8 6+mQ1+JRZo50pg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=IE6FrRWdK/WIxfq+EK1TQzY8bvP9q WBK9PwM8jQdvaY=; b=4O6LNh85pI6dp7tP+eMVry5DO67auhKADu0l5tF9FbXTc ApSvGTQtHDjX9YvzJ4YoDrNOM7G7wZ7skS3ovOi89MNK9riaINT8ScljBPzqz1R1 cwoYyfGamX8UwyG6lquGwZts/OlNju/KMD+XfpfWp99Ig8Xnh/GeDeRM2C0zUzx5 ckadmiwrZHpZinkp5ETKXQTUKI7XZtGCBbRzncruBpIMyAHM1mIjs5cVnTW+GVnP OdiOkSbVM0pTRHKatPVMyDxtOgklI39K6082LL8nh74Eb8Fbx71nlMg3MCy6fOvO hzRUB/9ta6DZnFCkTVl03E7BEl8Re3Ge8vK5lwwfw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedruddtjedguddvfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkfggtgesmhdtreertd dttdenucfhrhhomhepfdfrhhhilhhiphcumfdrfdcuoehphhhilhhiphesfigrrhhpmhgr ihhlrdhnvghtqeenucggtffrrghtthgvrhhnpeegieegieeggeehhfeijeeffeegfedtve elvddvueeiheelfefggeelkeelteduudenucffohhmrghinhepvghlrdhithenucfkphep keejrddugeehrddutddrheeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomhepphhhihhlihhpseifrghrphhmrghilhdrnhgvth X-ME-Proxy: Original-Received: from localhost (p57910a3a.dip0.t-ipconnect.de [87.145.10.58]) by mail.messagingengine.com (Postfix) with ESMTPA id A749B328005E for ; Tue, 19 May 2020 14:24:51 -0400 (EDT) Received-SPF: pass client-ip=66.111.4.28; envelope-from=philip@warpmail.net; helo=out4-smtp.messagingengine.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/19 13:27:43 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:180607 Archived-At: --=-=-= Content-Type: text/plain Hi, this patch adds a `compile' command for project.el. It's nothing fancy, just sets the first directory of `project-roots' as `default-directory', and then calls the regular compile. The TODOs mention a `project-build' command, and from my interpretation, this is a slimmed down version (hence the other name, but also because it just called compile in a different environment). -- Philip K. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Add-project-compile-command.patch >From d4aa98e6b01e95f50dc9c6ec02792d4fce542b22 Mon Sep 17 00:00:00 2001 From: Philip K Date: Tue, 19 May 2020 19:30:14 +0200 Subject: [PATCH] Add project-compile command --- lisp/progmodes/project.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 44259990bb..15b5899140 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -590,6 +590,18 @@ project-read-file-name-function (function :tag "Custom function" nil)) :version "27.1") +;;;###autoload +(defun project-compile () + "Run `compile' in the project root." + (interactive) + (let* ((pr (project-current t)) + (roots (project-roots pr)) + ;; TODO: be more intelligent when choosing a directory. This + ;; currently isn't a priority, since no `project-roots' + ;; implementation returns more that one directory. + (default-directory (car roots))) + (call-interactively 'compile))) + (defun project--read-file-cpd-relative (prompt all-files &optional predicate hist default) -- 2.20.1 --=-=-=--