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: Daniel Pfeiffer
Subject: Re: Possible problem with M-x compile
Date: Wed, 24 Nov 2004 10:00:10 +0100

Saluton, Moin,

Alexis Layton <address@hidden> skribis:
> Daniel Pfeiffer wrote:
> >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.

> 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....

I used substitute-env-vars, and had it nested deeper inside.  The two are both
not perfect.  But they only differ on VMS as far as the doc goes.  This could
be an issue if VMS understands cd commands.

coralament / best Grötens / liebe Grüße / best regards / elkorajn salutojn
Daniel Pfeiffer

-- 
lerne / learn / apprends / lär dig / ucz się    Esperanto:
                              http://lernu.net/




reply via email to

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