Project

General

Profile

Bug #462

Emacs UI: semicolon problems

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

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

100%

Estimated time:
1.00 h
Spent time:

Description

Semicolon sometimes does strange things.

It places the cursor in the wrong place if you type semicolon immediately after a string whose last word is a keyword:

PrintLn "No solution for ";

Typing the above puts the cursor immediately after for, not after the semicolon as one would expect.

Something similar occurs if you try to type a semicolon in a string.

History

#1 Updated by John Abbott about 10 years ago

I think the problem is the call on line cocoa5.el:489:

(if abbrev-mode (expand-abbrev))

I believe this should happen only if not in a string or comment.

The problem is not serious: one can easily put the cursor back to where it should be, but it is still embarassing/irritating.

PS I have just confirmed that the problem arises also for semicolons in comments

#2 Updated by John Abbott about 10 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 10

I have modified the emacs fn cocoa5-electric-semi-or-dot.

It now calls expand-abbrev only when point is in code.
EDIT (I was mistaken about the cursor being moved) It works tolerably well now, but if you type several semicolons, and then "undo" them you'll see that it takes 2 undo steps do eliminate a semicolon (not perfect, but acceptable, I suppose).

NOTE expand-abbrev seems to ignore some whitespace and punctuation characters when checking whether the last word in the buffer is expandable. An inconvenient "feature" in this instance :-(

#3 Updated by Anna Maria Bigatti almost 10 years ago

  • Target version set to CoCoA-5.1.0 Easter14

#4 Updated by Anna Maria Bigatti almost 10 years ago

  • Assignee set to John Abbott

Feedback
Works fine for me, no problems in strings or comments. Has this been fixed already?

#5 Updated by John Abbott almost 10 years ago

  • Status changed from In Progress to Feedback
  • % Done changed from 10 to 90
  • Estimated time set to 1.00 h

It seems to work OK for me too.
I do vaguely recall discovering what the problem was and then fixing it (but evidently I forgot to update redmine).

#6 Updated by John Abbott almost 10 years ago

  • Status changed from Feedback to Closed
  • % Done changed from 90 to 100

It works fine both for me and for Anna -- after >2 weeks' testing. Closing!

Also available in: Atom PDF