[Top][All Lists]

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

[PATCH] Prefer dired-jump for emms-playlist-mode-goto-dired-at-point

From: Brian Leung
Subject: [PATCH] Prefer dired-jump for emms-playlist-mode-goto-dired-at-point
Date: Thu, 14 Jul 2022 01:08:13 +0000

>From c18349c822bda727dff3fa1a036f9b7961a30578 Mon Sep 17 00:00:00 2001
From: Brian Leung <leungbk@posteo.net>
Date: Wed, 13 Jul 2022 17:48:24 -0700
Subject: [PATCH] emms-playlist-mode-goto-dired-at-point: Prefer using

* emms-playlist-mode.el (emms-playlist-mode-goto-dired-at-point): Use
dired-jump, optionally opening the dired buffer in other-window.

dired-jump behavior aligns more closely with what is advertised by the
 emms-playlist-mode.el | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/emms-playlist-mode.el b/emms-playlist-mode.el
index a2aefca..9b1f047 100644
--- a/emms-playlist-mode.el
+++ b/emms-playlist-mode.el
@@ -312,15 +312,17 @@ 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)
+(defun emms-playlist-mode-goto-dired-at-point (&optional other-window)
+  "Visit the track at point in a `dired' buffer.
+With a prefix arg, open the `dired' buffer in OTHER-WINDOW."
+  (interactive "P")
   (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))
+              (dired-jump other-window name)
            (error "Can't visit this track type in Dired")))
       (error "No track at point"))))

reply via email to

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