GNU bug report logs - #8036
[PATCH] Prevent hide-show mode from getting confused by braces in comments

Previous Next

Package: emacs;

Reported by: Dima Kogan <dkogan <at> cds.caltech.edu>

Date: Mon, 14 Feb 2011 08:38:02 UTC

Severity: normal

Tags: patch

Done: Chong Yidong <cyd <at> stupidchicken.com>

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 8036 in the body.
You can then email your comments to 8036 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 owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8036; Package emacs. (Mon, 14 Feb 2011 08:38:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dima Kogan <dkogan <at> cds.caltech.edu>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 14 Feb 2011 08:38:02 GMT) Full text and rfc822 format available.

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

From: Dima Kogan <dkogan <at> cds.caltech.edu>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Prevent hide-show mode from getting confused by braces in
	comments
Date: Sun, 13 Feb 2011 23:02:57 -0800
[Message part 1 (text/plain, inline)]
Emacs bug #700 (http://debbugs.gnu.org/cgi/bugreport.cgi?bug=700)
contained a patch by Dmitry Bolshakov addressing 2 issues in hide-show
minor mode. The fix to one of the issues got integrated into the code
base, but the other one fell through the cracks, I think. The issue it
fixes is to prevent hide-show mode from parsing braces inside comments.
These braces can confuse the parser, since they don't necessarily match
up.

I'm attaching Dmitry's test case that demonstrates the issue, and his patch to
fix it.

dima
[unbalanced-braces-test.pl (application/x-perl, attachment)]
[hs.patch (text/x-patch, attachment)]

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8036; Package emacs. (Tue, 15 Feb 2011 04:12:02 GMT) Full text and rfc822 format available.

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

From: Dima Kogan <dkogan <at> cds.caltech.edu>
To: 8036 <at> debbugs.gnu.org
Subject: Re: bug#8036: Acknowledgement ([PATCH] Prevent hide-show mode from
	getting confused by braces in comments)
Date: Mon, 14 Feb 2011 20:20:38 -0800
[Message part 1 (text/plain, inline)]
I accidentally attached the Dmitry's original patch file, that
contains both the merged and unmerged fixes. Further, it appears that
Dmitry's original patch handles the case where hs-hide-all is called
in the attached sample perl script, BUT it does not handle the case
where hs-hide-level is called with the point at the end of the
buffer. I'm attaching a new patch that ONLY contains the pertinent
changes and that addresses the second issue also.
[hideshow-comments.patch (text/x-patch, attachment)]

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8036; Package emacs. (Wed, 16 Feb 2011 04:54:02 GMT) Full text and rfc822 format available.

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

From: Dima Kogan <dkogan <at> cds.caltech.edu>
To: 8036 <at> debbugs.gnu.org
Subject: Re: bug#8036: [PATCH] Prevent hide-show mode from getting confused
	by braces in comments
Date: Tue, 15 Feb 2011 21:01:59 -0800
[Message part 1 (text/plain, inline)]
I have discovered a case where the previous patch causes an infinite
loop. The new patch I'm attaching resolves that issue
[hideshow-comments.patch (text/x-patch, attachment)]

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8036; Package emacs. (Sat, 19 Feb 2011 22:21:03 GMT) Full text and rfc822 format available.

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

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Dima Kogan <dkogan <at> cds.caltech.edu>
Cc: 8036 <at> debbugs.gnu.org
Subject: Re: bug#8036: [PATCH] Prevent hide-show mode from getting confused by
	braces in comments
Date: Sat, 19 Feb 2011 17:20:43 -0500
Dima Kogan <dkogan <at> cds.caltech.edu> writes:

> I have discovered a case where the previous patch causes an infinite
> loop. The new patch I'm attaching resolves that issue

Looks reasonable.  Committed, and thanks.




bug closed, send any further explanations to Dima Kogan <dkogan <at> cds.caltech.edu> Request was from Chong Yidong <cyd <at> stupidchicken.com> to control <at> debbugs.gnu.org. (Sat, 19 Feb 2011 22:21:03 GMT) Full text and rfc822 format available.

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

This bug report was last modified 14 years and 96 days ago.

Previous Next


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