From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Theodor Rascanu Newsgroups: gmane.emacs.bugs Subject: bug#6158: bug in hideshow (trunk) Date: Mon, 10 May 2010 17:32:45 +0200 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=001485f0acc8e37b4c04863f1e95 X-Trace: dough.gmane.org 1273590544 16156 80.91.229.12 (11 May 2010 15:09:04 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 11 May 2010 15:09:04 +0000 (UTC) To: 6158@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue May 11 17:08:59 2010 connect(): No such file or directory Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OBr4p-0004Qa-KF for geb-bug-gnu-emacs@m.gmane.org; Tue, 11 May 2010 17:08:57 +0200 Original-Received: from localhost ([127.0.0.1]:44487 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OBqzN-0004HV-Nq for geb-bug-gnu-emacs@m.gmane.org; Tue, 11 May 2010 11:03:17 -0400 Original-Received: from [140.186.70.92] (port=53199 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OBWHP-0005UM-TK for bug-gnu-emacs@gnu.org; Mon, 10 May 2010 12:56:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OBWHK-0001Dn-Vw for bug-gnu-emacs@gnu.org; Mon, 10 May 2010 12:56:31 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35196) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OBWHK-0001Di-R0 for bug-gnu-emacs@gnu.org; Mon, 10 May 2010 12:56:26 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OBVti-0006ei-Db; Mon, 10 May 2010 12:32:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Theodor Rascanu Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 May 2010 16:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 6158 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.127350911925567 (code B ref -1); Mon, 10 May 2010 16:32:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 10 May 2010 16:31:59 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OBVte-0006eK-M7 for submit@debbugs.gnu.org; Mon, 10 May 2010 12:31:59 -0400 Original-Received: from mx10.gnu.org ([199.232.76.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OBUyg-0006DZ-V2 for submit@debbugs.gnu.org; Mon, 10 May 2010 11:33:07 -0400 Original-Received: from lists.gnu.org ([199.232.76.165]:46270) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1OBUyc-0004IF-2o for submit@debbugs.gnu.org; Mon, 10 May 2010 11:33:02 -0400 Original-Received: from [140.186.70.92] (port=46905 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OBUyW-0007nd-R5 for bug-gnu-emacs@gnu.org; Mon, 10 May 2010 11:33:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OBUyP-00036u-S8 for bug-gnu-emacs@gnu.org; Mon, 10 May 2010 11:32:56 -0400 Original-Received: from mail-ew0-f214.google.com ([209.85.219.214]:57359) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OBUyP-00036Q-Nl for bug-gnu-emacs@gnu.org; Mon, 10 May 2010 11:32:49 -0400 Original-Received: by ewy6 with SMTP id 6so1303221ewy.32 for ; Mon, 10 May 2010 08:32:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=i1QtXqncwDIQKIS3uKP/+DKUXLC18ZK7tiB25nYAmRU=; b=Nckz9U14inRS1Bww83r7AgdX2tfyRVneoN6ZKLhHneLvzNsV6MPcgDw9KEWYHLbt4t vsWzBr7gB8TMtmwNjUDa+hmM1Z+evy0LAbV3VPGE4T/Z4LHJAZRHkuwTv7tv8cChlfG6 CpCRIZ3KDHjGBzXbO3hGTE5qJvyLpKwmfjirc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=l0zlHtEWvgYTkiRxh02CcVQM4uI2w7PiIr007LcuZt6ZDyOknB8d0xebO2ONvRgU2A 8yxYeXElVlj6a+gCJLcok+7bBctLbnk3yYFuRymFxif30IU7jn1Vvw6qIxxue6u6lfs7 6XPY65YDwMAt/tSGXJ3sBlj0Vhfz3r5GIDgME= Original-Received: by 10.239.177.77 with SMTP id u13mr462732hbf.26.1273505566128; Mon, 10 May 2010 08:32:46 -0700 (PDT) Original-Received: by 10.239.150.69 with HTTP; Mon, 10 May 2010 08:32:45 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Mailman-Approved-At: Mon, 10 May 2010 12:31:57 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 10 May 2010 12:32:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Mailman-Approved-At: Tue, 11 May 2010 11:03:12 -0400 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:36873 Archived-At: --001485f0acc8e37b4c04863f1e95 Content-Type: multipart/alternative; boundary=001485f0acc8e37b4204863f1e93 --001485f0acc8e37b4204863f1e93 Content-Type: text/plain; charset=ISO-8859-1 Hi all, I guess I have found a the bug in the hideshow package: Assume the following c++ code: inline int round_to_next_power2(register unsigned int x){ //if(x!=32){ x--; x |= (x >> 1); x |= (x >> 2); x |= (x >> 4); x |= (x >> 8); x |= (x >> 16); return x + 1; //} } Ok this example do not make much sense programming wise but it shows the probelm: Hiding this function will not work. Having the cursor somewhere inside the function outside the commented lines and trying to hide it (i.e. by C-c @ C-c) will produce the following: inline int round_to_next_power2(register unsigned int x){ //if(x!=32){... } Attached is a patch producing the expected behaviour: inline int round_to_next_power2(register unsigned int x){... } Greetings, Theodor --001485f0acc8e37b4204863f1e93 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi all,

I guess I have found a the bug in the hideshow package:

Assume the following c++ code:

inline int round_to_next_power2(register unsigned int x){
=A0 //if(x!=3D32){
=A0 x--;
=A0 x |=3D (x >> 1);
=A0 x |=3D (x >> 2);
=A0 x |=3D (x >> 4);
=A0 x |=3D (x >> 8);
=A0 x |=3D (x >> 16);
=A0 return x + 1;
=A0 //}
}

Ok this example do not make much sense programming wise but it shows the pr= obelm:
Hiding this function will not work.
Having the cursor somewhere inside the function outside the commented lines and trying to hide it (i.e. by C-c @ C-c) will produce the following:=

inline int round_to_next_power2(register unsigned int x){
//if(x!=3D32){... }

Attached is a patch producing the expected behaviour:
inline int round_to_next_power2(register unsigned int x){... }

Greetings,
Theodor
--001485f0acc8e37b4204863f1e93-- --001485f0acc8e37b4c04863f1e95 Content-Type: text/x-patch; charset=US-ASCII; name="emacs-hideshow_comment.patch" Content-Disposition: attachment; filename="emacs-hideshow_comment.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_g91g9vf90 LS0tIGxpc3AvcHJvZ21vZGVzL2hpZGVzaG93LmVsLm9yaWcJMjAxMC0wNS0xMCAxMzoyMTo0OC41 NTU3MzIzMjMgKzAyMDAKKysrIGxpc3AvcHJvZ21vZGVzL2hpZGVzaG93LmVsCTIwMTAtMDUtMTAg MTM6MjE6NDAuNzQ1NjQ2MTMwICswMjAwCkBAIC02OTAsMTAgKzY5MCwxMiBAQCBSZXR1cm4gcG9p bnQsIG9yIG5pbCBpZiBvcmlnaW5hbCBwb2ludCB3CiAgICAgICAgIChwb2ludCkKICAgICAgIDs7 IGxvb2sgYmFja3dhcmQgZm9yIHRoZSBzdGFydCBvZiBhIGJsb2NrIHRoYXQgY29udGFpbnMgdGhl IGN1cnNvcgogICAgICAgKHdoaWxlIChhbmQgKHJlLXNlYXJjaC1iYWNrd2FyZCBocy1ibG9jay1z dGFydC1yZWdleHAgbmlsIHQpCi0gICAgICAgICAgICAgICAgICAobm90IChzZXRxIGRvbmUKLSAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKDwgaGVyZSAoc2F2ZS1leGN1cnNpb24KLSAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChocy1mb3J3YXJkLXNleHAgKG1hdGNo LWRhdGEgdCkgMSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChwb2lu dCkpKSkpKSkKKyAgICAgICAgICAgICAgICAgIChzZXRxIGRvbmUKKwkJCSAgICAgKDwgaGVyZSAo c2F2ZS1leGN1cnNpb24KKwkJCQkgICAgICAgKGhzLWZvcndhcmQtc2V4cCAobWF0Y2gtZGF0YSB0 KSAxKQorCQkJCSAgICAgICAocG9pbnQpKSkpCisJCSAgKGhzLWluc2lkZS1jb21tZW50LXApCisJ CSAgKG5vdCAoc2V0cSBkb25lIG5pbCkpKSkKICAgICAgIChpZiBkb25lCiAgICAgICAgICAgKHBv aW50KQogICAgICAgICAoZ290by1jaGFyIGhlcmUpCg== --001485f0acc8e37b4c04863f1e95--