In my init.el
file I have the following line (setq js2-basic-offset 2)
The last line in my .init.el
file is
(add-hook 'after-init-hook
(lambda ()
(message "Welcome home %s" (user-login-name))))
When I start emacs and go to the *Messages*
buffer, I see:
Loading c:/Users/user/.emacs.d/.mc-lists.el (source)...done
[yas] Prepared just-in-time loading of snippets successfully.
Welcome home user
However, when I do C-h v js2-basic-offset
I get
js2-basic-offset is a variable defined in ‘js2-mode.el’.
Its value is 4
This variable is an alias for ‘js-indent-level’.
Documentation:
Number of spaces for each indentation step in ‘js-mode’.
You can customize this variable
If I go to my init.el
file and re-load it, the variable gets set to it's correct value of 2.
Does anybody have any solution for this issue?
js-mode
after settingjs2-basic-offset
, thus that it overwrites your value. Put a(require 'js-mode)
before setting the value and see whether that resolves the issue. Note that this always requires the mode, wheter you you it or not, causing probably longer start time.js2-mode
I found thatjs2-basic-offset
is alias forjs-indent-level
. So setting the latter value may also help.customize
d value being evaluated after yoursetq
form.