Emacs ruby-mode problems

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi there,

I’m using Emacs for editing since a few months now and enjoy it
mostly. However, there’s one thing that continues to annoy me: The
default ruby-mode lacks some syntax highlighting and isn’t able to
cope with extended symbol literals (or however these are called, see
below). To demonstrate the problem, the following code doesn’t get the
highlighting I expect:

====================================================================
regex = %r # Should be highlighted as
# regular expression, breaks
# indentation

symbol = %s|This is a symbol| # Should be highlighted as a
# symbol as well

str = %q{This is a string} # Should be highlighted as a
# string

str = %{This is a string} # Should be highlighted as a
# string

ary = %w[item1 item2 item3] # Could be highlighted as a
# string

symbol = :“this is a symbol” # Should be highlighted as a
# symbol (not string), sometimes
# breaks indentation

You see, I’m mainly talking about the percent % literals. Is there
anything one can do about this besides digging deep into the code for
ruby-mode?

Valete,
Marvin

PS: Please, don’t issue “vim is better” statements. This is just an
Emacs-related question and that’s it.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJOzqvhAAoJELh1XLHFkqhaPUMH/2ofX22i0V9kNwjQMf07DBnF
bie4q1Y9wKv6nrXiB/4OUuU7lxKp+CqpIM8pJAn0gpEs/3o6N0Lp9YWAd8tUcs6n
3Kv5PTkThkfIXFXoElSyQVjtJ9NFlBEnT2PzyavNV0x1pPY7ZYQFll41jmhJidxa
HVIkvqxI9+1/f+rzcEZnggQKhdvvqKu0QN3mlkcOIzY7SCI64m+fht/q8YJuFVr+
SyCZjYXZvwED/oKyHtk2aQtw+85bF1FIuHzrdTr5NN6DVsZESJEU4PQYzNsUnzoJ
XUbZGqkZAYZVHIyfnAzaCtRbcvm7sF5BWtUfWm9AyIw631wAXOzJjR8ABAyrRxw=
=+TRd
-----END PGP SIGNATURE-----

On Nov 24, 2011, at 12:42 , Quintus wrote:

                                  # indentation

ary = %w[item1 item2 item3] # Could be highlighted as a
# string

This seems wrong.

symbol = :“this is a symbol” # Should be highlighted as a
# symbol (not string), sometimes
# breaks indentation

As an unrelated aside, I’d recommend you look at align-regexp. I loves
it.

You see, Im mainly talking about the percent % literals. Is there
anything one can do about this besides digging deep into the code for
ruby-mode?

Matz is the author/maintainer of ruby-mode.el. Report a bug on redmine.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 24.11.2011 23:38, Ryan D. wrote:

ary = %w[item1 item2 item3] # Could be highlighted as
a # string

This seems wrong.

This was just a suggestion as I don’t have an idea as what else it
should be highlighted.

As an unrelated aside, I’d recommend you look at align-regexp. I
loves it.

Me too^^. Maybe my email client screw up the indentation? However,
this isn’t important for the topic…

You see, I’m mainly talking about the percent % literals. Is
there anything one can do about this besides digging deep into
the code for ruby-mode?

Matz is the author/maintainer of ruby-mode.el. Report a bug on
redmine.

Vale,
Marvin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJOz8k3AAoJELh1XLHFkqhaIDMH/j1ULAksJJ6vv/tPMb3Pq20G
f9m8roPrOkeH6F/5VWxmjH+5t0kOLU7UWNd2QtMsYOOgLm93NFSh2HcPOiKNGE5n
XF1IVLvpqlbs8/vc2vppQ3VtpMU3t0qwPn6k/+OxHPMlHB2Pejpc40cw8Q1VZwuv
6uMySn6xWWw0aeKM9n7LxySt9MT24VCFXBBRZ/RTBifPPEJ/g4BcdQiIHo96u5L2
mI8GSqx0dL+dwPhFKm5Wzudw1lqKxkKb+ymVKDOjWeZ2ua5kLNKJlnVA/hcrphH3
bxu098ii1a6qtyeFsuX+MDeqqRLjWj+iTR6I+Ot9ui+vcdiATyQAY3WvKji62uI=
=17RA
-----END PGP SIGNATURE-----