emms-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[emms-help] emms-playlist-dired-jump


From: Andrea Russo
Subject: [emms-help] emms-playlist-dired-jump
Date: Mon, 05 Jun 2006 13:23:38 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Hi,

I started using emms2 for 2 two weeks now and I find it very, very
nice!

My customizations are mostly borrowed from Michael Olson emms-init.el
(thanks to him for sharing his setup) but I ended up with a function I
find useful.  Maybe it is of some interest here.

;; Jump to the directory containing the track at point
(defun emms-playlist-dired-jump (&optional other-window)
  "Jump to dired buffer corresponding to current track.
If called with an argument, open the dired buffer on another window."
  (interactive "P")
  (let* ((file (emms-track-get (emms-playlist-track-at) 'name))
         (dir (if file (file-name-directory file) default-directory)))
    (if other-window
        (dired-other-window dir)
      (dired dir))
    (if file (dired-goto-file file))))


Thanks,
Andrea.

-- 
"If art interprets our dreams, the computer executes them in the guise
of programs!" -- Alan J. Perils





reply via email to

[Prev in Thread] Current Thread [Next in Thread]