hlolli / csound-mode

Emacs major mode for coding in Csound
41 stars 14 forks source link

"^[[m" characters at beginning of compilation output #33

Open oldstar84 opened 7 months ago

oldstar84 commented 7 months ago

hello, I am using GNU Emacs 27.1 i got some unwanted characters in my compilation output. See screenshot. I know it is from the "M-x beginning-of-line" commands

Does anyone have the same issue?

csound-compilation

sohet commented 5 months ago

It is not the issue of csound mode but compilation mode. If you are using recent Emacs, just add the line (add-hook 'compilation-filter-hook 'ansi-color-compilation-filter) to your emacs init file, else see https://stackoverflow.com/questions/3072648/cucumbers-ansi-colors-messing-up-emacs-compilation-buffer for example.

oldstar84 commented 4 months ago

Thanks, I added

(ignore-errors
  (require 'ansi-color)
  (defun my-colorize-compilation-buffer ()
    (when (eq major-mode 'compilation-mode)
      (ansi-color-apply-on-region compilation-filter-start (point-max))))
  (add-hook 'compilation-filter-hook 'my-colorize-compilation-buffer))

to my .emacs file. Now, it is working. This issue can be closed.

hlolli commented 1 month ago

should we add this hook to csound-mode by default? Any reason not to?

sohet commented 1 month ago

I'm now using emacs 28.2 and csound 6.18 and adding the line (add-hook 'compilation-filter-hook 'ansi-color-compilation-filter) but did not need any such remedy before. I think the need and the function to be added to the hook depends on versions of emacs and csound.