How to mask an already installed Emacs package?

173 views Asked by At

I am using Emacs 24 in an work environment where I cannot modify what are outside of my personal folder.

I want to install a particular package, but there is already an older version of this package installed outside of my personal folder. I have to install it manually, so I added the package folder path to 'load-path' and required it myself in init.el file. But still, after the startup, when I check the version, it showed that the version is still the older version which is loaded from a place outside of my personal folder.

My question is how can I mask that older package? In another word, how can I choose to load my version instead?

1

There are 1 answers

14
dmg On

The key is to modify the the load-path variable at the very beginning of your init.el file.

add-to-list adds to the front of a list. For example, this is how I load my version of org:

(add-to-list 'load-path "~/.emacs.d/org-mode/lisp")

I also suggest that you inspect the contents of the variable (use Meta-x describe-variable). This will inform you what directories are scanned first.

Be warned, sometimes mixing packages creates weird issues. If this happens, be patient and try one package at a time.

Addendum: as Drew mentioned below, emacs will try to find a package to load in each of the directories in the load-path, starting from its head. So the order of the directories in it matter.

--dmg