Bug #684
Emacs UI: wrong name after auto-inserting enddefine
Description
The following in complete code adds the wrong commented out name after doing C-c C-e
(calls cocoa5-close-block
):
define fn(X) N := 1; // Now define the blah blah...
The commented out name which is inserted is the
, presumably taken from the comment.
History
#1 Updated by Anna Maria Bigatti about 9 years ago
I confirm it is just based on a trivial search for "define"
#2 Updated by John Abbott about 9 years ago
- % Done changed from 0 to 10
Perhaps the naive reverse search can be replaced by a call to cocoa5-last-unended-begin
which should be intelligent about keywords in comments/strings?
Perhaps the buggy fn is cocoa5-beg-of-defun
(around line 582)
which is called by cocoa5-auto-set-comments
(defn lines 630-670 approx)
#3 Updated by John Abbott about 9 years ago
- Status changed from New to Resolved
- Assignee set to John Abbott
- % Done changed from 10 to 80
I think I have fixed it; not entirely sure because several Emacs Lisp fns do not work the way I expected them too (or I cannot really follow what's happening in cocoa5.el
)
I'll check in tomorrow so Anna can see if it works for her. (update: checked in)
Fixing it was longer and more painful than expected :-(
#4 Updated by Anna Maria Bigatti about 9 years ago
It works for me.
#5 Updated by John Abbott about 9 years ago
- Status changed from Resolved to Closed
- % Done changed from 80 to 100
- Estimated time set to 2.50 h
As it works for me and for Anna, I'm closing the issue. The EmacsUI code really needs to be completely rewritten, but I doubt anyone will ever do it...