GNU bug report logs - #67569
29.1; ruby-mode syntax highlighting breaks with variable named "index" and "/" operator

Previous Next

Package: emacs;

Reported by: Michael Hoy <mjh <at> mjhoy.com>

Date: Fri, 1 Dec 2023 15:04:01 UTC

Severity: normal

Found in version 29.1

Done: Dmitry Gutov <dmitry <at> gutov.dev>

Bug is archived. No further changes may be made.

Full log


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

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: mjh <at> mjhoy.com, 67569 <at> debbugs.gnu.org
Subject: Re: bug#67569: 29.1; ruby-mode syntax highlighting breaks with
 variable named "index" and "/" operator
Date: Sat, 16 Dec 2023 14:17:36 +0200
This is resolved and closed, I just replied to a different subthread.

I suppose you set up some automation for pinging non-respondents? :)

On 16/12/2023 13:58, Eli Zaretskii wrote:
> Ping!
> 
>> Cc:67569 <at> debbugs.gnu.org
>> Date: Sat, 09 Dec 2023 10:32:22 +0200
>> From: Eli Zaretskii<eliz <at> gnu.org>
>>
>>> From: Michael Hoy<mjh <at> mjhoy.com>
>>> Date: Fri, 01 Dec 2023 09:27:47 -0500
>>>
>>> In the standard ruby-mode, a variable named "index" followed by a "/"
>>> causes the syntax highlighting to break -- it appears that after the
>>> slash everything is interpreted as part of a regular expression until
>>> another "/" appears.
>>>
>>> You can reproduce this fairly easily. using 'emacs -Q', go to the
>>> scratch buffer and clear it. Run 'M-x ruby-mode'. Enter something like
>>> the following:
>>>
>>> def foo
>>>    index = 5
>>>    x = index / 3
>>>    puts "#{x}"
>>> end
>>>
>>> Note that starting after the "/" until the end, syntax highlighting and
>>> indentation break (everything, in my color scheme, is purple). If you
>>> add a "/" for instance to the "puts" line, syntax highlighting and
>>> indentation will be restored after that.
>>>
>>> There is a report here about the bug:
>>> https://emacs.stackexchange.com/questions/23802/division-sometimes-breaks-syntax-highlighting-in-ruby-mode
>>> The author says in the comments they used "M-x report-emacs-bug", but I
>>> couldn't find it (and the comments suggest that it may not have been
>>> sent correctly). Apologies if this is already reported!
>> Dmitry, any comments?
>>
>>
>>
>>





This bug report was last modified 1 year and 217 days ago.

Previous Next


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