I have some of my own Elisp code in my own directory. Like I have a file /tmp/foo/foo.el
with this in it:
;;; foo.el -- Foo
;;;###autoload
(defun foo-hello ()
(message "hello, world"))
(provide 'foo)
;;; foo.el ends here
I open Emacs and run M-x make-directory-autoloads RET /tmp/foo/foo-autoloads.el RET
.
Then I add this to my ~/.emacs.d/init.el
:
(add-to-list 'load-path "/tmp/foo/")
(foo-hello)
Then I start Emacs but I get this error:
eval-buffer: Symbol’s function definition is void: foo-hello
What did I miss? How do I make Emacs see my generate autoloads file and use it to automatically load the autoloads when I use them? Is there an extra step involved?
If there is an extra step involved, then how does Emacs automatically see the autoloads installed with package manager. Like I never did anything special to make Emacs recognize ~/.emacs.d/elpa/magit-20230402.1342/magit-autoloads.el
. How does Emacs see that file automatically but it does not see my autoloads file?