I recently switched to the use of emacs' package manager packages
.
Since then, some emacs path variables get set beyond what I do in my .emacs
file: Both load-path
and Info-directory-list
get perpended with stuff from the packages. But I don't understand where these customisations are done.
Let's concentrate on Info-directory-list
: In my .emacs
file I don't set it so it should be nil (so that later when info
starts up, its initialised from Info-default-directory-list
. However with my new packaging it is already intialised and some package directories are added. This messes up my dir
structure in info
. I have checked the autoload files, but they don't set Info-directory-list
in any way - and no other elisp file in the packages (pandoc-mode
in particular) do so.
Where is the Info-directory-list
variable set and how can I regain control over the order in this variable?
After evaluating your init file, Emacs calls package-initialize
(which does what it sounds like). After initializing the packages, Emacs runs after-init-hook
, so if you want to manipulate variables which have been modified during package initialisation, you can put the following in your init file:
(add-hook 'after-init-hook 'my-after-init-hook)
(defun my-after-init-hook ()
"After package initialisation."
;; do something with Info-directory-list
)
You can also call package-initialize
yourself, provided that you ensure that any necessary package-related variables are set beforehand. See Emacs 24 Package System Initialization Problems for details.
As for how and why Info-directory-list
is being modified, the manual comments on that aspect in (elisp) Multi-file Packages
:
A multi-file package is less convenient to create than a single-file package, but it offers more features: it can include multiple Emacs Lisp files, an Info manual, and other file types (such as images).
[...]
If the content directory contains a file named
dir
, this is assumed to be an Info directory file made withinstall-info
. *Note Invoking install-info: (texinfo)Invoking install-info. The relevant Info files should also be present in the content directory. In this case, Emacs will automatically add the content directory toInfo-directory-list
when the package is activated.
Specifically, package-activate-1
does this:
(when (file-exists-p (expand-file-name "dir" pkg-dir))
;; FIXME: not the friendliest, but simple.
(require 'info)
(info-initialize)
(push pkg-dir Info-directory-list))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With