From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Len Trigg Newsgroups: gmane.emacs.bugs Subject: bug#59868: 28.2.50; compilation-search-path incompatible with dir-locals Date: Sat, 10 Dec 2022 08:11:10 +1300 Message-ID: References: <83y1rj4bc2.fsf@gnu.org> <83a63x12ew.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000009df23905ef69ebd1" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2823"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 59868@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 09 20:12:22 2022 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 1p3inG-0000WM-3K for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 09 Dec 2022 20:12:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p3in2-0001tO-GD; Fri, 09 Dec 2022 14:12:08 -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 1p3imx-0001sw-05 for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2022 14:12:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p3imw-0008Nu-Hi for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2022 14:12:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p3imw-00022O-1r for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2022 14:12:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Len Trigg Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Dec 2022 19:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59868 X-GNU-PR-Package: emacs Original-Received: via spool by 59868-submit@debbugs.gnu.org id=B59868.16706130957822 (code B ref 59868); Fri, 09 Dec 2022 19:12:02 +0000 Original-Received: (at 59868) by debbugs.gnu.org; 9 Dec 2022 19:11:35 +0000 Original-Received: from localhost ([127.0.0.1]:37889 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3imV-000226-3B for submit@debbugs.gnu.org; Fri, 09 Dec 2022 14:11:35 -0500 Original-Received: from mail-oi1-f171.google.com ([209.85.167.171]:44941) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3imS-00021x-TX for 59868@debbugs.gnu.org; Fri, 09 Dec 2022 14:11:33 -0500 Original-Received: by mail-oi1-f171.google.com with SMTP id e205so5369850oif.11 for <59868@debbugs.gnu.org>; Fri, 09 Dec 2022 11:11:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=XM1HhZyuBP9+T/at+AEwRkmfoKvW7CNdFf/NKOEdCn4=; b=UeR2SQNZXnD3Q1EcuhCqwNGPyF71TwV6xuoOB6YWxZJIxzrV59K6lycNKNNRf7HbQ6 Czb9PVbqvF7i/AY3O87Dt/Jn2kOfdrQi0ARRCB5cnzZRnKSapURpKK2JStG0YpDB0XLB chA+mxPxkpvpOx8ezLHfpf77//Ht5hpzDSksFfAg0+BN2aMNZB/vNlpefpNbkivvYeK1 fsEtFmllUdq61V5PW80UgJL2oE846KghVxNzlYMOUB7iosvkbdojHijpMODm35l35yuO vBwNqCC1rrJj8pAwN/u8gE9XRJ19nS+M5dSEdDD74iA4T5GURLntnUBUmFu7CkMzMKVI 8KOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=XM1HhZyuBP9+T/at+AEwRkmfoKvW7CNdFf/NKOEdCn4=; b=ggoFxi3crutLjSIOC0XJA5StoGs8xIJxpr96MQuTHkxQcCTIqSJu5r5xfxDKEHgz8e AvLLtMZmyVpabOQRzoCtnD0yyuII80wo6mPso4UG5JF93zUpg3CwTRky/tEebuZFy/oA Iysw6C879p5KAuOc/hD3Xm3y5cRqHw/ilG2q4PGrsfCeWhqyIy0egFTuytTXbPBf/ryB +1BQh6Ml2qtnP7k8CQsiXPD+vgFmkXThIEtvmgfomtwVQYu9gfuPfMTsZq9DNt3jn7Bl ouPlwo1bzCh4rsXNniAPSR7JqoqBHLaE5L8Mu7LAIM4LtEgM6ekMWmnIIQDNdB7mTNPg x1Gw== X-Gm-Message-State: ANoB5pl93IBMCmcGzK1vkvCE0i7lgcO9om//4moAweNk4sCVJJHZiH/+ 9u7kbWLnQgEB6OD9GaV96eQzZ+vlR4iRoTOPiD+wv537ARM= X-Google-Smtp-Source: AA0mqf7cAUSYJFzK2r1QOARtyWGyyIJMmEiRbcRNCl2BWRehszg4AX/AEf7PGo1/NRGzWRt/8yWIQIiYEdyKJaAmNIk= X-Received: by 2002:a05:6808:2027:b0:35b:cfac:bc16 with SMTP id q39-20020a056808202700b0035bcfacbc16mr18323517oiw.64.1670613087153; Fri, 09 Dec 2022 11:11:27 -0800 (PST) In-Reply-To: <83a63x12ew.fsf@gnu.org> 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:250432 Archived-At: --0000000000009df23905ef69ebd1 Content-Type: text/plain; charset="UTF-8" On Fri, 9 Dec 2022 at 20:06, Eli Zaretskii wrote: > You are ignoring the first sentence in my response, right? > I don't think so - the purpose of my email was essentially to ask why you thought the variable shouldn't be buffer-local in *compilation* buffers. I'm hoping to see where my mental model of using .dir-locals.el and/or buffer-local variables is at odds with how emacs intends. The user manual for both of these make it seem like this would be a perfect fit. The rest was a suggestion (and I do see a good reason why project.el > would like to provide this as a project-specific setting). > > More generally, why would you want a directory-specific value for this > variable, if it isn't something the entire directory tree shares? > >From my understanding, settings in .dir-locals.el *do* affect the whole directory tree under the directory containing the file (and I'm happy for that to be the case here). I think of .dir-locals.el in the project root as the preferred way of specifying project-wide settings, and of project.el/projectile.el as primarily providing meta functionality (e.g. cross projects, or multi-file within a project). (I would also perhaps naively expect that project.el would in turn get its project-wide settings via that .dir-locals.el, at least that is how I have done it for projects where I've needed to customize projectile settings (sorry, I haven't tried project.el yet)). Maybe you should tell why you need to tell Emacs where to find the > sources? Doesn't the tool you use to compile spell that out? > In my specific case the project is in R (which is a terrible language for software development) and we are using a single top level makefile in the project. It has a target to run linting, which (within each R linter invocation) lints from a subdirectory, and the filenames in each lint message are relative to those directories. There is not the hierarchy of makefiles that you would often see in say C projects, where compilation mode could parse make-issued messages about changing directories etc. It seemed a perfect fit for compilation-search-path. I am currently working around it with the following ugliness in my .dir-locals.el: ( (compilation-mode . ((eval . (progn (setq-local compilation-search-path '( "~/sandboxes/myproject/R" "~/sandboxes/myproject/tests" )) (put 'compilation-search-path 'permanent-local t) (compilation-mode)))))) Cheers, Len. --0000000000009df23905ef69ebd1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Fri, 9 Dec 2022 at 20:06, Eli Zaretski= i <eliz@gnu.org> wrote:
=
You are ignoring the firs= t sentence in my response, right?

= =C2=A0I don't think so - the purpose of my email was essentially to= ask why you thought the variable shouldn't be buffer-local in *compila= tion* buffers. I'm hoping to see where my mental model of using .dir-lo= cals.el and/or buffer-local variables is at odds with how emacs intends. Th= e user manual for both of these make it seem like this would be a perfect f= it.


The rest was a suggestion (and I do see a good reason why project.el
would like to provide this as a project-specific setting).

More generally, why would you want a directory-specific value for this
variable, if it isn't something the entire directory tree shares?

From my understanding, settings in .dir-loca= ls.el *do* affect the whole directory tree under the directory containing t= he file (and I'm happy for that to be the case here). I think of .dir-l= ocals.el in the project root as the preferred way of specifying project-wid= e settings, and of project.el/projectile.el as primarily providing meta fun= ctionality (e.g. cross projects, or multi-file within a project). (I would = also perhaps naively expect that project.el would in turn get its project-w= ide settings via that .dir-locals.el, at least that is how I have done it = for projects where I've needed to customize projectile settings (sorry,= I haven't tried project.el yet)).


Maybe you should tell why you need to tell Emacs where to find the
sources?=C2=A0 Doesn't the tool you use to compile spell that out?
<= /blockquote>

In my specific case the project is in R (wh= ich is a terrible language for software development) and we are using a sin= gle top level makefile in the project. It has a target to run linting, whic= h (within each R linter invocation) lints from a subdirectory, and the file= names in each lint message are relative to those directories. There is not = the hierarchy of makefiles that you would often see in say C projects, wher= e compilation mode could parse make-issued messages about changing director= ies etc. It seemed a perfect fit for compilation-search-path. I am currentl= y working around it with the following ugliness in my .dir-locals.el:
=

(
=C2=A0(compilation-mode . ((eval . (progn
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (setq-local compilation-search-path '= ;(
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 "~/sandboxes/myproject/R"
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "= ;~/sandboxes/myproject/tests"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ))
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 (put 'compilation-search-path 'permanent-l= ocal t)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (compilation-mode))))))


Cheers,
Len.
<= div>
--0000000000009df23905ef69ebd1--