I am begining to develop my own Emacs environment, I have a custom init.el (as below) that loads libraries from my user directory and ignores the installed directories. I have not placed any of the Amusement or Mail lisp libraries in the User directory but they are still appearing in auto-complete lists. This is because they are being defined as auto-load functions. How do I prevent these auto-load functions from being created? I don’t want to individually remove each unwanted function as this is cumbersome and wasteful.
Help info on an unwanted function;
5x5 is an interactive autoloaded Lisp function.
It is bound to <menu-bar> <tools> <games> <5x5>.
my init.el;
(setq inhibit-defaul-init 1)
(setq load-path (list
(expand-file-name "~/.emacs.d/")
(expand-file-name "~/.emacs.d/lisp/")
(expand-file-name "~/.emacs.d/lisp/emacs-lisp/")
(expand-file-name "~/.emacs.d/lisp/eshell/")
(expand-file-name "~/.emacs.d/lisp/net/")
(expand-file-name "~/.emacs.d/lisp/nxml")
(expand-file-name "~/.emacs.d/lisp/org")
(expand-file-name "~/.emacs.d/lisp/term")
(expand-file-name "~/.emacs.d/lisp/textmodes")
(expand-file-name "~/.emacs.d/lisp/usrl")
(expand-file-name "~/.emacs.d/lisp/")
)
)
You can unbind autoloaded functions in the same way that you can unbind normal functions, so you could effectively remove
5x5and other unwanted autoloaded functions from the running system like this:For autoloaded variables, you would use
makunboundinstead offmakunbound.To obtain a list of likely suspects, you could use
find-libraryRETloaddefsREToccurRET^(autoloadRETThe
loadhistlibrary might also be of interest.Edit:
Actually, inspecting the autoload file seems like a fairly safe method of establishing whether or not you want to eliminate something. I believe this is only usable with functions, however; as far as I can see, other kinds of autoloaded objects are just defined immediately by loaddefs. You could make assumptions based on symbol-name, but I wouldn’t recommend it (but then I wouldn’t do any of this, so YMMV).