elisp練習

起点ディレクトリ以下のディレクトリをload-pathに追加。

(defun list-directory-tree (directory)
  (let ((dirs (list directory)))
    (mapcar (lambda (x)
              (and (file-directory-p x)
                   (append-to-list 'dirs (list-directory-tree x))))
        (directory-files directory t "^[^\.]"))
    dirs))

(append-to-list 'load-path (list-directory-tree "~/.emacs.d/site-lisp/"))