jwiegley / use-package

A use-package declaration for simplifying your .emacs
https://jwiegley.github.io/use-package
GNU General Public License v3.0
4.37k stars 260 forks source link

Theme-related error: `(void-function tool-bar-mode)` #1033

Open ieure opened 1 year ago

ieure commented 1 year ago

Certain package definitions are causing an error on Emacs 27.1, when run in a terminal. Here's a stacktrace:

Debugger entered--Lisp error: (void-function tool-bar-mode)
  tool-bar-mode(0)
  custom-set-minor-mode(tool-bar-mode nil)
  custom-theme-recalc-variable(tool-bar-mode)
  enable-theme(user)
  enable-theme(use-package)
  byte-code("\301\302!\210\301\303!\210\301\304!\210\305\306\307\310#\210\311\306!\210\312\306\10\"\20\313\306\310\314\315\316\317\320\321\322&\11\207" [custom-enab$
  (use-package pass :defer t :commands pass :straight t :config (add-hook 'pass-mode-hook (lambda nil (setq show-trailing-whitespace nil) (hl-line-mode 1))))
  eval-buffer(#<buffer  *load*-186995> nil "/home/ieure/.emacs.d/ime-lisp/ime-pass.el" nil t)  ; Reading at buffer position 227                                      
  load-with-code-conversion("/home/ieure/.emacs.d/ime-lisp/ime-pass.el" "/home/ieure/.emacs.d/ime-lisp/ime-pass.el" nil t)
  require(ime-pass)
  (lambda (sym) (require (intern (concat "ime-" (symbol-name sym)))))(pass)
  mapc((lambda (sym) (require (intern (concat "ime-" (symbol-name sym))))) (1password pass diminish abbrev blight bindings blog browse-at-remote cl clojure comint c$
  eval-buffer(#<buffer  *load*-463887> nil "/home/ieure/.emacs.d/ime-lisp/ime-top.el" nil t)  ; Reading at buffer position 2610                                      
  load-with-code-conversion("/home/ieure/.emacs.d/ime-lisp/ime-top.el" "/home/ieure/.emacs.d/ime-lisp/ime-top.el" nil t)
  require(ime-top)
  eval-buffer(#<buffer  *load*> nil "/home/ieure/.emacs.d/init.el" nil t)  ; Reading at buffer position 355                                                          
  load-with-code-conversion("/home/ieure/.emacs.d/init.el" "/home/ieure/.emacs.d/init.el" t t)
  load("/home/ieure/.emacs.d/init" noerror nomessage)
  startup--load-user-init-file(#f(compiled-function () #<bytecode 0x15866e2ba5b5>) #f(compiled-function () #<bytecode 0x15866e2ba5c9>) t)
  command-line()
  normal-top-level()

I was surprised by this, since I don't use themes at all. It seems to be related to #881. It happens the first time (use-package …) is called. It isn't a problem with a specific package being configured — if I comment out the first use-package call, I get the same error with the second. If I comment out every use-package call, the error doesn't occur.

I generally run a newer Emacs in a GUI, but due to some funky hardware setup, in this case, I'm using 27.1 on a terminal.

My custom-file specifies:

 '(tool-bar-mode nil)

And this get applied prior to use-package being called. Strangely, C-h a tool-bar-mode RET shows that the function is known and loaded, and evaluating (tool-bar-mode 1) or … -1 in ielm works as expected. So I have no idea why use-package specifically is causing this.

This is happening with commit bcf0984cf55b70fe6896c6a15f61df92b24f8ffd.