GNU bug report logs - #16079
`ruby-forward-string' chokes on caret delimiters (PATCH)

Previous Next

Package: emacs;

Reported by: Cameron Desautels <camdez <at> gmail.com>

Date: Fri, 6 Dec 2013 17:34:02 UTC

Severity: normal

Tags: patch

Done: Dmitry Gutov <dgutov <at> yandex.ru>

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 16079 in the body.
You can then email your comments to 16079 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#16079; Package emacs. (Fri, 06 Dec 2013 17:34:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Cameron Desautels <camdez <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 06 Dec 2013 17:34:03 GMT) Full text and rfc822 format available.

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

From: Cameron Desautels <camdez <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: `ruby-forward-string' chokes on caret delimiters (PATCH)
Date: Fri, 6 Dec 2013 11:33:21 -0600
[Message part 1 (text/plain, inline)]
`ruby-forward-string' is a function used to skip past strings in Ruby
mode. Ruby supports using any non-alpha character following a "%" to
delimit a string.  All of the following are valid Ruby syntax:

    - %[foo bar]
    - %/foo bar/
    - %%foo bar%
    - %^foo bar^

Currently ruby-mode can handle all of these except the last one, which
yields the following:

    #     Debugger entered--Lisp error: (invalid-regexp "Unmatched [ or [^")

The root of the problem is the construction of the following invalid
regexp: "[^]" (which is an incomplete negated character class).

This bug manifests itself by breaking `ruby-parse-region' in any
buffer containing a caret-delimited string.  This breaks indentation,
movement commands, and even keeps Emacs from building an Imenu.

I've attached a patch which resolves the issue.  Note that this patch
builds on the test suite for `ruby-forward-string' that I included in
issue #16078.
--
Cameron Desautels <camdez <at> gmail.com>
[fix-ruby-forward-string.diff (text/plain, attachment)]

Reply sent to Dmitry Gutov <dgutov <at> yandex.ru>:
You have taken responsibility. (Mon, 09 Dec 2013 03:47:02 GMT) Full text and rfc822 format available.

Notification sent to Cameron Desautels <camdez <at> gmail.com>:
bug acknowledged by developer. (Mon, 09 Dec 2013 03:47:03 GMT) Full text and rfc822 format available.

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

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Cameron Desautels <camdez <at> gmail.com>
Cc: 16079-done <at> debbugs.gnu.org
Subject: Re: bug#16079: `ruby-forward-string' chokes on caret delimiters
 (PATCH)
Date: Mon, 09 Dec 2013 05:46:17 +0200
Cameron Desautels <camdez <at> gmail.com> writes:

> This bug manifests itself by breaking `ruby-parse-region' in any
> buffer containing a caret-delimited string.  This breaks indentation,
> movement commands, and even keeps Emacs from building an Imenu.

Thanks, I've applied the fix.

> I've attached a patch which resolves the issue.  Note that this patch
> builds on the test suite for `ruby-forward-string' that I included in
> issue #16078.

The tests are not included so far, let's continue discussing them in
#16078. Closing this one.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 06 Jan 2014 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 121 days ago.

Previous Next


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