How to create autoload for elpa packages?

I set the number of packages using elpa and wanted to create startups for them accordingly. For this purpose, I added to my initialization file:

(apply 'update-directory-autoloads (directory-files package-user-dir t "[^\.].*"))

However, I get crashes with the following reverse network:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  expand-file-name(nil "/build/buildd/emacs24-24.3+1/debian/build-x/lisp")
  autoload-generated-file()
  autoload-find-generated-file()
  update-directory-autoloads("/home/survivor/.emacs.d/elpa/ahg-20140818.130")
  eval((update-directory-autoloads "/home/survivor/.emacs.d/elpa/ahg-20140818.130") nil)
  eval-last-sexp-1(nil)
  eval-last-sexp(nil)
  call-interactively(eval-last-sexp nil nil)

Am I trying to do it wrong? Should I just put in requirefor each of my packages?

+4
source share
2 answers

TL DR: You probably need to add (package-initialize)initialization to your file.

You do not need to create startups for your packages. The package manager does this automatically after installation. You will find the appropriate files -autoloads.elin the package directories of your directory ~/.emacs.d/elpa/.

. , Emacs Lisp, (, ), , , .

Emacs , "" . Emacs , init.el.

, ( ) , init.el, init.el.

, after-init-hook Emacs , (package-initialize) .

+2
  • , , , (.. ). ( . - , .)

  • generated-autoload-file nil. . . doc update-directory-autoloads.

+3

All Articles