aboutsummaryrefslogtreecommitdiff
path: root/emms-source-file.el
diff options
context:
space:
mode:
authorMichael Olson <mwolson@gnu.org>2006-06-04 19:56:00 +0000
committerMichael Olson <mwolson@gnu.org>2006-06-04 19:56:00 +0000
commitc275727ea01b65c94c253e8649b7035d37bf67e1 (patch)
tree9a17fc0ce7054eca846a4813f0df56a938304529 /emms-source-file.el
parent9d10b8d562b427db7720433bc09ccdd6536dfc05 (diff)
Add some sources for inserting playlists without inserting their contents, and likewise for directories of playlist files. Exclude some files and directories from being added when walking directories.
darcs-hash:20060604195602-1bfb2-3ebc047e47ecdece3b4b826b3a6a48ccbbb0f0d0.gz
Diffstat (limited to 'emms-source-file.el')
-rw-r--r--emms-source-file.el29
1 files changed, 23 insertions, 6 deletions
diff --git a/emms-source-file.el b/emms-source-file.el
index 2062f97..c234d04 100644
--- a/emms-source-file.el
+++ b/emms-source-file.el
@@ -67,6 +67,17 @@ find, but it's faster."
emms-source-file-directory-tree-find)
:group 'emms-source-file)
+(defcustom emms-source-file-exclude-regexp
+ (concat "\\`\\(.*\\.?#.*\\|.*,v\\|.*~\\|\\.\\.?\\|,.*\\)\\'\\|"
+ "/\\(CVS\\|RCS\\|\\.arch-ids\\|{arch}\\|,.*\\|\\.svn\\|"
+ "_darcs\\)\\(/\\|\\'\\)")
+ "A regexp matching files to be ignored when adding directories.
+
+You should set case-fold-search to nil before using this regexp
+in code."
+ :type 'regexp
+ :group 'emms-source-file)
+
(defcustom emms-source-file-gnu-find "find"
"*The program name for GNU find."
:type 'string
@@ -105,8 +116,10 @@ from the user."
emms-source-file-default-directory
t)))
(mapc (lambda (file)
- (emms-playlist-insert-track
- (emms-track 'file (expand-file-name file))))
+ (unless (let ((case-fold-search nil))
+ (string-match emms-source-file-exclude-regexp file))
+ (emms-playlist-insert-track
+ (emms-track 'file (expand-file-name file)))))
(directory-files dir t (emms-source-file-regex))))
;;;###autoload (autoload 'emms-play-directory-tree "emms-source-file" nil t)
@@ -120,8 +133,10 @@ value of `emms-source-file-default-directory'."
emms-source-file-default-directory
t)))
(mapc (lambda (file)
- (emms-playlist-insert-track
- (emms-track 'file file)))
+ (unless (let ((case-fold-search nil))
+ (string-match emms-source-file-exclude-regexp file))
+ (emms-playlist-insert-track
+ (emms-track 'file file))))
(emms-source-file-directory-tree (expand-file-name dir)
(emms-source-file-regex))))
@@ -137,8 +152,10 @@ value of `emms-source-file-default-directory'."
t)
(read-from-minibuffer "Find files matching: ")))
(mapc (lambda (file)
- (emms-playlist-insert-track
- (emms-track 'file file)))
+ (unless (let ((case-fold-search nil))
+ (string-match emms-source-file-exclude-regexp file))
+ (emms-playlist-insert-track
+ (emms-track 'file file))))
(emms-source-file-directory-tree dir regex)))
;;;###autoload (autoload 'emms-play-dired "emms-source-file" nil t)