I'm using the *compilation*
buffer to build a C++ application on Centos 5 and Centos 6. The buffer shows the build and includes references to files that are part of the build. However, I'm getting control characters like ^[
appear in the output and it is hard to read and emacs is getting corrupted filenames when you click one in the output. I think these characters are some kind of coloring or other annotation on the compiler output but I don't know where they are coming from. Here is sample output:
cc -c -g -I../machind -I. -DRELEASE_VERSION -g -O2 -m64 -D__BITS64 -pipe -DARCH_64 -DARCH_INTEL -DARCH_X86 -DARCH_X86_64 -DOS_LINUX -pthread -DLM_INTERNAL -DFLEXLM_KITBUILD -DFLEX_STATIC -DRELEASE_VERSION -DGPLATFORM=\\"x64_lsb\\" -DLINUX -DLSB3_0 -D__FD_SETSIZE=65535 -DGLIBC -DLINUX64 -DAMD64 -DREDHAT -DREL -DRHLINUX64 -DPLATFORM_AMD64_RHLINUX -DNO_ACTIVATION_SUPPORT ../machind/lmcrypt.c
^[[01m^[[K../machind/lmcrypt.c:^[[m^[[K In function ^[[01m^[[Kmain^[[m^[[K :
^[[01m^[[K../machind/lmcrypt.c:156:47:^[[m^[[K ^[[01;35m^[[Kwarning: ^[[m^[[Kcast to pointer from integer of different size [-Wint-to-pointer-cast]
lc_set_attr(lm_job, LM_A_MAX_LICENSE_LEN, (LM_A_VAL_TYPE)max);
^[[01;32m^[[K ^^[[m^[[K
How can I get rid of the non-text output in my compilation buffer?
-fdiagnostics-color=never
togcc
(assuming thatgcc
is yourcc
) – PythonNut Feb 10 '15 at 21:24ansi-color-apply-on-region
could be slow, I have written up this snippet few weeks back: de-ansi.el. I did not intend it to be a package and so it has dependencies on the key-chords package and on my temporary minor mode temp-mode.el. You also need to be on emacs 24.4 or later for the file-notify feature. – Kaushal Modi Feb 10 '15 at 21:49