unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Andreas Röhler" <andreas.roehler@easy-emacs.de>
To: 14434@debbugs.gnu.org
Subject: bug#14434: 24.3; lisp mode's comment start seems bad
Date: Wed, 22 May 2013 08:15:53 +0200	[thread overview]
Message-ID: <519C6299.4070706@easy-emacs.de> (raw)
In-Reply-To: <m1d2sj4p3j.fsf@gmail.com>

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	other threads:[~2013-05-22  6:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-22  4:26 bug#14434: 24.3; lisp mode's comment start seems bad Leo Liu
2013-05-22  6:15 ` Andreas Röhler [this message]
2013-05-22 21:32 ` Stefan Monnier
2013-06-07 12:04   ` Leo Liu
2013-06-07 16:05     ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=519C6299.4070706@easy-emacs.de \
    --to=andreas.roehler@easy-emacs.de \
    --cc=14434@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).