mooz / js2-mode

Improved JavaScript editing mode for GNU Emacs
GNU General Public License v3.0
1.33k stars 186 forks source link

No code highlighting without menu-bar? #586

Closed bbo2adwuff closed 2 years ago

bbo2adwuff commented 2 years ago

I don't see any code highlighting when starting emacs without a menu-bar.

No code highlighting with my init file menu-bar-off:

(package-initialize)
(menu-bar-mode -1)
(require 'js2-mode)

Code highlighting works with my init file menu-bar-not-off:

(package-initialize)
(require 'js2-mode)

I'm using following emacs version: GNU Emacs 28.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.17.6) of 2022-04-28

UwUnyaa commented 2 years ago

Can you try with a minimal init file? I disable menu-bar as well, and never had that issue myself.

bbo2adwuff commented 2 years ago

Oh sorry, what I meant above was that these are my init files. Hence these are minimal init files.

emacs -q -l menu-bar-off and emacs -q -l menu-bar-not-off

bbo2adwuff commented 2 years ago

Screenshot with init file menu-bar-off

Screenshot from 2022-04-28 18-34-26

Screenshot with init file menu-bar-not-off

Screenshot from 2022-04-28 18-35-07

UwUnyaa commented 2 years ago

How have you installed js2-mode?

bbo2adwuff commented 2 years ago

I installed it via melpa, but as I upgraded to 28.1 I realized that it might be related to #72.

So as in https://github.com/mooz/js2-mode/issues/72#issuecomment-15176816, this did the trick: (byte-recompile-directory (expand-file-name "~/.emacs.d/elpa/js2-mode-20220402.2211/") 0 t)

bbo2adwuff commented 2 years ago

Just for completeness, it seems that the menu-bar-mode -1 already played a role in another issue https://github.com/mooz/js2-mode/issues/572.