EMACS with ruby-mode


#1

I’m using EMACS’ ruby-mode, and with the following code, “x += 3” gets
highlighted as if it was a string.

puts %{it’s annoying}
x = 3 + 5

Does anyone know a quick workaround/solution? Is there some Ruby mode
for EMACS that doesn’t have this problem?


#2

On Jul 30, 2007, at 8:05 , Felix E. Klee wrote:

I’m using EMACS’ ruby-mode, and with the following code, “x += 3” gets
highlighted as if it was a string.

puts %{it’s annoying}
x = 3 + 5

I’ve found there are a number of syntax highlighting quirks with Ruby
mode. I’d love to hear a solution as well. I haven’t yet dug into the
code myself.

Michael G.
grzm seespotcode net


#3

At Mon, 30 Jul 2007 15:04:19 +0200,
Felix E. Klee wrote:

Does anyone know a quick workaround/solution?

As a workaround, I now do:

a = “’”
puts %{it#{a}s annoying}
x = 3 + 5

It’s not nice, but the broken syntax highlighting is worse, especially
when one uses %{…} all over the place.


#4

Felix E. Klee wrote the following on 30.07.2007 15:05 :

I’m using EMACS’ ruby-mode, and with the following code, “x += 3” gets
highlighted as if it was a string.

puts %{it’s annoying}
x = 3 + 5

Does anyone know a quick workaround/solution? Is there some Ruby mode
for EMACS that doesn’t have this problem?

None that I’m aware of, but you can try:

puts %{it’s annoying} #’ yes it is


#5

At Wed, 1 Aug 2007 01:46:26 +0900,
Ryan D. wrote:

puts %{it’s annoying}

I like that - thanks for the suggestion!


#6

On Jul 30, 2007, at 06:05 , Felix E. Klee wrote:

I’m using EMACS’ ruby-mode, and with the following code, “x += 3” gets
highlighted as if it was a string.

puts %{it’s annoying}
x = 3 + 5

puts %{it’s annoying}
x = 3 + 5

or Lionel’s suggestion:

puts %{it’s annoying} # ’
x = 3 + 5

If my elisp-fu were stronger, I’d fix it, but I’m not so good on the
emacs syntax table side of things. Especially a monster like ruby.