« Return to Thread: [scala-tools] sbt emacs mode

Re: [scala-tools] sbt emacs mode

by Grey :: Rate this Message:

Reply to Author | View in Thread

While you can disable them in sbt and use emacs fontlock to get whatever colors you'd like (that is what I do to colorized Maven output in mvn.el) the sbt ansi colors work fine for me.

I specifically have

(ansi-color-for-comint-mode-on)

in sbt.el and it works fine for me.

I just tried it, if I do a M-x sbt-shell, select the *Scala Build Tool* buffer and then M-x ansi-color-for-comint-mode-off I see the escape codes.  If I then M-x ansi-for-comint-mode-on everything works fine.  I use the latest release of emacs on linux, don't need to autoload any special ansi support just straight emacs.

It should work.

Ray


On Sun, Aug 9, 2009 at 4:15 PM, L Jantzen <ljantzen@...> wrote:



Grey wrote:
>
> Should have sent to scala-tools initially.  Sorry for double post.
>
> The following is a small emacs elisp script to run sbt as an inferior mode
> process from emacs.  It uses emacs' compile.el to identify error messages
> and then jump to errors in scala source files.
>
>

Sorry for awakening this old thread, but I have a question.  Its probably
more emacs-related than anything else, but I have a problem with
ansi-control chars when entering sbt-shell mode:

-*- mode: compilation; default-directory: "~/dev/scala/myproject/" -*-
Comint started at Sun Aug  9 21:56:56

cd /home/leif/dev/scala/myproject; sbt
 [0m[ [0minfo [0m]  [0mBuilding project myproject 1.0 using
sbt.DefaultProject [0m
 [0m[ [0minfo [0m]  [0m   with sbt 0.4.6 and Scala 2.7.4 [0m
 [0m[ [0minfo [0m]  [0mNo actions specified, interactive session started.
Execute 'help' for more information. [0m
>

How do I get rid of the ansi control characters, or how do I get the
sbt-shell to interpret them correctly?

I have added the following to my .emacs: (snagged from
http://www.grokblok.com/2007/12/13/emacs-shell-ansi-colors.html)

(autoload 'ansi-color-for-comint-mode-on "ansi-color" nil t)
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)

I have also tried to create a ~/.emacs_bash with the following two lines:

alias ls=ls
unset LS_COLORS

Any pointers?


--
View this message in context: http://www.nabble.com/-scala-tools--sbt-emacs-mode-tp24026627p24890724.html
Sent from the Scala - Tools mailing list archive at Nabble.com.


 « Return to Thread: [scala-tools] sbt emacs mode