I expect the package to be require
'd as soon as mdi-insert
is called but I get:
Error (use-package): spaceline :config: Symbol’s function definition is void: mdi-insert
~/.emacs.d/init.el
(let ((default-directory (expand-file-name "lisp/" user-emacs-directory)))
(normal-top-level-add-subdirs-to-load-path))
(require 'package)
(setq-default
load-prefer-newer t
package-enable-at-startup nil)
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t)
(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/") t)
(package-initialize)
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package t))
(setq-default
use-package-always-defer t
use-package-always-ensure t)
(use-package org
:pin org
:ensure org-plus-contrib)
(use-package spaceline
:ensure nil
:demand t
:config
(message (mdi-insert "star")))
(use-package mdi :ensure nil)
~/.emacs.d/lisp/mdi/mdi.el
: https://github.com/angrybacon/mdi/blob/master/mdi.el#L1952-L1957
(mdi
is a package I wrote myself and placed under lisp/
)
Also, it works with :demand t
in the declaration for mdi
. But I would like to defer the package if possible.
mdi
to load. Try adding a:commands mdi-insert
to theuse-package
form formdi
. (Also, as pointed out by @Basil: are you sure you called the functionmdi-insert
? It doesn't seem to appear in the linkedmdi.el
.) – Omar Jul 1 '17 at 6:02