Subject: bug#8933: closed (Re: bug#8933: 'js-mode' break single char comment highlighting from 'define-generic-mode'.)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 30 Jun 2011 16:24:01 +0000

Your bug report

#8933: 'js-mode' break single char comment highlighting from 'define-generic-mode'.

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
8933: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8933
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#8933: 'js-mode' break single char comment highlighting from 'define-generic-mode'.
From: Stefan Monnier <[email-masked]>
To: Lawrence Mitchell <[email-masked]>
Cc: [email-masked]
Date: Thu, 30 Jun 2011 12:23:30 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

> This is because js-mode stomps on the default value of
> comment-start and comment-end (rather than using
> make-local-variable).  This confuses generic-mode.

Thanks, installed,

        Stefan

Subject: 'js-mode' break single char comment highlighting from 'define-generic-mode'.
From: Oleksandr Gavenko <[email-masked]>
To: [email-masked]
Date: Fri, 24 Jun 2011 22:23:14 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

I use Emacs 23.3.

   $ emacs -Q

Next eval:

(define-generic-mode my-mode
   '(?\; ?#)
   nil nil nil nil)

And open file with two or more lines:

; commented line (1)
wrongly highlighted line (2)
another wrongly highlighted line (3)

After 'M-x my-mode RET' line (1) highlighted as comment line.
Another line not.

Then open any .js file so js-mode loaded and back to 'my-mode'
file and revert it.

Now all line highlighted as comment lines!

Because of this I switch .js files to c++-mode (from my .emacs):

   (setq auto-mode-alist (rassq-delete-all 'js-mode auto-mode-alist))
   (add-to-list 'auto-mode-alist '("\\.js$" . c++-mode))

and move '(desktop-save-mode 1)' below this lines.

For C-like comments this bug not reproduced.

-- 
Best regards!