[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [emms-help] Add directory or directory tree instead of file
From: |
Carlos Pita |
Subject: |
Re: [emms-help] Add directory or directory tree instead of file |
Date: |
Fri, 4 Jan 2019 01:52:36 -0300 |
Here's an example of a variant that I'm finding quite useful:
(defun my-emms (playlist)
(interactive "P")
(cond ((equal major-mode 'dired-mode)
(call-interactively 'emms-add-dired))
((or (null emms-playlist-buffer)
(not (buffer-live-p emms-playlist-buffer))
(eq (current-buffer) emms-playlist-buffer))
(call-interactively (if playlist 'emms-add-playlist
'emms-add-directory-tree))))
(emms-playlist-mode-go))
As you see, it's a do-the-right-thing approach, in the sense that it
calls the appropriate source function depending on the context. It
surely can be improved, but I think it's pointing in the right
direction.
Best regards
--
Carlos