Forum: Ruby EMACS with ruby-mode

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ff7f055d016c0273792b89cb0f002a21?d=identicon&s=25 Felix E. Klee (Guest)
on 2007-07-30 15:06
(Received via mailing list)
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?
Ae82cad40a0caca9c932d45c7a9eb3cd?d=identicon&s=25 Michael Glaesemann (Guest)
on 2007-07-30 16:16
(Received via mailing list)
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 Glaesemann
grzm seespotcode net
Ff7f055d016c0273792b89cb0f002a21?d=identicon&s=25 Felix E. Klee (Guest)
on 2007-07-30 16:42
(Received via mailing list)
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.
Bef7ff8a0537495a1876ffebdc9f8e51?d=identicon&s=25 Lionel Bouton (Guest)
on 2007-07-30 17:11
(Received via mailing list)
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
5a837592409354297424994e8d62f722?d=identicon&s=25 Ryan Davis (Guest)
on 2007-07-31 18:47
(Received via mailing list)
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.
Ff7f055d016c0273792b89cb0f002a21?d=identicon&s=25 Felix E. Klee (Guest)
on 2007-07-31 20:12
(Received via mailing list)
At Wed, 1 Aug 2007 01:46:26 +0900,
Ryan Davis wrote:
> puts %{it\'s annoying}

I like that - thanks for the suggestion!
This topic is locked and can not be replied to.