Paste number 135920: ur mom is a whore

Paste number 135920: ur mom is a whore
Pasted by: urmom
When:5 years, 1 month ago
Share:Tweet this! |
Paste contents:
Raw Source | XML | Display As
(require 'cl)

(setq *cfg-directory* (file-name-directory load-file-name))

(defun cfg (path)
  (concat *cfg-directory* path))

;; taken from
(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
         (directory-files-and-attributes directory t)))
    ;; while we are in the current directory
    (while current-directory-list
       ;; 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
            (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
                  (car (car current-directory-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

(dolist (c (sort (files-in-below-directory (cfg ".emacs.d/customizations/"))
  (let ((load-file-name (file-name-sans-extension c)))
    (load load-file-name)))

This paste has no annotations.

Colorize as:
Show Line Numbers

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.