Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Issues with use-package and straight.el #136

@romatthe

Description

@romatthe

Hi,

I'm trying to use dashboard.el together with straight.el and use-package, but I can't seem to get it to work.

Here's my super basic setup:

(use-package dashboard
  :straight t
  :config
  (setq dashboard-startup-banner "~/.emacs.d/img/ness_transp.png"
	dashboard-items '((recents  . 5)
                          (projects . 5)
                          (agenda . 5)))
  (dashboard-setup-startup-hook))

Evaluating this causes the following problems:

  1. I receive the following warning:

Error (use-package): dashboard/:catch: Symbol’s value as variable is void: package-activated-list

I think this makes sense, because I am using straight.el, which means I'm basically avoiding the use of package.el, which I'm never even properly initializing as a result. However, I'm not sure where this is coming from.

  1. The debugger shows the following output:
Debugger entered--Lisp error: (void-variable package-activated-list)
  byte-code("\301\302\010G\303 #\207" [package-activated-list format "%d packages loaded in %s" emacs-init-time] 4)
  (defvar dashboard-init-info (byte-code "\301\302\010G\303 #\207" [package-activated-list format "%d packages loaded in %s" emacs-init-time] 4) ("/home/romatthe/.emacs.d/straight/build/dashboard/dashboard-widgets.elc" . 2558))
  require(dashboard-widgets)
  eval-buffer(#<buffer  *load*> nil "/home/romatthe/.emacs.d/straight/build/dashboard/dashboard.el" nil t)  ; Reading at buffer position 751
  load-with-code-conversion("/home/romatthe/.emacs.d/straight/build/dashboard/dashboard.el" "/home/romatthe/.emacs.d/straight/build/dashboard/dashboard.el" t t)
  require(dashboard nil t)
  (not (require (quote dashboard) nil t))
  (if (not (require (quote dashboard) nil t)) (display-warning (quote use-package) (format "Cannot load %s" (quote dashboard)) :error) (condition-case err (progn (setq dashboard-startup-banner "~/.emacs.d/img/ness_transp.png" dashboard-items (quote ((recents . 5) (projects . 5) (agenda . 5)))) (dashboard-setup-startup-hook) t) ((debug error) (funcall use-package--warning30 :config err))))
  (condition-case err (if (not (require (quote dashboard) nil t)) (display-warning (quote use-package) (format "Cannot load %s" (quote dashboard)) :error) (condition-case err (progn (setq dashboard-startup-banner "~/.emacs.d/img/ness_transp.png" dashboard-items (quote ((recents . 5) (projects . 5) (agenda . 5)))) (dashboard-setup-startup-hook) t) ((debug error) (funcall use-package--warning30 :config err)))) ((debug error) (funcall use-package--warning30 :catch err)))
  (progn (straight-use-package (quote dashboard)) (defvar use-package--warning30 (function (lambda (keyword err) (let ((msg (format "%s/%s: %s" ... keyword ...))) (display-warning (quote use-package) msg :error))))) (condition-case err (if (not (require (quote dashboard) nil t)) (display-warning (quote use-package) (format "Cannot load %s" (quote dashboard)) :error) (condition-case err (progn (setq dashboard-startup-banner "~/.emacs.d/img/ness_transp.png" dashboard-items (quote (... ... ...))) (dashboard-setup-startup-hook) t) ((debug error) (funcall use-package--warning30 :config err)))) ((debug error) (funcall use-package--warning30 :catch err))))
  (progn (progn (straight-use-package (quote dashboard)) (defvar use-package--warning30 (function (lambda (keyword err) (let ((msg ...)) (display-warning (quote use-package) msg :error))))) (condition-case err (if (not (require (quote dashboard) nil t)) (display-warning (quote use-package) (format "Cannot load %s" (quote dashboard)) :error) (condition-case err (progn (setq dashboard-startup-banner "~/.emacs.d/img/ness_transp.png" dashboard-items (quote ...)) (dashboard-setup-startup-hook) t) ((debug error) (funcall use-package--warning30 :config err)))) ((debug error) (funcall use-package--warning30 :catch err)))))
  eval((progn (progn (straight-use-package (quote dashboard)) (defvar use-package--warning30 (function (lambda (keyword err) (let (...) (display-warning ... msg :error))))) (condition-case err (if (not (require (quote dashboard) nil t)) (display-warning (quote use-package) (format "Cannot load %s" (quote dashboard)) :error) (condition-case err (progn (setq dashboard-startup-banner "~/.emacs.d/img/ness_transp.png" dashboard-items ...) (dashboard-setup-startup-hook) t) ((debug error) (funcall use-package--warning30 :config err)))) ((debug error) (funcall use-package--warning30 :catch err))))) t)
  elisp--eval-last-sexp(nil)
  eval-last-sexp(nil)
  funcall-interactively(eval-last-sexp nil)
  call-interactively(eval-last-sexp

I'm unfortunately not that great at debugging elisp, so this is sort of where I had to stop investigating. I scanned through the source code of the package, but I didn't immediately see anything suspicious.

The only thing I could think of is a problem with this package's autoloads? As stated in the docs for straight.el:

Note that installing a package will activate all of its autoloads, but it will not actually require the features provided by the package.

That's the last thing I could think of.

I'm not sure if this is an issue related to dashboard.el, or with straight.el or use-package. However, this is the first package I've had any issues with.

Emacs version:

$ emacs --version
GNU Emacs 26.2

Dashboard version: git 8494d4f

Thanks for maintaining this great package!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions