diff options
author | William Xu <william.xwl@gmail.com> | 2007-11-04 14:38:00 +0000 |
---|---|---|
committer | William Xu <william.xwl@gmail.com> | 2007-11-04 14:38:00 +0000 |
commit | 40d7162d906ab9776d8b592e446bf1abc0763010 (patch) | |
tree | f91a04a747f4c1f17ec61bdfffd9e037a64a164e | |
parent | db6bfe9848971a857518c817acc0773d6f76738d (diff) |
When calling file-exists-p, make sure it's operated on a regular file. (This is the cause of the various tramp errors..)
darcs-hash:20071104143856-cfa61-320ed4942ec58d4a5ece4f4568444a96858890a1.gz
-rw-r--r-- | emms-lyrics.el | 4 | ||||
-rw-r--r-- | emms-player-mplayer.el | 8 |
2 files changed, 7 insertions, 5 deletions
diff --git a/emms-lyrics.el b/emms-lyrics.el index 8cb437b..a9ed2fd 100644 --- a/emms-lyrics.el +++ b/emms-lyrics.el @@ -444,7 +444,9 @@ e.g., (emms-lyrics-find-lyric \"abc.lrc\")" (lyric-under-curr-dir (concat (file-name-directory (emms-track-get track 'name)) file))) - (or (and (file-exists-p lyric-under-curr-dir) lyric-under-curr-dir) + (or (and (eq (emms-track-type track) 'file) + (file-exists-p lyric-under-curr-dir) + lyric-under-curr-dir) (car (funcall emms-source-file-directory-tree-function emms-lyrics-dir file))))) diff --git a/emms-player-mplayer.el b/emms-player-mplayer.el index 5f22a94..fb6777a 100644 --- a/emms-player-mplayer.el +++ b/emms-player-mplayer.el @@ -83,12 +83,12 @@ (defun emms-player-mplayer-subtitle-checker () (let* ((track (emms-playlist-current-selected-track)) - (name (emms-replace-regexp-in-string - "/" "_" - (emms-track-name track))) + (name (emms-track-name track)) (ext (file-name-extension name)) (choices - (emms-remove-if-not 'file-exists-p + (emms-remove-if-not (lambda (i) + (and (eq (emms-track-type track) 'file) + (file-exists-p i))) (mapcar (lambda (el) (emms-replace-regexp-in-string (concat ext "$") el name)) |