Bug 595546

Summary: emacs: hideshow library matches wrong parenthesis under certain circumstances
Product: [Fedora] Fedora Reporter: erazortt
Component: emacsAssignee: Karel Klíč <kklic>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 12CC: jonathan.underwood, kklic, rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: emacs-23.2-4.fc13 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-08-17 05:30:25 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
patch to solve the described problem in the hideshow package none

Description erazortt 2010-05-24 22:31:11 UTC
Created attachment 416235 [details]
patch to solve the described problem in the hideshow package

Description of problem:
Try to use the hideshow package to hide the following c++ function:

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;
  //}
}

The hideshow package does not take into account that the opening parenthesis is commented out: "//if(x!=32){"
Thus it will hide the function according to this parenthesis.

Version-Release number of selected component (if applicable):
All emacs versions (23.2, 23.1 and older)

How reproducible:
always

Steps to Reproduce:
1. load hideshow in .emacs: (require 'hideshow)
2. add c++ hook in .emacs: (add-hook 'c-mode-common-hook   'hs-minor-mode)
3. try to hide the shown c++ code (i.e. by C-c @ C-c)
  
Actual results:
inline int round_to_next_power2(register unsigned int x){
//if(x!=32){... }

Expected results:
inline int round_to_next_power2(register unsigned int x){... }

Additional info:
The problem can be solved by the attached patch

Comment 1 Fedora Update System 2010-08-03 15:47:42 UTC
emacs-23.2-4.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/emacs-23.2-4.fc13

Comment 2 Fedora Update System 2010-08-03 15:49:18 UTC
emacs-23.1-24.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/emacs-23.1-24.fc12

Comment 3 Fedora Update System 2010-08-05 23:33:54 UTC
emacs-23.2-4.fc13 has been pushed to the Fedora 13 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update emacs'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/emacs-23.2-4.fc13

Comment 4 Fedora Update System 2010-08-17 05:30:10 UTC
emacs-23.2-4.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 5 Fedora Update System 2010-08-17 05:42:31 UTC
emacs-23.1-24.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.