unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Let compilation start in one directory below current one
@ 2008-10-22 11:51 stephan.zimmer
  2008-10-22 20:16 ` Rupert Swarbrick
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: stephan.zimmer @ 2008-10-22 11:51 UTC (permalink / raw)
  To: help-gnu-emacs

I would like to start my compilation in one directory deeper than the
current. Unfortunately, a local variable specification as

% -*- ... compile-directory: (concat default-directory ".."); ... -*-

is not working. Does anyone has an idea (except adding "cd.." to the
compile command)?

Stephan


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Let compilation start in one directory below current one
  2008-10-22 11:51 Let compilation start in one directory below current one stephan.zimmer
@ 2008-10-22 20:16 ` Rupert Swarbrick
  2008-10-23  8:11 ` Kevin Rodgers
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Rupert Swarbrick @ 2008-10-22 20:16 UTC (permalink / raw)
  To: help-gnu-emacs


[-- Attachment #1.1: Type: text/plain, Size: 820 bytes --]

"stephan.zimmer" <stephan.zimmer@googlemail.com> writes:

> I would like to start my compilation in one directory deeper than the
> current. Unfortunately, a local variable specification as
>
> % -*- ... compile-directory: (concat default-directory ".."); ... -*-
>
> is not working. Does anyone has an idea (except adding "cd.." to the
> compile command)?
>
> Stephan

You might be interested in the following code. I wrote it some time ago,
so try not to cringe too much at the horrendous style, but I've been
using it since.

Basically, it looks upwards from where you start to try and find a
configure.ac, which signals the top of an autoconf/automake project. The
selection of filenames to stop at is in the top function. Do what you
will with the code - it's in the public domain as far as I'm concerned.

Rupert


[-- Attachment #1.2: compilepkg.el --]
[-- Type: application/emacs-lisp, Size: 3419 bytes --]

[-- Attachment #2: Type: application/pgp-signature, Size: 314 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Let compilation start in one directory below current one
  2008-10-22 11:51 Let compilation start in one directory below current one stephan.zimmer
  2008-10-22 20:16 ` Rupert Swarbrick
@ 2008-10-23  8:11 ` Kevin Rodgers
       [not found] ` <mailman.1883.1224749504.25473.help-gnu-emacs@gnu.org>
  2008-10-23 15:58 ` Dan Espen
  3 siblings, 0 replies; 7+ messages in thread
From: Kevin Rodgers @ 2008-10-23  8:11 UTC (permalink / raw)
  To: help-gnu-emacs

stephan.zimmer wrote:
> I would like to start my compilation in one directory deeper than the
> current. Unfortunately, a local variable specification as
> 
> % -*- ... compile-directory: (concat default-directory ".."); ... -*-
> 
> is not working. Does anyone has an idea (except adding "cd.." to the
> compile command)?

There is no such variable defined or referenced in compile.el.

As far as I know, setting compile-command to "cd .." first is the right
way to do it.

-- 
Kevin Rodgers
Denver, Colorado, USA





^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Let compilation start in one directory below current one
       [not found] ` <mailman.1883.1224749504.25473.help-gnu-emacs@gnu.org>
@ 2008-10-23  8:44   ` Andreas Politz
  2008-10-23 14:23   ` stephan.zimmer
  1 sibling, 0 replies; 7+ messages in thread
From: Andreas Politz @ 2008-10-23  8:44 UTC (permalink / raw)
  To: help-gnu-emacs

Kevin Rodgers wrote:
> stephan.zimmer wrote:
>> I would like to start my compilation in one directory deeper than the
>> current. Unfortunately, a local variable specification as
>>
>> % -*- ... compile-directory: (concat default-directory ".."); ... -*-
>>
>> is not working. Does anyone has an idea (except adding "cd.." to the
>> compile command)?
> 
> There is no such variable defined or referenced in compile.el.
> 
> As far as I know, setting compile-command to "cd .." first is the right
> way to do it.
> 

defun my-compilation-process-setup-function
  ...
  if boundp compile-directory
    setq compile-command ( concat "cd " compile-directory "; " ....


?

-ap

Ps: Due to the economic crisis I am out of parentheses.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Let compilation start in one directory below current one
       [not found] ` <mailman.1883.1224749504.25473.help-gnu-emacs@gnu.org>
  2008-10-23  8:44   ` Andreas Politz
@ 2008-10-23 14:23   ` stephan.zimmer
  2008-10-24  2:42     ` Kevin Rodgers
  1 sibling, 1 reply; 7+ messages in thread
From: stephan.zimmer @ 2008-10-23 14:23 UTC (permalink / raw)
  To: help-gnu-emacs

> There is no such variable defined or referenced in compile.el.

Sorry, I meant "compilation-directory". Hopefully, this hasn't created
too much confusion.

> As far as I know, setting compile-command to "cd .." first is the right
> way to do it.

That basically does the job, but then I cannot use the links in the
compilation output to open the files by clicking on them. My hope was
that this is enabled if 'compilation-directory is set correctly.
Furthermore, the "cd.." construction is not really handy.

Maybe, let me generalize my question a bit: Is there any way to use an
elisp function in a local variable specification?


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Let compilation start in one directory below current one
  2008-10-22 11:51 Let compilation start in one directory below current one stephan.zimmer
                   ` (2 preceding siblings ...)
       [not found] ` <mailman.1883.1224749504.25473.help-gnu-emacs@gnu.org>
@ 2008-10-23 15:58 ` Dan Espen
  3 siblings, 0 replies; 7+ messages in thread
From: Dan Espen @ 2008-10-23 15:58 UTC (permalink / raw)
  To: help-gnu-emacs

"stephan.zimmer" <stephan.zimmer@googlemail.com> writes:

> I would like to start my compilation in one directory deeper than the
> current. Unfortunately, a local variable specification as
>
> % -*- ... compile-directory: (concat default-directory ".."); ... -*-
>
> is not working. Does anyone has an idea (except adding "cd.." to the
> compile command)?

1. compile-command:  cd subdir && make

2. Put cd in the Makefile in the current directory.

3. In make file in current directory, invoke make in the subdirectory

You're requirements may differ, but the 3rd approach is more
"standard".


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Let compilation start in one directory below current one
  2008-10-23 14:23   ` stephan.zimmer
@ 2008-10-24  2:42     ` Kevin Rodgers
  0 siblings, 0 replies; 7+ messages in thread
From: Kevin Rodgers @ 2008-10-24  2:42 UTC (permalink / raw)
  To: help-gnu-emacs

stephan.zimmer wrote:
>> There is no such variable defined or referenced in compile.el.
> 
> Sorry, I meant "compilation-directory". Hopefully, this hasn't created
> too much confusion.
> 
>> As far as I know, setting compile-command to "cd .." first is the right
>> way to do it.
> 
> That basically does the job, but then I cannot use the links in the
> compilation output to open the files by clicking on them. My hope was
> that this is enabled if 'compilation-directory is set correctly.
> Furthermore, the "cd.." construction is not really handy.
> 
> Maybe, let me generalize my question a bit: Is there any way to use an
> elisp function in a local variable specification?

Use the eval pseudo-variable.

-- 
Kevin Rodgers
Denver, Colorado, USA





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-10-24  2:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-22 11:51 Let compilation start in one directory below current one stephan.zimmer
2008-10-22 20:16 ` Rupert Swarbrick
2008-10-23  8:11 ` Kevin Rodgers
     [not found] ` <mailman.1883.1224749504.25473.help-gnu-emacs@gnu.org>
2008-10-23  8:44   ` Andreas Politz
2008-10-23 14:23   ` stephan.zimmer
2008-10-24  2:42     ` Kevin Rodgers
2008-10-23 15:58 ` Dan Espen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).