For this that are interested.  I've perfected this function:
;;Make sure compilation mode finds the right file when instrumenting Java
code
(defun compilation-filter-hook-jps ()
  (interactive)
  (save-excursion
    (let* ((point-marker (point-marker))
         (end (process-mark (get-buffer-process (current-buffer))))
         (beg (or (and (boundp 'comint-last-output-start)
                       comint-last-output-start)
                  (- end (length string)))))
    (goto-char beg)
    (while (re-search-forward "[/\\\\]instrumented\\([/\\\\].\\)" nil t)
      (replace-match "\\1"))
    (goto-char point-marker))
    ))
(add-hook 'compilation-filter-hook 'compilation-filter-hook-jps)

> -----Original Message-----
> From: Schewe, Jon (MN65) [mailto:[EMAIL PROTECTED]]
> Sent: Monday, February 25, 2002 3:23 PM
> To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED]
> Subject: RE: error navigation
> 
> 
> Interestingly enough I just wanted to do this today too:
> (defun compilation-filter-hook-jps ()
>   (interactive)
>   ;;Just want to search over the last set of stuff, so 
> exchange point and
> mark?
>   (exchange-point-and-mark t)
>   (while (re-search-forward "[/\\\\]instrumented" nil t)
>     (replace-match "" nil t))
>   (exchange-point-and-mark t)
>   )
> (add-hook 'compilation-filter-hook 'compilation-filter-hook-jps)
> 
> This isn't perfect, but it appears to work.  Any suggestions 
> are welcome.
> 
> > -----Original Message-----
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, February 25, 2002 1:53 PM
> > To: [EMAIL PROTECTED]
> > Subject: error navigation
> > 
> > 
> > Hello all,
> > 
> > This is slightly, off topic, but has anyone had any 
> > experience using error
> > navigation in JDE when the actual source file is different 
> > than the file
> > that gets compiled?
> > 
> > Due, to the amount of generated code in my build, I first 
> > copy all of the
> > source into build/src, then produce the generated files also into
> > build/src, and finally compile the generated and static 
> > source all at the
> > same time. The unfortunate result is that, when a compilation 
> > error occurs,
> > the reference in the compilation buffer is to the copy of the 
> > file, and not
> > of the file itself.
> > 
> > Has anyone had to deal with this in the past?
> > 
> > cheers,
> > Charles
> > 
> > 
> 

Reply via email to