all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#7921: 23.2.91; js-mode font lock problem with comments
@ 2011-01-26 14:56 Evan Owens
  2011-01-26 17:43 ` Deniz Dogan
  0 siblings, 1 reply; 9+ messages in thread
From: Evan Owens @ 2011-01-26 14:56 UTC (permalink / raw)
  To: 7921

[-- Attachment #1: Type: text/plain, Size: 9352 bytes --]

--text follows this line--
This bug report will be sent to the Free Software Foundation,
not to your local site managers!
Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.

Your report will be posted to the bug-gnu-emacs@gnu.org mailing list
and the gnu.emacs.bug news group, and at http://debbugs.gnu.org.

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug.  If you can, give
a recipe starting from `emacs -Q':

Given an HTML/JS file with the following content:

<h1>Here is some HTML</h1>

<script type="text/javascript">
Event.onDOMReady(function() {
    // comment one
    function createCookie(name, value, expires) {
        if (expires) {
            var date = new Date();
            date.setTime(date.getTime()+(expires*24*60*60*1000));
            expires = "; expires="+date.toGMTString();
        } else {
            expires = '';
        }
        document.cookie = name+"="+value+expires+"; path=/";
    };

    if ($('discount-details-link')) {  // comment two
        Event.observe($('discount-details-link'), 'click', function() {
            Effect.Appear('discount-popup');
        });
    }
    // nXhtml seems to think everything below comment two is a string...
});
</script>


Note that everything under "// comment two" is fontified as a string.

If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
For information about debugging Emacs, please read the file
c:/cygwin/usr/local/emacs/emacs-23.2.91/etc/DEBUG.


In GNU Emacs 23.2.91.1 (i386-mingw-nt6.1.7600)
 of 2010-12-11 on 3249CTO
Windowing system distributor `Microsoft Corp.', version 6.1.7600
configured using `configure --with-gcc (4.4) --no-opt --cflags
-Ic:/imagesupport/include'

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: ENU
  value of $XMODIFIERS: nil
  locale-coding-system: cp1252
  default enable-multibyte-characters: t

Major mode: Javascript

Minor modes in effect:
  show-paren-mode: t
  icomplete-mode: t
  global-hl-line-mode: t
  nxhtml-menu-mode: t
  nxhtml-tag-do-also: t
  popcmp-group-alternatives: t
  popcmp-short-help-beside-alts: t
  shell-dirtrack-mode: t
  mlinks-active-links: t
  recentf-mode: t
  rngalt-minimal-validation-header: t
  rngalt-display-validation-header: t
  global-ede-mode: t
  global-auto-complete-mode: t
  auto-complete-mode: t
  flymake-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: (only . t)

Recent input:
<wheel-down> <double-wheel-down> <triple-wheel-down>
<wheel-down> <double-wheel-down> <triple-wheel-down>
<triple-wheel-down> <triple-wheel-down> <triple-wheel-down>
<wheel-down> <double-wheel-down> <triple-wheel-down>
<triple-wheel-down> <triple-wheel-down> <triple-wheel-down>
<down-mouse-1> <mouse-1> C-x C-f C-a C-f C-a <C-right>
<C-right> <C-left> C-k U s e r <tab> E v <tab> SPC
O <tab> D o <tab> w <tab> t e <tab> s <tab> <return>
<down> <down> C-x 1 <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <up> <up> <up> <up> <up> <up> <up> <down>
<down> <down> <down> <down> <down> <down> <down> <up>
<up> <up> <up> <up> <up> <up> <escape> x r e p o r
t <tab> <return> <help-echo> <down-mouse-1> <mouse-movement>
<mouse-1> <help-echo> f o n t <backspace> <down-mouse-1>
<mouse-movement> <drag-mouse-1> <up> <up> <escape>
x j s C-g <up> <up> <up> C-_ <up> <up> <escape> x j
s SPC m o d e <return> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <up> <up> <up> <up>
<help-echo> <down-mouse-1> <mouse-1> <help-echo> <down-mouse-1>
<mouse-movement> <mouse-movement> <drag-mouse-1> <escape>
x r e p o <tab> t <tab> e <backspace> <backspace> r
<tab> e <backspace> <return>

Recent messages:
Using vacuous schema
Error in menu-bar-update-hook: (error This buffer cannot use
`imenu-default-create-index-function')
byte-code: Command attempted to use minibuffer while in minibuffer
Quit
Undo!
Using vacuous schema [3 times]
Fontifying test.php... (syntactically...)
Using vacuous schema
Mark set
Making completion list...

Load-path shadows:
c:/cygwin/usr/local/emacs/site-lisp/nxhtml-devel/util/ack hides
c:/cygwin/usr/local/emacs/emacs-23.2.91/../site-lisp/ack
c:/cygwin/usr/local/emacs/site-lisp/ecb/ecb2/test hides
c:/cygwin/usr/local/emacs/site-lisp/elim/elisp/test
c:/cygwin/usr/local/emacs/site-lisp/nxhtml-devel/related/php-mode hides
c:/cygwin/usr/local/emacs/site-lisp/emacs-symfony/t/extlib/php-mode
c:/cygwin/usr/local/emacs/emacs-23.2.91/../site-lisp/auto-complete hides
c:/cygwin/usr/local/emacs/site-lisp/emacs-symfony/t/extlib/auto-complete
c:/cygwin/usr/local/emacs/emacs-23.2.91/../site-lisp/anything hides
c:/cygwin/usr/local/emacs/site-lisp/emacs-symfony/t/extlib/anything
c:/cygwin/usr/local/emacs/site-lisp/anything-project/anything-project hides
c:/cygwin/usr/local/emacs/site-lisp/emacs-symfony/t/extlib/anything-project
c:/cygwin/usr/local/emacs/emacs-23.2.91/../site-lisp/anything-match-plugin
hides
c:/cygwin/usr/local/emacs/site-lisp/emacs-symfony/t/extlib/anything-match-plugin
c:/cygwin/usr/local/emacs/emacs-23.2.91/../site-lisp/anything-grep hides
c:/cygwin/usr/local/emacs/site-lisp/emacs-symfony/t/extlib/anything-grep

Features:
(shadow mail-extr message ecomplete rfc822 mml mml-sec password-cache
mailabbrev gmm-utils mailheader canlock hashcash emacsbug js json
newcomment nxml-uchnm rng-xsd xsd-regexp rng-cmpct subword nxhtml-mumamo
mumamo-fun mumamo-chunks amrita nxhtml paren icomplete hl-line
flymake-files flymakemsg nxhtml-autostart nxhtml-autoload moz majmodpri
vc-bzr sha1 hex-util nxhtml-menu udev-rinari udev-ecb udev css-color
nxhtml-mode html-quote tidy-xhtml ediff-merg ediff-diff ediff-wind
ediff-help ediff-util ediff-mult ediff-init ediff html-imenu imenu
loadhist popcmp xhtml-help html-toc xml fupd html-pagetoc appmenu-fold
fold-dwim tex-mode shell inlimg html-write mlinks appmenu help-mode view
html-upl html-site ffip gimpedit foldit dired web-vcs url-http tls
url-auth url-gw mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047
rfc2045 qp ietf-drums web-autoload ourcomments-widgets ourcomments-util
cus-edit cus-start cus-load uniquify recentf tree-widget mm-url url
url-proxy url-privacy url-expand url-methods url-history url-cookie
mailcap gnus gnus-ems nnheader gnus-util netrc mail-utils org
org-footnote org-src org-list org-faces org-compat org-macs time-date
noutline outline ido bookmark pp apropos mumamo sgml-mode ruby-mode
rngalt rng-nxml rng-valid rng-loc rng-uri rng-parse nxml-parse rng-match
rng-dt rng-util rng-pttrn nxml-ns nxml-mode nxml-outln nxml-rap
nxml-util nxml-glyph nxml-enc xmltok mumamo-cmirr flyspell ispell
desktop nxhtml-base auto-complete-config ede/linux ede/emacs
ede/cpp-root ede/speedbar ede/files ede ede/base ede/auto ede/source
eieio-speedbar eieio-custom symfony php-completion easy-mmode
auto-complete popup url-util url-parse url-vars mm-util mail-prsvr
browse-url anything-project php-mode cc-langs cc-mode cc-fonts cc-menus
cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs add-log etags rx
showtip saveplace hidesearch hide-lines gtags flymake-extension
fringe-helper flymake ecb warnings ecb-symboldef ecb-analyse
ecb-compatibility ecb-winman-support ecb-autogen autoload ecb-tod
ecb-cycle ecb-eshell ecb-help ecb-jde ecb-method-browser hideshow
ecb-semantic ecb-file-browser ecb-speedbar ecb-layout ecb-create-layout
ecb-compilation ecb-common-browser speedbar sb-image dframe assoc
ecb-navigate ecb-mode-line ecb-face tree-buffer ecb-upgrade
ecb-cedet-wrapper semantic/db-mode semantic/db-find semantic/db-ref
semantic/analyze semantic/sort semantic/scope semantic/analyze/fcn
semantic/db eieio-base semantic/format ezimage semantic/tag-ls
semantic/ctxt semantic/util-modes easymenu semantic/util semantic
semantic/tag semantic/lex semantic/fw eieio byte-opt bytecomp
byte-compile mode-local cedet wid-edit ecb-util thingatpt silentcomp
browse-kill-ring derived anything-match-plugin anything-grep grep
compile anything advice advice-preload help-fns edmacro kmacro sort
cygwin-mount ange-ftp regexp-opt comint ring executable cl cl-19 tooltip
ediff-hook vc-hooks lisp-float-type mwheel dos-w32 disp-table ls-lisp
w32-win w32-vars tool-bar dnd fontset image fringe lisp-mode register
page menu-bar rfn-eshadow timer select scroll-bar mldrag mouse jit-lock
font-lock syntax facemenu font-core frame cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew
greek romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev loaddefs button
minibuffer faces cus-face files text-properties overlay md5 base64
format env code-pages mule custom widget hashtable-print-readable
backquote make-network-process multi-tty emacs)

[-- Attachment #2: Type: text/html, Size: 11043 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#7921: 23.2.91; js-mode font lock problem with comments
  2011-01-26 14:56 bug#7921: 23.2.91; js-mode font lock problem with comments Evan Owens
@ 2011-01-26 17:43 ` Deniz Dogan
  2011-01-26 17:50   ` Deniz Dogan
                     ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Deniz Dogan @ 2011-01-26 17:43 UTC (permalink / raw)
  To: Evan Owens; +Cc: 7921

I can reproduce this with only js-mode and all the HTML removed from
the example. Other reproducible issues, modifying the line ending with
path=/"; are:

path=/";/ # Everything following and including the last / is string face
path="; # Everything is fine
path=//"; # Everything is fine

--
Deniz Dogan





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#7921: 23.2.91; js-mode font lock problem with comments
  2011-01-26 17:43 ` Deniz Dogan
@ 2011-01-26 17:50   ` Deniz Dogan
  2011-01-26 19:30   ` Lennart Borgman
  2011-01-27  3:22   ` Stefan Monnier
  2 siblings, 0 replies; 9+ messages in thread
From: Deniz Dogan @ 2011-01-26 17:50 UTC (permalink / raw)
  To: Evan Owens; +Cc: 7921

Bug #7882 (24.0.50; Bad regexp for javascript regexps) is possibly related.

-- 
Deniz Dogan





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#7921: 23.2.91; js-mode font lock problem with comments
  2011-01-26 17:43 ` Deniz Dogan
  2011-01-26 17:50   ` Deniz Dogan
@ 2011-01-26 19:30   ` Lennart Borgman
  2011-01-27  3:22   ` Stefan Monnier
  2 siblings, 0 replies; 9+ messages in thread
From: Lennart Borgman @ 2011-01-26 19:30 UTC (permalink / raw)
  To: Deniz Dogan; +Cc: 7921, Evan Owens

On Wed, Jan 26, 2011 at 6:43 PM, Deniz Dogan <deniz.a.m.dogan@gmail.com> wrote:
> I can reproduce this with only js-mode and all the HTML removed from
> the example. Other reproducible issues, modifying the line ending with
> path=/"; are:
>
> path=/";/ # Everything following and including the last / is string face
> path="; # Everything is fine
> path=//"; # Everything is fine

Fine. Then I assume that this is an Emacs bug, not a nXhtml bug. If it
turns out not to be an Emacs bug please repost it as on nXhtml on
Launchpad.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#7921: 23.2.91; js-mode font lock problem with comments
  2011-01-26 17:43 ` Deniz Dogan
  2011-01-26 17:50   ` Deniz Dogan
  2011-01-26 19:30   ` Lennart Borgman
@ 2011-01-27  3:22   ` Stefan Monnier
  2011-01-27  3:26     ` Deniz Dogan
  2 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2011-01-27  3:22 UTC (permalink / raw)
  To: Deniz Dogan; +Cc: 7921, Evan Owens

> path=/";/ # Everything following and including the last / is string face
> path="; # Everything is fine
> path=//"; # Everything is fine

I've put the above three lines in ~/tmp/foo.js and opened it with
Debian's emacs23 and I don't think I see the problems you describe in
the comments.  OTOH I see other problems of highlighting but they're
largely due to the code itself being meaningless, AFAIK (# is not
a comment marker in javascript, is it?).


        Stefan





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#7921: 23.2.91; js-mode font lock problem with comments
  2011-01-27  3:22   ` Stefan Monnier
@ 2011-01-27  3:26     ` Deniz Dogan
  2011-01-27 17:22       ` Stefan Monnier
  0 siblings, 1 reply; 9+ messages in thread
From: Deniz Dogan @ 2011-01-27  3:26 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 7921, Evan Owens

2011/1/27 Stefan Monnier <monnier@iro.umontreal.ca>:
>> path=/";/ # Everything following and including the last / is string face
>> path="; # Everything is fine
>> path=//"; # Everything is fine
>
> I've put the above three lines in ~/tmp/foo.js and opened it with
> Debian's emacs23 and I don't think I see the problems you describe in
> the comments.  OTOH I see other problems of highlighting but they're
> largely due to the code itself being meaningless, AFAIK (# is not
> a comment marker in javascript, is it?).
>

I'm sorry, I should have been more clear. The # signs are
meta-comments, please leave them out when trying to reproduce the
problem.

-- 
Deniz Dogan





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#7921: 23.2.91; js-mode font lock problem with comments
  2011-01-27  3:26     ` Deniz Dogan
@ 2011-01-27 17:22       ` Stefan Monnier
  2011-01-27 17:33         ` Deniz Dogan
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2011-01-27 17:22 UTC (permalink / raw)
  To: Deniz Dogan; +Cc: 7921, Evan Owens

>>> path=/";/ # Everything following and including the last / is string face
>>> path="; # Everything is fine
>>> path=//"; # Everything is fine
>> 
>> I've put the above three lines in ~/tmp/foo.js and opened it with
>> Debian's emacs23 and I don't think I see the problems you describe in
>> the comments.  OTOH I see other problems of highlighting but they're
>> largely due to the code itself being meaningless, AFAIK (# is not
>> a comment marker in javascript, is it?).
>> 

> I'm sorry, I should have been more clear. The # signs are
> meta-comments, please leave them out when trying to reproduce the
> problem.

In my tests, the ";\npath=//" is treated as a string.  This sounds right
to me, but not being a js-programmer, your example makes me doubt.
IOW, using the latest code in the emacs-23, are there still some issues
with js-mode's font-locking?


        Stefan





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#7921: 23.2.91; js-mode font lock problem with comments
  2011-01-27 17:22       ` Stefan Monnier
@ 2011-01-27 17:33         ` Deniz Dogan
  2016-02-07 20:23           ` Simen Heggestøyl
  0 siblings, 1 reply; 9+ messages in thread
From: Deniz Dogan @ 2011-01-27 17:33 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 7921, Evan Owens

2011/1/27 Stefan Monnier <monnier@iro.umontreal.ca>:
>>>> path=/";/ # Everything following and including the last / is string face
>>>> path="; # Everything is fine
>>>> path=//"; # Everything is fine
>>>
>>> I've put the above three lines in ~/tmp/foo.js and opened it with
>>> Debian's emacs23 and I don't think I see the problems you describe in
>>> the comments.  OTOH I see other problems of highlighting but they're
>>> largely due to the code itself being meaningless, AFAIK (# is not
>>> a comment marker in javascript, is it?).
>>>
>
>> I'm sorry, I should have been more clear. The # signs are
>> meta-comments, please leave them out when trying to reproduce the
>> problem.
>
> In my tests, the ";\npath=//" is treated as a string.  This sounds right
> to me, but not being a js-programmer, your example makes me doubt.
> IOW, using the latest code in the emacs-23, are there still some issues
> with js-mode's font-locking?
>

Assuming that you mean "; npath=//", it is indeed correctly fontified
as a string.

I notice now that I referred to the three JavaScript examples as
"issues" -- they are not issues.

Only the last two examples are valid JavaScript. The first example,
even though _invalid_ JavaScript, might give us a hint about what the
problem is. That is the only reason why I included it.

-- 
Deniz Dogan





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#7921: 23.2.91; js-mode font lock problem with comments
  2011-01-27 17:33         ` Deniz Dogan
@ 2016-02-07 20:23           ` Simen Heggestøyl
  0 siblings, 0 replies; 9+ messages in thread
From: Simen Heggestøyl @ 2016-02-07 20:23 UTC (permalink / raw)
  To: Deniz Dogan; +Cc: monnier, eaowens, 7921-done

It seems this was fixed by 6cd1834. I can reproduce the bug with
versions of js.el before that revision, but not after.

Please reopen if you find that's not the case.

-- Simen





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-02-07 20:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-26 14:56 bug#7921: 23.2.91; js-mode font lock problem with comments Evan Owens
2011-01-26 17:43 ` Deniz Dogan
2011-01-26 17:50   ` Deniz Dogan
2011-01-26 19:30   ` Lennart Borgman
2011-01-27  3:22   ` Stefan Monnier
2011-01-27  3:26     ` Deniz Dogan
2011-01-27 17:22       ` Stefan Monnier
2011-01-27 17:33         ` Deniz Dogan
2016-02-07 20:23           ` Simen Heggestøyl

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.