--- Begin Message ---
Subject: |
24.3; lisp mode's comment start seems bad |
Date: |
Wed, 22 May 2013 12:26:24 +0800 |
After fixing bug#14303, we can observe the following bug:
1. Emacs -q
2. insert in a emacs lisp mode buffer:
(
;;
)
3. Move point to be end of ;;
4. M-j
You should see:
(
;;
;
)
This seems to be due to bad comment-start-skip. Is the following fix correct?
--- lisp/emacs-lisp/lisp-mode.el.gz
+++ #<buffer lisp-mode.el.gz>
@@ -219,7 +219,7 @@
(make-local-variable 'comment-start-skip)
;; Look within the line for a ; following an even number of backslashes
;; after either a non-backslash or the line beginning.
- (setq comment-start-skip "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+ *")
+ (setq comment-start-skip "\\(\\(^\\|[^\\\\\n;]\\)\\(\\\\\\\\\\)*\\);+ *")
(make-local-variable 'font-lock-comment-start-skip)
;; Font lock mode uses this only when it KNOWS a comment is starting.
(setq font-lock-comment-start-skip ";+ *")
Diff finished. Wed May 22 12:24:18 2013
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#14434: 24.3; lisp mode's comment start seems bad |
Date: |
Fri, 07 Jun 2013 20:04:28 +0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (OS X 10.8.3) |
On 2013-05-23 05:32 +0800, Stefan Monnier wrote:
> That's one way to see it. Another is that it's a regression introduced
> by the fix to bug#14303. It probably affects more than
> emacs-lisp-mode. So it'd be better to fix it by improving your fix to
> bug#14303. E.g. after the new while loop which finds the comment start, do
> a looking-at to make sure the match-data extends as far as possible.
>
> Tho maybe, we should take a new look at bug#14303 to see why it failed,
> since after all the old comment-search-backward did already pay
> attention to comment-use-global-state (via comment-search-forward), so
> maybe bug#14303 was really due to a bug in comment-search-forward.
Thanks, Stefan, for the hints.
The fix for bug#14303 seems bad so I have reverted it and instead set
comment-use-global-state to t in octave-mode.
Leo
--- End Message ---