Bug 532729 - poor syntax detection in indent locks to wrong indent level
Summary: poor syntax detection in indent locks to wrong indent level
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: emacs
Version: 14
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Karel Klíč
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-11-03 16:32 UTC by John Sullivan
Modified: 2012-08-16 22:03 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-08-16 22:03:37 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description John Sullivan 2009-11-03 16:32:13 UTC
Description of problem:

emacs can get confused and erroneously decide that a less-than comparison is in fact a template instantiation. This causes "Mismatched parenthesis" errors and a failure to close an indent level, breaking indent for the rest of the file. Once in this state it is non-obvious how to recover.

Version-Release number of selected component (if applicable):

23.1-5.fc11.x86_64

How reproducible:

Very.

Steps to Reproduce:
1. Start a new emacs session
2. C-x C-f foo.cpp RET to open a fresh file
3. Type:

  int main(int argc, char *argv[])
  {
    if (foo>bar) {
    }

Indent should work as expected.

4. Erase last two lines and try:

    if (bar<foo> DEL ) {
      }

To simulate a typo. Indent is now as shown and broken.

5. Erase last two lines and try:

    if (foo>bar) {
    }

6. Now insert "bar<" before foo, *then* erase ">bar", so simulate reordering the conditional. Now TAB on the second line to show that indent is again broken.
  
Actual results:

emacs locks into believing the conditional is a template instantiation and gets indent wrong, complains about mismatched parens etc.

Expected results:

As soon as there is no longer a matched "<" ">" on the line, emacs should forget that bit could have a template. Ordinary conditionals are far more common than templates so this should be the natural choice (and the only syntactically valid one in these cases.)

Additional info:

The situation can be recovered by erasing and retyping the "<", however it took much digging to figure this out and it shouldn't be necessary.

Comment 1 John Sullivan 2009-11-03 16:38:11 UTC
(I should point out that C-c C-s with the point within the conditional gives no useful help as to why emacs is confused at this point.)

Comment 2 Bug Zapper 2010-04-28 11:04:17 UTC
This message is a reminder that Fedora 11 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 11.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '11'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 11's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 11 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 3 Bug Zapper 2010-06-28 15:22:50 UTC
Fedora 11 changed to end-of-life (EOL) status on 2010-06-25. Fedora 11 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 4 John Sullivan 2010-06-28 16:59:59 UTC
Still as reported under F12.

Comment 5 Bug Zapper 2010-11-04 06:50:06 UTC
This message is a reminder that Fedora 12 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 12.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '12'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 12's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 12 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 6 John Sullivan 2010-11-05 18:46:48 UTC
Still as reported under F13 (emacs-23.2-4.fc13.x86_64)

Comment 7 Bug Zapper 2011-06-02 17:31:06 UTC
This message is a reminder that Fedora 13 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 13.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '13'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 13's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 13 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 8 John Sullivan 2011-06-08 23:51:33 UTC
Still as reported under F14 (emacs-23.2-7.fc14.x86_64)

Comment 9 Fedora End Of Life 2012-08-16 22:03:40 UTC
This message is a notice that Fedora 14 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 14. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained.  At this time, all open bugs with a Fedora 'version'
of '14' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this 
occurring, but we forgot to do that. A thousand apologies.)

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, feel free to reopen 
this bug and simply change the 'version' to a later Fedora version.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we were unable to fix it before Fedora 14 reached end of life. If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora, you are encouraged to click on 
"Clone This Bug" (top right of this page) and open it against that 
version of Fedora.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping


Note You need to log in before you can comment on or make changes to this bug.