Created
November 24, 2011 12:49
-
-
Save jsvnm/1391283 to your computer and use it in GitHub Desktop.
exec/load -path searching and finding libraries
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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