unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* Re: [BUG] emacs cygwin compile.el next-error fails with Ant
       [not found] ` <3F1E9317.9040204@hekimian.com>
@ 2003-07-24 12:04   ` Mark Evenson
  2003-07-24 14:05     ` Joe Buehler
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Evenson @ 2003-07-24 12:04 UTC (permalink / raw)


Following the suggestion of Joe Buehler the following scripts placed in
$HOME/bin, with ant-emacs chmod'd to execute

ant-emacs
----------------------------------------------------------------------
#!/bin/sh
ANT_ARGS="$ANT_ARGS -emacs" 
ANT_OPTS="$ANT_OPTS -Dbuild.compiler.emacs=true" 
export ANT_ARGS ANT_OPTS
ant $* 2>&1 | gawk -f $HOME/bin/transform.gawk 2>&1 | sed s/\\r//g | sed s/^gawk.*$//
----------------------------------------------------------------------

and the following gawk script 

transform.gawk
----------------------------------------------------------------------
/^[A-Z]:/ {
      command = "tr \\\\\\\\\ / | xargs cygpath "; 
      printf "%s", $1 | command;  
      close(command); 
      for (i = 2; i < NF; i++) {
        printf " %s", $i;
      };
      printf "\n";

      next;
}
{print}
----------------------------------------------------------------------

will make next-error work in compile.el with Emacs running under cygwin.
This is not perfect, as it changes the output slightly (I have a extra
newline emitted somehow), but it might help someone else.

After some investigation and further reflection, I think this can be
classified as a problem with Ant, and not with cygwin and/or Emacs as Ant
should emit "UNIX normalized" pathnames if it is running under
cygwin/Emacs.  The problem with implementing this is that Ant is merely
passing back the output from a native win32 javac which necessarily needs
the platform dependent path.separator variable.  Maybe I will have time his
weekend to look into this.

-- 
Mark Evenson <evenson@panix.com>

"A screaming comes across the sky.  It has happened before, but there is
nothing to compare to it now."


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

* Re: [BUG] emacs cygwin compile.el next-error fails with Ant
  2003-07-24 12:04   ` [BUG] emacs cygwin compile.el next-error fails with Ant Mark Evenson
@ 2003-07-24 14:05     ` Joe Buehler
  0 siblings, 0 replies; 2+ messages in thread
From: Joe Buehler @ 2003-07-24 14:05 UTC (permalink / raw)
  Cc: bug-gnu-emacs

Mark Evenson wrote:

> /^[A-Z]:/ {
>       command = "tr \\\\\\\\\ / | xargs cygpath "; 
>       printf "%s", $1 | command;  
>       close(command); 
>       for (i = 2; i < NF; i++) {
>         printf " %s", $i;
>       };
>       printf "\n";
> 
>       next;
> }
> {print}

I think I see now why you said that my posted command would not work.
The problem is that I have not yet fixed emacs to recognize drive letters.
The workaround is to use the /cygdrive/DRIVELETTER syntax.

So try something like this:

ant whatever 2>&1 | sed 's=\\=/=g;s=\([a-zA-Z]\):/=/cygdrive/\1/=g;s/\r//g'

This:

1. changes \ to /
2. changes X:/ to /cygdrive/X/
3. removes carriage returns

I saw you used some GNU sed feature for 3, so correct it if I got it wrong.
I don't think it's portable to other platforms so I never use it.
-- 
Joe Buehler




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

end of thread, other threads:[~2003-07-24 14:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <a0he5dd5yv.fsf@panix3.panix.com>
     [not found] ` <3F1E9317.9040204@hekimian.com>
2003-07-24 12:04   ` [BUG] emacs cygwin compile.el next-error fails with Ant Mark Evenson
2003-07-24 14:05     ` Joe Buehler

Code repositories for project(s) associated with this public inbox

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

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