emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Possible problem with M-x compile


From: Alexis Layton
Subject: Re: Possible problem with M-x compile
Date: Mon, 22 Nov 2004 18:55:05 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8a3) Gecko/20040817

Daniel Pfeiffer wrote:

Saluton,

Juri Linkov <address@hidden> skribis:

Alexis Layton <address@hidden> writes:
  cd $CLIENTLIB_BUILDDIR && fmake tests && make
the problem is a general failure when the first part of
the compile command is a cd.
I am wondering if the emacs logic is trying to perform the cd itself,
instead of letting the shell handle it?

Both.  Emacs performs the cd for itself, in case there are relative pathnames
to parse.

The problem is that `cd' in `compilation-start' doesn't handle envvars.
Perhaps it should preprocess the command with `substitute-env-vars'.

Not quite as good as a full blown shell parser, but fair enough.  I've checked
it in.

coralament / best Grötens / liebe Grüße / best regards / elkorajn salutojn
Daniel Pfeiffer
Earlier today, RMS asked if this fix would work:

I think this code in compile.el is causing the problem.


        ;; would do it again through the shell: (cd "..") AND sh -c "cd ..; 
make"
        (cd (if (string-match "^\\s *cd\\(?:\\s +\\(\\S +?\\)\\)?\\s *[;&\n]" 
command)
                (if (match-end 1)
                    (match-string 1 command)
                  "~")
              default-directory))
        (erase-buffer)

If you change it to this, does it work ok?

        ;; would do it again through the shell: (cd "..") AND sh -c "cd ..; 
make"
        (cd (substitute-in-file-name
             (if (string-match "^\\s *cd\\(?:\\s +\\(\\S +?\\)\\)?\\s *[;&\n]" 
command)
                 (if (match-end 1)
                     (match-string 1 command)
                   "~")
               default-directory)))
        (erase-buffer)

I tried it out and it fixed the problem.
I'm not clear exactly which solution you checked in....

Alexis





reply via email to

[Prev in Thread] Current Thread [Next in Thread]