tags:

views:

32

answers:

2

Okay, I'm a newb to modifying my .el files. All I want to do is something like: (setq windows-path "c:/Documents and Settings/cthiel/projects/windows_setup/emacs/")

And then tack on subdirectories within the emacs directory onto the load path. Something such as (how it's done in ruby): (add-to-list 'load-path "#{windows-path}/external")

+2  A: 

Check out EmacsWiki:LoadPath for tips on recursively adding directories.

I think you want something like:

(setq windows-path "c:/Documents and Settings/cthiel/projects/windows_setup/emacs/")

(if (fboundp 'normal-top-level-add-subdirs-to-load-path)
    (let* ((my-lisp-dir windows-path)
           (default-directory my-lisp-dir))
      (setq load-path (cons my-lisp-dir load-path))
      (normal-top-level-add-subdirs-to-load-path)))
Michael Paulukonis
+1  A: 
(setq windows-path "c:/Documents and Settings/cthiel/projects/windows_setup/emacs/"
(add-to-list 'load-path (concat windows-path "external"))

Does that achieve your goal?

Documentation:

concat is a built-in function in `fns.c'.

(concat &rest sequences)

Concatenate all the arguments and make the result a string. The result is a string whose elements are the elements of all the arguments. Each argument may be a string or a list or vector of characters (integers).

example:

(concat "The answer to life, " "the universe " "and everything " "is " "42")
  => "The answer to life, the universe and everything is 42"
kjfletch
Did the trick just fine, thanks! Knew it was something easy, just didn't know what. :}
bergyman