aboutsummaryrefslogtreecommitdiff
path: root/lisp/emms-source-file.el
diff options
context:
space:
mode:
authorLucas Bonnet <lucas@rincevent.net>2010-02-19 16:38:24 +0100
committerLucas Bonnet <lucas@rincevent.net>2010-02-19 16:38:24 +0100
commitcf3b4a73e3ee05b0a4e4cd03e5da481da0466a8f (patch)
tree27533d6629a3bafb00855e4e81b3d40de396e188 /lisp/emms-source-file.el
parent138e646969facc2b8c1527cb249dcef64ec2051b (diff)
* lisp/emms-source-file.el: Avoid adding duplicates when dealing with symbolic link.
Patch from Stefan Kangas <skangas@skangas.se>
Diffstat (limited to 'lisp/emms-source-file.el')
-rw-r--r--lisp/emms-source-file.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/emms-source-file.el b/lisp/emms-source-file.el
index 1b0f039..91cd466 100644
--- a/lisp/emms-source-file.el
+++ b/lisp/emms-source-file.el
@@ -162,7 +162,7 @@ value of `emms-source-file-default-directory'."
(string-match emms-source-file-exclude-regexp file))
(emms-playlist-insert-track
(emms-track 'file file))))
- (emms-source-file-directory-tree dir regex)))
+ (emms-source-file-directory-tree (expand-file-name dir) regex)))
;;;###autoload (autoload 'emms-play-dired "emms-source-file" nil t)
;;;###autoload (autoload 'emms-add-dired "emms-source-file" nil t)
@@ -199,7 +199,10 @@ This function uses only emacs functions, so it might be a bit slow."
(while dirs
(cond
((file-directory-p (car dirs))
- (if (string-match "/\\.\\.?$" (car dirs))
+ (if (or (string-match "/\\.\\.?$" (car dirs))
+ (let ((symlink (file-symlink-p (car dirs))))
+ (and symlink
+ (string-equal dir (substring symlink 0 (string-width dir))))))
(setq dirs (cdr dirs))
(setq dirs
(condition-case nil