List of Ruby capable text editors?

Ben Giddings wrote:

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:

(setq ruby-mode-hook
'(lambda ()
(inf-ruby-keys)
(setq ruby-indent-level 2)
(define-key ruby-mode-map “\r” 'ruby-reindent-then-newline-and-indent)
(define-key ruby-mode-map “\C-c\C-c” 'comment-region)
(font-lock-fontify-buffer) ; ← needed to get syntax highlighting
(if window-system (font-lock-mode 1))
)
)

···

On Saturday, August 16, 2003, at 09:15 AM, Andreas Schwarz wrote:


AVR-Tutorial, über 350 Links
Forum für AVRGCC und MSPGCC
http://www.mikrocontroller.net

^K R insert file at cursor point
Hmm, not sure if this is bound by default

^X I

^K W write block to file
Ctrl-X Ctrl-W to write to a file in emacs, write a block to a file?
Hrm…

M-X write-region, not bound on my emacs.

^T toggle modes (e.g. insert/overwrite, line wrap)
Modes in Emacs are a bit more complex.

Insert works for me, line wrap comes in two flavours:

  • displaying (one line in the buffer is or is not allowed to span
    multiple lines on the screen
  • auto-fill-mode, which is nice for text, but not nice for code, imho.

Have fun,
Kero

Scripsit ille aut illa »Mauricio Fernández« batsman.geo@yahoo.com:

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 :slight_smile:

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.

Never used this, but here it is:

http://www.gnu.org/directory/text/doc/Documentation_conversion/info2html.html

martin

···

Brian Candler B.Candler@pobox.com wrote:

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.

Andreas Schwarz wrote:

Ben Giddings wrote:

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:

No, that still didn’t work. I found the final solution in
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/6693.

···

On Saturday, August 16, 2003, at 09:15 AM, Andreas Schwarz wrote:


AVR-Tutorial, über 350 Links
Forum für AVRGCC und MSPGCC
http://www.mikrocontroller.net