all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Matthias Meulien <orontee@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 65702@debbugs.gnu.org
Subject: bug#65702: 30.0.50; compile-command not honored in shell buffers
Date: Sun, 03 Sep 2023 09:30:04 +0200	[thread overview]
Message-ID: <87cyyzyarn.fsf@gmail.com> (raw)
In-Reply-To: <835y4sad6l.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 02 Sep 2023 16:59:30 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Matthias Meulien <orontee@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





  reply	other threads:[~2023-09-03  7:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-02 13:39 bug#65702: 30.0.50; compile-command not honored in shell buffers Matthias Meulien
2023-09-02 13:59 ` Eli Zaretskii
2023-09-03  7:30   ` Matthias Meulien [this message]
2023-09-03  8:04     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87cyyzyarn.fsf@gmail.com \
    --to=orontee@gmail.com \
    --cc=65702@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.