all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Sam Steingold <sds@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r99848: (compilation-save-buffers-predicate):
Date: Mon, 12 Apr 2010 16:02:32 -0400	[thread overview]
Message-ID: <4BC37C58.1030306@gnu.org> (raw)
In-Reply-To: <jwvvdbxyc60.fsf-monnier+emacs@gnu.org>

Stefan Monnier wrote:
>>>>>> - I like where this is going, but I'm not sure this is enough.
>>>>>> Could you explain how you see it being used?
>>>>>> if you edit a huge file which is expensive to save, you do not want it
>>>>>> to be saved whenever you start a compilation elsewhere.
>>>>> ;-) that part I understand of course.
>>>>> But I mean what value do you expect users to use it with?
>>>>> Would they globally set it to save one particular directory of theirs?
>>>>> What if they have more than one project?
>>>> this is problematic because compile does not announce what it's working
>>>> directory is.
>>> Any reason why we can't fix that?
>> no, and here is a solution:
> 
> I don't understand.  You're saying there's no reason why we can't fix it
> and then you go ahead and point me to a workaround.  Maye we're not
> talking about the same thing.  By "announce what it's working dir is"
> I mean "make sure default-directory has the proper value".
> 
> Introducing `compile-default-directory' is not the end of the world, but
> to my naive eyes, if `default-directory' doesn't point to the right
> place, it's a bug to be fixed.

default-directory "Automatically becomes buffer-local when set in any fashion"
this means that it is useless in compilation-save-buffers-predicate because 
that is called inside the buffer to be saved and thus for it default-directory 
should be the directory where the buffer is located.

>>> How 'bout this:
>>> - we provide some way for the user to explain to compile.el how to find
>>> her projects's root directories (e.g. a list of tell-tale file names).
>> this is tricky: some files might be ordinary for some projects and the
>> tell-tale for others.
> 
> I know, that's a significant problem, but I can't think of a really good
> solution other than push it onto the user by providing a customizable
> variable.  My main goal here is to make sure that we can support the
> case where the user has several projects, which seems like a common
> enough case, especially for Free Software hackers.

I think this variable should be buffer-local (with an eye on being set in 
dir_locals).

>>> - and we can also provide an option to "cd to project's root before
>>> running the command".
>> I doubt the value of this.
> 
> I've used several build systems where this is necessary (e.g. a single
> Makefile at the root, or something equivalent).  I usually work around
> it with something like M-x compile RET cd ..; make RET, but if `compile'
> could insert the "cd .." for me when needed it would be even better.

this sounds like a case for yet another buffer-local variable - build-directory

 >
 >>> How does that sound?
 >> fine.
 >> gonna do it?
 >
 > ;-)
 >
 >
 >         Stefan
 >
 >
 > PS: We're talking here mostly about designing a good default value for
 > your new variable, right?  Or if not default, at least a value that can
 > be listed in the possible options so the end user doesn't have to write
 > her own predicate function.
 >
 >
 >






  reply	other threads:[~2010-04-12 20:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1NzYsW-0004b6-Iu@internal.in.savannah.gnu.org>
2010-04-07 19:00 ` [Emacs-diffs] /srv/bzr/emacs/trunk r99848: (compilation-save-buffers-predicate): New custom variable Stefan Monnier
2010-04-07 20:40   ` Sam Steingold
2010-04-09  3:13     ` [Emacs-diffs] /srv/bzr/emacs/trunk r99848: (compilation-save-buffers-predicate): Stefan Monnier
2010-04-09 16:18       ` Sam Steingold
2010-04-10  1:04         ` Stefan Monnier
2010-04-11 19:21           ` Sam Steingold
2010-04-11 20:28             ` Stefan Monnier
2010-04-12 20:02               ` Sam Steingold [this message]
2010-04-12 21:15                 ` Stefan Monnier
2010-04-12 21:47                   ` Sam Steingold
2010-04-13  0:04                     ` Stefan Monnier
2010-04-13 17:07               ` Tom Tromey

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=4BC37C58.1030306@gnu.org \
    --to=sds@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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.