From cf3b4a73e3ee05b0a4e4cd03e5da481da0466a8f Mon Sep 17 00:00:00 2001 From: Lucas Bonnet Date: Fri, 19 Feb 2010 16:38:24 +0100 Subject: * lisp/emms-source-file.el: Avoid adding duplicates when dealing with symbolic link. Patch from Stefan Kangas --- lisp/emms-source-file.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lisp') 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 -- cgit v1.2.3