<p>If I have a folder structure set up like this:</p>

<pre><code>~/Projects
    emacs
        package1
            package1-helpers
        package2
            package2-helpers
            package2-more-helpers
        package3
            package3-helpers
</code></pre>

<p>How do I add these folders:</p>

<ul>
<li>~/Projects/emacs</li>
<li>~/Projects/emacs/package1</li>
<li>~/Projects/emacs/package2</li>
<li>~/Projects/emacs/package3</li>
</ul>

<p>...to the <code>load-path</code> from my .emacs file?</p>

<p>I basically need a short automated  version of this code:</p>

<pre><code>(add-to-list 'load-path "~/Projects/emacs")
(add-to-list 'load-path "~/Projects/emacs/package1")
(add-to-list 'load-path "~/Projects/emacs/package2")
(add-to-list 'load-path "~/Projects/emacs/package3")
</code></pre>

```
```
(let ((base "~/Projects/emacs"))
  (add-to-list 'load-path base)
  (dolist (f (directory-files base))
    (let ((name (concat base "/" f)))
      (when (and (file-directory-p name) 
                 (not (equal f ".."))
                 (not (equal f ".")))
        (add-to-list 'load-path name)))))
```
```