|Paste number 135920:||ur mom is a whore|
|When:||4 years, 7 months ago|
|Share:||Tweet this! | http://paste.lisp.org/+2WVK|
(require 'cl) (setq *cfg-directory* (file-name-directory load-file-name)) (defun cfg (path) (concat *cfg-directory* path)) ;; taken from http://www.gnu.org/software/emacs/emacs-lisp-intro/html_node/Files-List.html (defun files-in-below-directory (directory &optional pattern filter) "List the .el files in DIRECTORY and in its sub-directories." ;; Although the function will be used non-interactively, ;; it will be easier to test if we make it interactive. ;; The directory will have a name such as ;; "/usr/local/share/emacs/22.1.1/lisp/" (interactive "DDirectory name: ") (unless pattern (setf pattern ".el")) (let (files-list (current-directory-list (directory-files-and-attributes directory t))) ;; while we are in the current directory (while current-directory-list (cond ;; check to see whether filename ends in pattern ;; and if so, append its name to a list. ((equal pattern (substring (car (car current-directory-list)) -3)) (setq files-list (cons (car (car current-directory-list)) files-list))) ;; check whether filename is that of a directory ((eq t (car (cdr (car current-directory-list)))) ;; decide whether to skip or recurse (if (equal "." (substring (car (car current-directory-list)) -1)) ;; then do nothing since filename is that of ;; current directory or parent, "." or ".." () ;; else descend into the directory and repeat the process (setq files-list (append (files-in-below-directory (car (car current-directory-list))) files-list))))) ;; move to the next filename in the list; this also ;; shortens the list so the while loop eventually comes to an end (setq current-directory-list (cdr current-directory-list))) ;; return the filenames files-list)) (dolist (c (sort (files-in-below-directory (cfg ".emacs.d/customizations/")) 'string<)) (let ((load-file-name (file-name-sans-extension c))) (load load-file-name)))
This paste has no annotations.