Fresh clone of doom-emacs develop branch throws error
Warning (initialization): An error occurred while loading ‘/Users/bharat/.emacs.d/init.el’:
Error in private config: config.el, (void-variable projectile-globally-ignored-directories)
It started with the latest commits. Tried a fresh clone to test it. Same behaviour.
Running emacs with debug-init
Debugger entered--Lisp error: (void-variable projectile-globally-ignored-directories)
(member "node_modules" projectile-globally-ignored-directories)
(if (member "node_modules" projectile-globally-ignored-directories) projectile-globally-ignored-directories (setq projectile-globally-ignored-directories (cons "node_modules" projectile-globally-ignored-directories)))
(progn (use-package-statistics-gather :config 'js2-mode nil) (setq js2-skip-preprocessor-directives t js-chain-indent t js2-mode-show-parse-errors nil js2-mode-show-strict-warnings nil js2-strict-trailing-comma-warning nil js2-strict-missing-semi-warning nil js2-highlight-level 3 js2-highlight-external-variables t) (add-hook 'js2-mode-hook #'rainbow-delimiters-mode) (progn (add-hook 'js2-mode-hook #'(lambda (&rest _) (set (make-local-variable 'js-switch-indent-offset) js2-basic-offset) (set (make-local-variable 'mode-name) "JS2")) t nil)) (set-electric! 'js2-mode :chars '(125 41 46 58)) (set-repl-handler! 'js2-mode #'+javascript/open-repl) (if (member "node_modules" projectile-globally-ignored-directories) projectile-globally-ignored-directories (setq projectile-globally-ignored-directories (cons "node_modules" projectile-globally-ignored-directories))) (general-define-key :keymaps '(js2-mode-map) "S" #'+javascript/skewer-this-buffer :states '(normal visual motion emacs) :major-modes t :wk-full-keys nil :prefix doom-localleader-key :non-normal-prefix doom-localleader-alt-key) t (use-package-statistics-gather :config 'js2-mode t))
(closure (t) nil (progn (use-package-statistics-gather :config 'js2-mode nil) (setq js2-skip-preprocessor-directives t js-chain-indent t js2-mode-show-parse-errors nil js2-mode-show-strict-warnings nil js2-strict-trailing-comma-warning nil js2-strict-missing-semi-warning nil js2-highlight-level 3 js2-highlight-external-variables t) (add-hook 'js2-mode-hook #'rainbow-delimiters-mode) (progn (add-hook 'js2-mode-hook #'(lambda (&rest _) (set (make-local-variable ...) js2-basic-offset) (set (make-local-variable ...) "JS2")) t nil)) (set-electric! 'js2-mode :chars '(125 41 46 58)) (set-repl-handler! 'js2-mode #'+javascript/open-repl) (if (member "node_modules" projectile-globally-ignored-directories) projectile-globally-ignored-directories (setq projectile-globally-ignored-directories (cons "node_modules" projectile-globally-ignored-directories))) (general-define-key :keymaps '(js2-mode-map) "S" #'+javascript/skewer-this-buffer :states '(normal visual motion emacs) :major-modes t :wk-full-keys nil :prefix doom-localleader-key :non-normal-prefix doom-localleader-alt-key) t (use-package-statistics-gather :config 'js2-mode t)))()
eval-after-load-helper("/Users/bharat/.emacs.d/.local/packages/elpa/js2-mo...")
run-hook-with-args(eval-after-load-helper "/Users/bharat/.emacs.d/.local/packages/elpa/js2-mo...")
do-after-load-evaluation("/Users/bharat/.emacs.d/.local/packages/elpa/js2-mo...")
require(js2-mode nil nil)
eval-buffer(#<buffer *load*-277016> nil "/Users/bharat/.doom.d/config.el" nil t) ; Reading at buffer position 4341
load-with-code-conversion("/Users/bharat/.doom.d/config.el" "/Users/bharat/.doom.d/config.el" t nil)
load("/Users/bharat/.doom.d/config" t nil)
(condition-case e (load (expand-file-name "config" doom-private-dir) t nil) ((debug doom-error) (signal (car e) (cdr e))) ((debug error) (let* ((source (file-name-sans-extension (expand-file-name "config" doom-private-dir))) (err (cond ((file-in-directory-p source doom-core-dir) (cons ... doom-core-dir)) ((file-in-directory-p source doom-private-dir) (cons ... doom-private-dir)) ((cons ... doom-emacs-dir))))) (signal (car err) (list (file-relative-name (concat source ".el") (cdr err)) e)))))
(if noninteractive nil (maphash #'(lambda (key plist) (let ((doom--current-module key) (doom--current-flags (plist-get plist :flags))) (condition-case e (load (expand-file-name "config" ...) t nil) ((debug doom-error) (signal ... ...)) ((debug error) (let* ... ...))))) doom-modules) (run-hook-wrapped 'doom-init-modules-hook #'doom-try-run-hook) (condition-case e (load (expand-file-name "config" doom-private-dir) t nil) ((debug doom-error) (signal (car e) (cdr e))) ((debug error) (let* ((source (file-name-sans-extension (expand-file-name "config" doom-private-dir))) (err (cond (... ...) (... ...) (...)))) (signal (car err) (list (file-relative-name (concat source ".el") (cdr err)) e))))) (if custom-file nil (setq custom-file (concat doom-local-dir "custom.el"))) (if (stringp custom-file) (progn (load custom-file t t t))))
(progn (setq doom-init-modules-p t) (condition-case e (load (expand-file-name "init" doom-private-dir) t nil) ((debug doom-error) (signal (car e) (cdr e))) ((debug error) (let* ((source (file-name-sans-extension (expand-file-name "init" doom-private-dir))) (err (cond (... ...) (... ...) (...)))) (signal (car err) (list (file-relative-name (concat source ".el") (cdr err)) e))))) (if doom-modules nil (setq doom-modules (make-hash-table :test 'equal))) (maphash #'(lambda (key plist) (let ((doom--current-module key) (doom--current-flags (plist-get plist :flags))) (condition-case e (load (expand-file-name "init" ...) t nil) ((debug doom-error) (signal ... ...)) ((debug error) (let* ... ...))))) doom-modules) (run-hook-wrapped 'doom-before-init-modules-hook #'doom-try-run-hook) (if noninteractive nil (maphash #'(lambda (key plist) (let ((doom--current-module key) (doom--current-flags ...)) (condition-case e (load ... t nil) (... ...) (... ...)))) doom-modules) (run-hook-wrapped 'doom-init-modules-hook #'doom-try-run-hook) (condition-case e (load (expand-file-name "config" doom-private-dir) t nil) ((debug doom-error) (signal (car e) (cdr e))) ((debug error) (let* ((source (file-name-sans-extension ...)) (err (cond ... ... ...))) (signal (car err) (list (file-relative-name ... ...) e))))) (if custom-file nil (setq custom-file (concat doom-local-dir "custom.el"))) (if (stringp custom-file) (progn (load custom-file t t t)))))
(if (or force-p (not doom-init-modules-p)) (progn (setq doom-init-modules-p t) (condition-case e (load (expand-file-name "init" doom-private-dir) t nil) ((debug doom-error) (signal (car e) (cdr e))) ((debug error) (let* ((source (file-name-sans-extension ...)) (err (cond ... ... ...))) (signal (car err) (list (file-relative-name ... ...) e))))) (if doom-modules nil (setq doom-modules (make-hash-table :test 'equal))) (maphash #'(lambda (key plist) (let ((doom--current-module key) (doom--current-flags ...)) (condition-case e (load ... t nil) (... ...) (... ...)))) doom-modules) (run-hook-wrapped 'doom-before-init-modules-hook #'doom-try-run-hook) (if noninteractive nil (maphash #'(lambda (key plist) (let (... ...) (condition-case e ... ... ...))) doom-modules) (run-hook-wrapped 'doom-init-modules-hook #'doom-try-run-hook) (condition-case e (load (expand-file-name "config" doom-private-dir) t nil) ((debug doom-error) (signal (car e) (cdr e))) ((debug error) (let* ((source ...) (err ...)) (signal (car err) (list ... e))))) (if custom-file nil (setq custom-file (concat doom-local-dir "custom.el"))) (if (stringp custom-file) (progn (load custom-file t t t))))))
doom-initialize-modules()
(if noninteractive nil (doom-initialize-modules))
eval-buffer(#<buffer *load*-400917> nil "/Users/bharat/.emacs.d/core/core.el" nil t) ; Reading at buffer position 18386
load-with-code-conversion("/Users/bharat/.emacs.d/core/core.el" "/Users/bharat/.emacs.d/core/core.el" nil t)
require(core "/Users/bharat/.emacs.d/core/core")
eval-buffer(#<buffer *load*> nil "/Users/bharat/.emacs.d/init.el" nil t) ; Reading at buffer position 3804
load-with-code-conversion("/Users/bharat/.emacs.d/init.el" "/Users/bharat/.emacs.d/init.el" t t)
load("/Users/bharat/.emacs.d/init" noerror nomessage)
startup--load-user-init-file(#f(compiled-function () #<bytecode 0x42c04bfb>) #f(compiled-function () #<bytecode 0x42c04bcb>) t)
command-line()
normal-top-level()
Emacs loads without error
Click to expand
- OS: darwin (x86_64-apple-darwin18.2.0)
- Emacs: 27.0.50 (Mar 01, 2019)
- Doom: 2.0.9 (develop 35321e8b42cf0200ca8b5c97372ae0cfa5705565)
- Graphic display: t (daemon: nil)
- System features: RSVG IMAGEMAGICK GLIB NOTIFY KQUEUE ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES THREADS PDUMPER LCMS2 GMP
- Details:
```elisp
elc count: 0
uname -a: Darwin Zeno.local 18.2.0 Darwin Kernel Version 18.2.0: Thu Dec 20 20:46:53 PST 2018; root:xnu-4903.241.1~1/RELEASE_X86_64 x86_64
modules: (:feature eval (evil +everywhere) file-templates (lookup +docsets) snippets :completion company (ivy +fuzzy) :ui doom modeline doom-quit hl-todo nav-flash treemacs (popup +all +defaults) unicode vc-gutter vi-tilde-fringe window-select :editor fold (format +onsave) multiple-cursors rotate-text :emacs dired electric vc :tools flycheck flyspell macos magit :lang data emacs-lisp (java +eclim) javascript lua markdown (org +attach +babel +capture +export +present) python ruby (sh +zsh) web :config default)
packages: n/a
exec-path: (~/.cargo/bin/ /usr/local/bin/ /usr/local/sbin/ /usr/bin/ /bin/ /usr/sbin/ /sbin/ /opt/X11/bin/ ~/.jenv/shims/ ~/.jenv/bin/ ~/google-cloud-sdk/bin/ ~/.npm-packages/bin/ ~/.emacs.d/bin/ ~/.rbenv/shims/ ~/.cargo/bin/ ~/anaconda3/bin/ ~/Library/Android/sdk/tools/ ~/Library/Android/sdk/tools/bin/ ~/Library/Android/sdk/platform-tools/ ~/n/bin/ /usr/local/Cellar/emacs-plus/HEAD-ed087fa/libexec/emacs/27.0.50/x86_64-apple-darwin18.2.0/)
```
This is certainly a bug and I'll look into a fix, but is there a reason you're eagerly loading js2-mode from your config?
I have the below code in my config
(def-package! js2-mode
:config
(set-face-attribute 'js2-function-param nil :inherit 'font-lock-variable-name-face :slant 'italic))
I had a look at your config. def-package! will load the package immediately unless you tell it not to. I don't think that's the behavior you want (it also renders most of Doom's startup optimizations moot).
I'd suggest using after! instead:
-(def-package! js2-mode
- :config
+(after! js2-mdoe
(set-face-attribute 'js2-function-param nil :inherit 'font-lock-variable-name-face :slant 'italic))
I suggest the same for all the def-package! blocks you are using. Alternatively, you can use the :defer t property:
(def-package! js2-mode
+ :defer t
:config
(set-face-attribute 'js2-function-param nil :inherit 'font-lock-variable-name-face :slant 'italic))
They are equivalent, so feel free to use either.
Thanks for checking my config. I will update it.
No problem! Anyhow, bf940da should resolve this issue. Please update and let me if that isn't the case and I'll reopen this issue. Thanks for bringing it to my attention!
Most helpful comment
I had a look at your config.
def-package!will load the package immediately unless you tell it not to. I don't think that's the behavior you want (it also renders most of Doom's startup optimizations moot).I'd suggest using
after!instead:I suggest the same for all the
def-package!blocks you are using. Alternatively, you can use the:defer tproperty:They are equivalent, so feel free to use either.