Skip to content

Instantly share code, notes, and snippets.

@jsvnm
Created November 24, 2011 12:49
Show Gist options
  • Save jsvnm/1391283 to your computer and use it in GitHub Desktop.
Save jsvnm/1391283 to your computer and use it in GitHub Desktop.
exec/load -path searching and finding libraries
(defun exec-path-search (regexp)
(flatten (remove-if-not 'identity
(mapcar (lambda (dir) (directory-files dir t regexp))
exec-path))))
(defun load-path-search (&optional regexp full-path)
(unless regexp (set 'regexp "elc?$"))
(uniq (sort (flatten
(remove-if-not 'identity
(mapcar (lambda (dir) (directory-files dir full-path regexp)) load-path)))
'string-lessp)))
(defun libraries-matching (regexp)
(uniq (mapcar (lambda (f) (symbolify (file-name-sans-extension (file-name-nondirectory f))))
(load-path-search (concat regexp ".*elc?$")))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment