bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#14434: 24.3; lisp mode's comment start seems bad


From: Andreas Röhler
Subject: bug#14434: 24.3; lisp mode's comment start seems bad
Date: Wed, 22 May 2013 08:15:53 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130329 Thunderbird/17.0.5

Am 22.05.2013 06:26, schrieb Leo Liu:
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





Maybe it would be worth to re-consider that comment-start-skip.
What about to drop it?

All we need is the position of comment start and it's end. What to do with code 
before resp. after, let the modes decide.

AFAIU you can't check for an even number of backslashes with a regexp, never.
So that will remain buggy.

Cheers,

andreas






reply via email to

[Prev in Thread] Current Thread [Next in Thread]