Next: , Previous: Q3.0.3, Up: Customisation


Q3.0.4: How can I add directories to the load-path?

Here are two ways to do that, one that puts your directories at the front of the load-path, the other at the end:

     ;;; Add things at the beginning of the load-path, do not add
     ;;; duplicate directories:
     (pushnew "bar" load-path :test 'equal)
     
     (pushnew "foo" load-path :test 'equal)
     
     ;;; Add things at the end, unconditionally
     (setq load-path (nconc load-path '("foo" "bar")))

keith (k.p.) hanlan writes:

To add directories using Unix shell metacharacters use expand-file-name like this:
     (push (expand-file-name "~keithh/.emacsdir") load-path)