GNU bug report logs - #10786
24.0.93; ruby-mode improperly handles symbols with keyword names in JS-style hashes

Previous Next

Package: emacs;

Reported by: Dmitry Gutov <dgutov <at> yandex.ru>

Date: Sat, 11 Feb 2012 00:33:02 UTC

Severity: minor

Tags: patch

Found in version 24.0.93

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 10786 in the body.
You can then email your comments to 10786 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#10786; Package emacs. (Sat, 11 Feb 2012 00:33:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dmitry Gutov <dgutov <at> yandex.ru>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 11 Feb 2012 00:33:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.0.93; ruby-mode improperly handles symbols with keyword names
	in JS-style hashes
Date: Sat, 11 Feb 2012 04:27:33 +0400
[Message part 1 (text/plain, inline)]
Ruby 1.9 introduced the new syntax for hashes:

{key1: value1, key2: value2}

which is synonymous to {:key1 => value1, :key2 => value2}

The latest ruby-mode highlights the keywords in the new-style hashes 
properly, but fails to account for the case when the symbol's name is an 
otherwise reserved keyword. Examples:

link_to("root", root_path, class: "pink")

before_filter :do_stuff, if: :not_busy?

announce("The end is near!", end: "2012-12-31")

In all examples, the symbol (class, if, end) is being highlighted as a 
reserved keyword, and the indentation becomes broken on all lines below it.

There's a similar bug on the Ruby bug tracker:
http://bugs.ruby-lang.org/issues/5140

See attachment for the patch.

[ruby-keyword-symbols-patch.diff (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10786; Package emacs. (Sat, 11 Feb 2012 01:52:01 GMT) Full text and rfc822 format available.

Message #8 received at 10786 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: 10786 <at> debbugs.gnu.org
Subject: Re: 24.0.93; ruby-mode improperly handles symbols with keyword names
	in JS-style hashes
Date: Sat, 11 Feb 2012 05:50:10 +0400
Correction:

>> The latest ruby-mode highlights the keywords in the new-style hashes
properly

Should be "highlights the symbols", not keywords.




Reply sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
You have taken responsibility. (Wed, 21 Mar 2012 19:05:02 GMT) Full text and rfc822 format available.

Notification sent to Dmitry Gutov <dgutov <at> yandex.ru>:
bug acknowledged by developer. (Wed, 21 Mar 2012 19:05:02 GMT) Full text and rfc822 format available.

Message #13 received at 10786-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 10786-done <at> debbugs.gnu.org
Subject: Re: bug#10786: 24.0.93;
	ruby-mode improperly handles symbols with keyword names in JS-style
	hashes
Date: Wed, 21 Mar 2012 14:33:28 -0400
Thanks, installed,


        Stefan




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 19 Apr 2012 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 13 years and 59 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.