GNU bug report logs - #65702
30.0.50; compile-command not honored in shell buffers

Previous Next

Package: emacs;

Reported by: Matthias Meulien <orontee <at> gmail.com>

Date: Sat, 2 Sep 2023 13:40:02 UTC

Severity: normal

Found in version 30.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 65702 <at> debbugs.gnu.org (full text, mbox):

From: Matthias Meulien <orontee <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 65702 <at> debbugs.gnu.org
Subject: Re: bug#65702: 30.0.50; compile-command not honored in shell buffers
Date: Sun, 03 Sep 2023 09:30:04 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Matthias Meulien <orontee <at> gmail.com>
>> Date: Sat, 02 Sep 2023 15:39:20 +0200
>> 
>> 
>> I customize the default compile command using directory local
>> variables. For example, with a '.dir-locals' containing the following:
>> 
>> ;;; Directory Local Variables            -*- no-byte-compile: t -*-
>> ;;; For more information see (info "(emacs) Directory Variables")
>> 
>> ((nil . ((compilation-search-path . (nil "builddir"))
>> 	 (compile-command . "meson setup builddir . --cross-file crossfile_arm.ini ; pushd builddir && meson compile ; popd")
>> 	 (compilation-environment . ("TERM=ansi"))
>> 	 (ispell-local-dictionary . "en")
>> 	 (project-vc-merge-submodules . nil)))
>>  (c++-mode . ((c-basic-offset . 2)
>> 	      (indent-tabs-mode . nil))))
>> 
>> When I enter the *vc-dir* buffer for the corresponding Git local
>> repository, and I press 'C-x p c' ('project-compile' command) then the
>> default compile command has the value specified in the previous
>> '.dir-locals.el'.
>> 
>> Same with 'meson.build', 'README.md', '*.cc', '*.h', etc. files.
>> 
>> But when 'project-compile' is called from a shell buffer after I pressed
>> 'C-x p s' then the default compile command is 'make -k'.  This is
>> strange and looks like a bug to my eyes.
>
> Aren't directory-local variables in effect only in file-visiting
> buffers?  The shell buffer created by "C-x p s" doesn't visit a file,
> so I think directory-local variables are not in effect for it.

Oh thank you!  I now understand, I should have realized that the same
behavior is observable in *xref*, or *Occur* buffers.  Thank you Eli.
Sorry for the annoyance. 

I'll override 'project-compile' in order to use the 'compile-command'
set for the project-root directory.  It'll be ok for my use case.
-- 
Matthias




This bug report was last modified 1 year and 293 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.