GNU bug report logs - #8933
'js-mode' break single char comment highlighting from 'define-generic-mode'.

Previous Next

Package: emacs;

Reported by: Oleksandr Gavenko <gavenkoa <at> gmail.com>

Date: Fri, 24 Jun 2011 21:24:02 UTC

Severity: normal

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#8933: closed ('js-mode' break single char comment
 highlighting from 'define-generic-mode'.)
Date: Thu, 30 Jun 2011 16:24:01 +0000
[Message part 1 (text/plain, inline)]
Your message dated Thu, 30 Jun 2011 12:23:30 -0400
with message-id <jwvfwmrs2zp.fsf-monnier+emacs <at> gnu.org>
and subject line Re: bug#8933: 'js-mode' break single char comment highlighting from 'define-generic-mode'.
has caused the GNU bug report #8933,
regarding 'js-mode' break single char comment highlighting from 'define-generic-mode'.
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
8933: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8933
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Oleksandr Gavenko <gavenkoa <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 'js-mode' break single char comment highlighting from
	'define-generic-mode'.
Date: Fri, 24 Jun 2011 22:23:14 +0100
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!


[Message part 3 (message/rfc822, inline)]
From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Lawrence Mitchell <wence <at> gmx.li>
Cc: 8933-done <at> debbugs.gnu.org
Subject: Re: bug#8933: 'js-mode' break single char comment highlighting from
	'define-generic-mode'.
Date: Thu, 30 Jun 2011 12:23:30 -0400
> 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


This bug report was last modified 13 years and 249 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.