I’m using XEmacs for Ruby editing, but it seems that I can’t get the
syntax highlighting to work. I have installed ruby-mode, but only
comments and strings are colored. Shouldn’t there be different colors
for variables, methods, classes etc?
Hmm, it works for me. If you can’t get it working we can talk offline
about things, but yea, there are a whole lot of syntax things that are
highlighted for me. Strings, keywords, classes, constants, comments,
instance vars, #{} sequences, function definitions, regular
expressions…
I found the answer in http://www.ruby-talk.org/blade/40011. For some
reason you have to call (font-lock-fontify-buffer) to make it work, so I
changed my init file like this:
elvis doesn’t have ANY Ruby syntax highlighting and vim’s doesn’t work in
the case
[nit-picking]
well, in this case Ruby thinks like vim
batsman@tux-chan:/tmp$ expand -t4 t.rb
def foo()
return if true
23
else
42
end
end
p foo
batsman@tux-chan:/tmp$ ruby t.rb
t.rb:6: warning: else without rescue is useless
t.rb:7: syntax error
Oops… that’s what I get for making the “simplest possible example”.
However
a = if true
1
else
2
end
fails as you describe.
And that’s what I really wrote…
but thanks, that should explain why vim is doing that wrong. And that
it’s probably not easy to fix so that both if-suffixes and if-expressions
are highlighted correctly.
Hm… it can even be ambigous:
puts foo if true
17
else
42
end
does NOT what one might expect. The if is seen as a one-line if. There’s
no if-expression for the first argument of foo like in
puts foo(if true
17
else
42
end)
···
On Sat, Aug 16, 2003 at 10:55:41PM +0900, Rudolf Polzer wrote:
–
Can’t find string terminator “EOF” anywhere before EOF at ./autoindex line 27.
I hadn’t seen that (just installed it now - it’s pretty good). If I
could reformat info docs as HTML though, then I could browse them with
lynx or any other browser of my choice. Now that would be nice.
I’m using XEmacs for Ruby editing, but it seems that I can’t get the
syntax highlighting to work. I have installed ruby-mode, but only
comments and strings are colored. Shouldn’t there be different colors
for variables, methods, classes etc?
Hmm, it works for me. If you can’t get it working we can talk offline
about things, but yea, there are a whole lot of syntax things that are
highlighted for me. Strings, keywords, classes, constants, comments,
instance vars, #{} sequences, function definitions, regular
expressions…
I found the answer in http://www.ruby-talk.org/blade/40011. For some
reason you have to call (font-lock-fontify-buffer) to make it work, so I
changed my init file like this: