woah brother, when I apply your new hooks (one at a time) I get great
error warnings.
--With 'ansi-color-process-output I get:
(22) (error/warning) Error in process filter: (wrong-number-of-arguments
(lambda (string) Maybe translate SGR control sequences of comint output
into text-properties.
Depending on variable `ansi-color-for-comint-mode' the comint output is
either not processed, SGR control sequences are filtered using
`ansi-color-filter-region', or SGR control sequences are translated into
text-properties using `ansi-color-apply-on-region'.
The comint output is assumed to lie between the marker
`comint-last-output-start' and the process-mark.
This is a good function to put in `comint-output-filter-functions'. (let
((start-marker (or comint-last-output-start (point-min-marker)))
(end-marker (process-mark (get-buffer-process (current-buffer))))) (cond
((eq ansi-color-for-comint-mode nil)) ((eq ansi-color-for-comint-mode
(quote filter)) (ansi-color-filter-region start-marker end-marker)) (t
(ansi-color-apply-on-region start-marker end-marker))))) 0)
--With 'ansi-color-apply
(19) (error/warning) Error in process filter: (wrong-number-of-arguments
(lambda (string) Translates SGR control sequences into text-properties.
Applies SGR control sequences setting foreground and background colors
to STRING using text-properties and returns the result. The colors used
are given in `ansi-color-faces-vector' and `ansi-color-names-vector'.
See function `ansi-color-apply-sequence' for details.
Every call to this function will set and use the buffer-local variable
`ansi-color-context' to save partial escape sequences and current face.
This information will be used for the next call to `ansi-color-apply'.
Set `ansi-color-context' to nil if you don't want this.
This function can be added to `comint-preoutput-filter-functions'.
You cannot insert the strings returned into buffers using font-lock.
See `ansi-color-unfontify-region' for a way around this. (let ((face
(car ansi-color-context)) (start 0) end escape-sequence result) (if
(cadr ansi-color-context) (setq string (concat (cadr ansi-color-context)
string) ansi-color-context nil)) (while (setq end (string-match
ansi-color-regexp string start)) (setq escape-sequence (match-string 1
string)) (when face (put-text-property start end (quote ansi-color) t
string) (put-text-property start end (quote face) face string)) (setq
result (concat result (substring string start end)) start (match-end 0))
(setq face (ansi-color-apply-sequence escape-sequence face))) (when face
(put-text-property start (length string) (quote ansi-color) t string)
(put-text-property start (length string) (quote face) face string)) (let
(fragment) (if (string-match string start) (let ((pos (match-beginning
0))) (setq fragment (substring string pos) result (concat result
(substring string start pos)))) (setq result (concat result (substring
string start)))) (if (or face fragment) (setq ansi-color-context
(list face fragment)) (setq ansi-color-context nil))) result)) 0)
Now as formerly stated I am no emacs guru but I was tring to follow the
warning messages and correct it, but the documentation on those
functions wasnt to helpful and in the end I got nowhere.
thanks for your help
-joachim
"Stephen J. Turnbull" wrote:
>>>>> "Joachim" == Joachim Deguara <dga(a)emt.iis.fhg.de>
writes:
Joachim> I am merely run 'M-x compile' and then compiling 'make -f
Joachim> Makefile.blah' With this I get Ansi escape tags showing
Joachim> up.
This is good news; it means that the compiler/colorizer is generating
the output you want.
Unfortunately, compile mode doesn't seem to be derived from comint
mode, which is why setting the hook doesn't work.
You could try
(add-hook 'compilation-filter-hook 'ansi-color-process-output)
OR (not both, I think)
(add-hook 'compilation-filter-hook 'ansi-color-apply)
_in addition to_
(add-hook 'compilation-mode-hook 'ansi-color-for-comint-mode-on)
Try the -process-output version first.
--
Institute of Policy and Planning Sciences
http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
My nostalgia for Icon makes me forget about any of the bad things. I don't
have much nostalgia for Perl, so its faults I remember. Scott Gilbert c.l.py
--
Joachim Deguara Email: dga(a)emt.iis.fhg.de
Fraunhofer IIS-AEMT Phone: +49 3677/669-4022
Helmholzring 1, 98693 Ilmenau, Germany Fax: +49 3677/669-4024