doomemacs / doomemacs

An Emacs framework for the stubborn martian hacker
MIT License
19.35k stars 3.05k forks source link

emacs-lisp module causes "void variable: auto-minor-mode-alist" #4701

Closed jethrokuan closed 3 years ago

jethrokuan commented 3 years ago

I'm getting:

Warning (initialization): An error occurred while loading ‘/home/jethro/.emacs.d/init.el’:

Error in a Doom module: modules/lang/emacs-lisp/config.el, (void-variable auto-minor-mode-alist)

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the ‘--debug-init’ option to view a complete error backtrace. Disable showing Disable logging

when loading Doom Emacs. I traced this down to the following:

https://github.com/hlissner/doom-emacs/blob/develop/modules/lang/emacs-lisp/config.el#L204

which seems to use auto-minor-mode-alist, without ensuring a (require 'auto-minor-mode) is called. Not sure what optimizations Doom has in place here, but adding (require 'auto-minor-mode), in the init block there temporarily resolves this issue.

SYSTEM  info       (Ubuntu 20.10 . Linux 5.8.0-44-generic x86_64)
        shell      /bin/bash
        path       (~/.eldev/bin ~/.pyenv/plugins/pyenv-virtualenv/shims ~/.pyenv/shims ~/.poetry/bin ~/.pyenv/bin ~/.cargo/bin ~/.emacs.d/bin ~/.local/bin ~/.poetry/bin ~/.eldev/bin ~/.pyenv/plugins/pyenv-virtualenv/shims ~/.pyenv/shims ~/.poetry/bin ~/.pyenv/bin ~/.cargo/bin ~/.emacs.d/bin ~/.local/bin ~/.nix-profile/bin ~/.nix-profile/bin ~/.local/bin /usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin /usr/games /usr/local/games /snap/bin /nix/store/bvw9pz2ls6bih754ccdzzpgfj4k03bfq-emacs-gcc-20201204.0/libexec/emacs/28.0.50/x86_64-pc-linux-gnu/)
EMACS   dir        ~/.emacs.d/
        version    (28.0.50 eb8d15547bfc0821232af12c1ce193e40cdf16c0 Feb 27, 2021)
        buildopts  --prefix=/nix/store/bvw9pz2ls6bih754ccdzzpgfj4k03bfq-emacs-gcc-20201204.0 --disable-build-details --with-modules --with-x-toolkit=gtk3 --with-xft --with-cairo --with-nativecomp CFLAGS=-DMAC_OS_X_VERSION_MAX_ALLOWED=101200
        features   XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND DBUS GSETTINGS GLIB NOTIFY INOTIFY LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES NATIVE_COMP THREADS LIBSYSTEMD JSON PDUMPER
        traits     (gui server-running envvar-file)
DOOM    dir        ~/.doom.d/
        version    (2.0.9 HEAD -> develop, origin/develop, origin/HEAD 3f4eccaec 2021-02-26 22:16:00 -0500)
        font       #<font-object -PfEd-DejaVu Sans Mono-normal-normal-normal-*-13-*-*-*-m-0-iso10646-1>
        theme      doom-one
        modules    (:completion company ivy :ui doom doom-dashboard hl-todo modeline nav-flash ophints (popup +all +defaults) vc-gutter :editor fold (format +onsave) snippets :emacs dired electric vc :checkers (syntax +childframe) spell :tools (debugger +lsp) direnv (eval +overlay) (lookup +docsets +dictionary) (lsp +peek) (magit +forge) pdf upload :lang data emacs-lisp (latex +latexmk) markdown nix (org +noter) python rest (rust +lsp) sh web :config (default +bindings +smartparens))
        packages   ((dired-narrow) (deadgrep) (easy-kill) (org-clock-convenience) (company-posframe) (org-roam :recipe (:host github :repo org-roam/org-roam)) (org-roam-bibtex :recipe (:host github :repo org-roam/org-roam-bibtex)) (mathpix.el :recipe (:host github :repo jethrokuan/mathpix.el)) (anki-editor) (gif-screencast :recipe (:host gitlab :repo ambrevar/emacs-gif-screencast)) (modus-operandi-theme) (outshine) (company-org-roam :recipe (:host github :repo jethrokuan/company-org-roam)) (org-download) (ox-hugo :recipe (:host github :repo jethrokuan/ox-hugo)) (ox-texinfo+ :recipe (:host github :repo tarsius/ox-texinfo-plus)) (nov :recipe (:type git :repo https://depp.brause.cc/nov.el.git)) (git-link) (yaml-mode) (org-roam-server :recipe (:host github :repo org-roam/org-roam-server)) (emmet-mode) (buttercup) (citeproc-org) (org-gcal))
        unpin      (n/a)
        elpa       (n/a)
hlissner commented 3 years ago

I cannot reproduce this on any of my test systems with vanilla Doom, on Emacs 26.3, 27.1 or 28+gccemacs, on NixOS, Ubuntu, Arch, MacOS, or Windows 10.

auto-minor-mode-alist is autoloaded, so a doom sync will pull its definition into the autoloads file that Doom loads at startup.

Here are a few possibilities:

jethrokuan commented 3 years ago

With doom/sandbox Doom + modules - your private config:

Debugger entered--Lisp error: (void-variable auto-minor-mode-alist)
  (member '("/test[/-].+\\.el$" . buttercup-minor-mode) auto-minor-mode-alist)
  (if (member '("/test[/-].+\\.el$" . buttercup-minor-mode) auto-minor-mode-alist) auto-minor-mode-alist (setq auto-minor-mode-alist (cons '("/test[/-].+\\.el$" . buttercup-minor-mode) auto-minor-mode-alist)))
  eval-buffer(#<buffer  *load*-214936> nil "/home/jethro/.emacs.d/modules/lang/emacs-lisp/conf..." nil t)  ; Reading at buffer position 9062
  load-with-code-conversion("/home/jethro/.emacs.d/modules/lang/emacs-lisp/conf..." "/home/jethro/.emacs.d/modules/lang/emacs-lisp/conf..." t t)
  load("/home/jethro/.emacs.d/modules/lang/emacs-lisp/conf..." t nomessage)
  (let (file-name-handler-alist) (load (expand-file-name file (plist-get plist :path)) t 'nomessage))
  (condition-case e (let (file-name-handler-alist) (load (expand-file-name file (plist-get plist :path)) t 'nomessage)) ((debug doom-error) (signal (car e) (cdr e))) ((debug error) (doom--handle-load-error e (expand-file-name file (plist-get plist :path)) (plist-get plist :path))))
  (let ((doom--current-module module) (doom--current-flags (plist-get plist :flags))) (condition-case e (let (file-name-handler-alist) (load (expand-file-name file (plist-get plist :path)) t 'nomessage)) ((debug doom-error) (signal (car e) (cdr e))) ((debug error) (doom--handle-load-error e (expand-file-name file (plist-get plist :path)) (plist-get plist :path)))))
  (closure ((file . "config") t) (module plist) (let ((doom--current-module module) (doom--current-flags (plist-get plist :flags))) (condition-case e (let (file-name-handler-alist) (load (expand-file-name file (plist-get plist :path)) t 'nomessage)) ((debug doom-error) (signal (car e) (cdr e))) ((debug error) (doom--handle-load-error e (expand-file-name file (plist-get plist :path)) (plist-get plist :path))))))((:lang . emacs-lisp) (:flags nil :path "/home/jethro/.emacs.d/modules/lang/emacs-lisp/"))
  maphash((closure ((file . "config") t) (module plist) (let ((doom--current-module module) (doom--current-flags (plist-get plist :flags))) (condition-case e (let (file-name-handler-alist) (load (expand-file-name file (plist-get plist :path)) t 'nomessage)) ((debug doom-error) (signal (car e) (cdr e))) ((debug error) (doom--handle-load-error e (expand-file-name file (plist-get plist :path)) (plist-get plist :path)))))) #<hash-table equal 38/65 0x94ee67>)
  eval-buffer(#<buffer  *load*> nil "/tmp/doom-sandbox-snS9a5" nil t)  ; Reading at buffer position 28989
  load-with-code-conversion("/tmp/doom-sandbox-snS9a5" "/tmp/doom-sandbox-snS9a5" nil t)
  command-line-1(("-l" "/tmp/doom-sandbox-snS9a5"))
  command-line()
  normal-top-level()

image

hlissner commented 3 years ago

Looks like the package failed to install. Try the other suggestions.

jethrokuan commented 3 years ago

Hmm yeah, I had to nuke the entire .emacs.d folder and reinstall. Thanks!