Skip to content

Instantly share code, notes, and snippets.

@dustinlacewell
Created March 24, 2016 20:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dustinlacewell/14ad0f8ff8d3f59b0145 to your computer and use it in GitHub Desktop.
Save dustinlacewell/14ad0f8ff8d3f59b0145 to your computer and use it in GitHub Desktop.
Not everything is in MELPA or similar, so we also need a way to add local stuff
to =load-path=. This walks over =site-packages= and adds each directory in it.
#+BEGIN_SRC emacs-lisp
(let ((default-directory
(expand-file-name "site-packages" user-emacs-directory))
(local-pkgs nil))
(dolist (file (directory-files default-directory))
(and (file-directory-p file)
(string-match "\\`[[:alnum:]]" file)
(setq local-pkgs (cons file local-pkgs))))
(normal-top-level-add-to-load-path local-pkgs))
#+END_SRC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment