🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by Daniel Pfeiffer Sat, 15 Nov 2003 20:05
new style Emacs compile
#12045
Author: Daniel Pfeiffer
Date: Sat, 15 Nov 2003 20:05
62 lines
3731 bytes
This is for those who are sick of the haphazard handling of error locating in Emacs `compile'.  Error locations only became mouse-sensitive rather late, and were often somehow forgotten again.  Or when clicking on one, it would jump to a different file.

The prehistoric output parser at the root of this evil has now been eliminated and replaced by font-lock.  The two were already running redundantly (unless you inexcusably don't use font-lock, which parses very well).

Warnings and plain messages now come in less intimidating colours, like green in grep, and orange for warnings.  Only GNU style messages have been enhanced for this.  There is now also a usual `compilation-mode-font-lock-keywords' and it nicely handles all the checks configure outputs and -o options so you see at a glance where you are.

For those writing the regexps, there is a debug feature to see where some highlighting came from.

To use this, install it as compile.el somewhere early in you load-path, and it'll get the stuff it needs from the original compile.el automatically.

http://dapfy.bei.t-online.de/compile.el

TODO (this is still a prototype, so bear with me):

- Error positions don't all become markers as soon as the first error in a file is visited.  This can lead to slightly wrong positioning if shifts occured earlier in the file.

- File name format lists aren't allowed.

- Directory information gets highlighted, but not evaluated.  Grep, byte-compile, and all builds in a single directory or which output full file-paths work fine.  Else it'll ask you.

- The minor modes are not supported yet.  The thing to do is probably to prepend our font-lock-keywords to theirs.

- TeX output file names are not handled.  The hard part is not so much doing it with font-lock, but knowing, which `)' closes a file.  The parsing which old-style `compilation-parse-errors-function' did is rather mysterious to me.  Pairing is not enough, because there might be a lone `)' in some error output.  I'd like you to get me some error outputs containing parens, especially all kinds of non-matching ones you can think of.

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

-- 
lerne / learn / apprends      Esperanto:
                              http://lernu.net/



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

-- 
lerne / learn / apprends / läramå    Esperanto:
                              http://lernu.net/
Re: new style Emacs compile
#12046
Author: Klaus Berndl
Date: Sun, 16 Nov 2003 12:41
70 lines
3921 bytes
On Sat, 15 Nov 2003, Daniel Pfeiffer wrote:



>  This is for those who are sick of the haphazard handling of error locating
>  in Emacs `compile'. Error locations only became mouse-sensitive rather
>  late, and were often somehow forgotten again. Or when clicking on one, it
>  would jump to a different file.
>  
>  The prehistoric output parser at the root of this evil has now been
>  eliminated and replaced by font-lock. The two were already running
>  redundantly (unless you inexcusably don't use font-lock, which parses very
>  well).
>  
>  Warnings and plain messages now come in less intimidating colours, like
>  green in grep, and orange for warnings. Only GNU style messages have been
>  enhanced for this. There is now also a usual
>  `compilation-mode-font-lock-keywords' and it nicely handles all the checks
>  configure outputs and -o options so you see at a glance where you are.
>  
>  For those writing the regexps, there is a debug feature to see where some
>  highlighting came from.
>  
>  To use this, install it as compile.el somewhere early in you load-path, and
>  it'll get the stuff it needs from the original compile.el automatically.
>  
>  http://dapfy.bei.t-online.de/compile.el
>  
>  TODO (this is still a prototype, so bear with me):

OK, but please explain the following:

1. What should the following code do??
   '(mapc (lambda (sym)
   	(makunbound sym)
   	(fmakunbound sym)
   	(setplist sym nil))
         '(compilation-xyz))

2. You code is not byte-compile-able (at least not with GNU Emacs 21.3):

While compiling toplevel forms:
  !! error (("Invalid escape character syntax"))

This comes from:

(defvar compilation-mode-font-lock-keywords
   '(;; configure output lines.
     ("^[Cc]hecking \\(?:[Ff]or \\|[Ii]f \\|[Ww]hether \\(?:to \\)?\\)?\\(.+\\)\\.\\.\\. *\\(?:(cached) *\\)?\\(\\(yes\\(?: .+\\)?\\)\\|no\\|\\(.*\\)\\)"
      (1 font-lock-variable-name-face)
      (2 (compilation-face 4 3)))
     ;; Command output lines.  Recognize `make[n]:' lines too.
     ("^\\([A-Za-z_0-9/\.+-]+\\)\\(\\[\\([0-9]+\\)\\]\\)?[ \t]*:"
      (1 font-lock-function-name-face) (3 compilation-line-face nil t))
     (" --?o\\(?:utfile\\|utput\\)?[= ]?\\(\\S +\\)" . 1)
     ;; Up arrow.
     ("^\s *-*\\(\\^+\\)$" 1 compilation-warning-face))
   "Additional things to highlight in Compilation mode.
This gets tacked on the end of the generated expressions.")

Thanks for the code but it would be fine if it would work ;-)

Klaus

-- 
Klaus Berndl			mailto: klaus.berndl@sdm.de
sd&m AG				http://www.sdm.de
software design & management	
Carl-Wery-Str. 42, 81739 Muenchen, Germany
Tel +49 89 63812-392, Fax -220
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads