Search code examples
emacselpa

Activate a single ELPA package out of many


I want to start Emacs from a clean state and activate only one package in ~/.emacs.d/elpa/, not all of them. Specifically, I need to load a bleeding-edge version of Org-mode, while clean Emacs loads the built-in version. How do I do that?


Solution

  • To run Emacs from a clean state, provide a -Q option:

    emacs -Q
    

    Then run command eval-expression, usually M-:, and enter the following Lisp expression:

    (let ((package-load-list '((org t)))) (package-initialize))
    

    package-load-list variable holds packages that will load and activate when package-initialize is called. It's a list of pairs in the form of (PACKAGE VERSION). You can put t instead of VERSION, and the newest version will be loaded.