aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryoni <yoni>2008-02-16 11:59:00 +0000
committeryoni <mwolson@gnu.org>2008-02-16 11:59:00 +0000
commit9867a7128473f1df9b718571603028af9c59c135 (patch)
tree1efbe7516a121ed9db7e107945d54e4895d84676
parentc932d7f13c696b3ebf36f20ac43564ad99e7a96e (diff)
Added emms-playlist-mode-goto-dired-at-point (with keybinding) to emms-playlist-mode.el.
darcs-hash:20080216115915-670cc-d188de0d0a8b74d0f21313f061d89c90e8cde09f.gz
-rw-r--r--emms-playlist-mode.el13
1 files changed, 13 insertions, 0 deletions
diff --git a/emms-playlist-mode.el b/emms-playlist-mode.el
index 1c016b5..f8f5086 100644
--- a/emms-playlist-mode.el
+++ b/emms-playlist-mode.el
@@ -143,6 +143,7 @@ This is true for every invocation of `emms-playlist-mode-go'."
(define-key map (kbd "?") 'describe-mode)
(define-key map (kbd "r") 'emms-random)
(define-key map (kbd "C") 'emms-playlist-mode-clear)
+ (define-key map (kbd "D") 'emms-playlist-mode-goto-dired-at-point)
(define-key map (kbd "<mouse-2>") 'emms-playlist-mode-play-current-track)
(define-key map (kbd "RET") 'emms-playlist-mode-play-smart)
map)
@@ -323,6 +324,18 @@ set it as current."
(goto-char (point-min))
(message "Added %s" (symbol-name type)))))))
+(defun emms-playlist-mode-goto-dired-at-point ()
+ "Visit the track at point in a `dired' buffer."
+ (interactive)
+ (let ((track (emms-playlist-track-at)))
+ (if track
+ (let ((name (emms-track-get track 'name))
+ (type (emms-track-get track 'type)))
+ (if (eq type 'file)
+ (dired (file-name-directory name))
+ (error "Can't visit this track type in Dired")))
+ (error "No track at point"))))
+
;;; --------------------------------------------------------
;;; Killing and yanking
;;; --------------------------------------------------------