Project

General

Profile

Bug #445

EmacsUI: indentation is wrong sometimes (e.g. if Lambda1 is on previous line)

Added by John Abbott about 10 years ago. Updated almost 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
EmacsUI
Target version:
Start date:
19 Feb 2014
Due date:
% Done:

100%

Estimated time:
1.50 h
Spent time:

Description

The emacs UI sometimes gets indentation wrong inside a file.cocoa5.

The specific case I observed was when the previous line contained a variable called Lambda1.

History

#1 Updated by John Abbott about 10 years ago

I think the problem may be in the definition of cocoa5-beg-block-re.
I presume the -re suffix means "regular expression". As defined the variable contains the string lambda, but this should be \blambda\b; the \b matches only symbols which cannot be in a "word" (e.g. spaces, punctuation)

My guess may also be quite wrong; I suspect the problem lies in the fn cocoa5-calculate-indent which is not easy to follow.

I'll leave it to an emacs expert to sort it out :-)
[I hope I'm not that emacs expert!]

#2 Updated by John Abbott about 10 years ago

I've made some quick tests in a buffer associated to file.cocoa5.

Adding a prefix (comprising letters and/or digits) to a keyword seems to stop the emacs indent calculator from recognizing it. Adding a suffix sometimes inhibits recognition and sometimes allows it. Else seems not to be recognized when it has a suffix. If is still recognized when it has a suffix (even quite a long one).

EndXYZ keywords with a suffix are not recognized as changing indentation.
[I just a few cases]

However, C-c C-e seems not to recognize keywords with suffixes!

#3 Updated by John Abbott about 10 years ago

  • Target version set to CoCoA-5.0.9
  • % Done changed from 0 to 10

#4 Updated by John Abbott about 10 years ago

  • % Done changed from 10 to 50

I think I have fixed it! :-)

Now the question is how to test it thoroughly?
[answer: a class full of unwitting guinea-pigs? ;-)]

#5 Updated by John Abbott about 10 years ago

  • Status changed from New to Feedback
  • % Done changed from 50 to 90

The change was to cocoa5-beg-block-re; I simply added initial "\\<" and final "\\>" -- it seems that they had been there in the past, but were lost at some point.

I've done some more ad hoc testing; seems OK, so I've checked in.

#6 Updated by Anna Maria Bigatti about 10 years ago

  • Assignee set to John Abbott
  • % Done changed from 90 to 100

Seems OK. I'm closing this (unless future guinea-pigs resurrects it ;-)

#7 Updated by John Abbott about 10 years ago

  • Status changed from Feedback to Closed

#8 Updated by Anna Maria Bigatti almost 10 years ago

  • Estimated time set to 1.50 h

Also available in: Atom PDF