emms-help
[Top][All Lists]
Advanced

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

[emms-help] [PATCH] find a lrc in current dir regardeless of `emms-lyric


From: Andrea Russo
Subject: [emms-help] [PATCH] find a lrc in current dir regardeless of `emms-lyrics-dir'
Date: Fri, 16 Feb 2007 15:07:57 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (gnu/linux)

Hi,

this patch changes `emms-lyrics-find-lyric' so that it returns an lrc
file in the current directory, if present, regardeless of the value
assumed by `emms-lyrics-dir'.

And here is the ChangeLog entry if it's necessary:

2007-02-16  Andrea Russo  <address@hidden>  (tiny change)

        * emms-lyrics.el (emms-lyrics-find-lyric): Ignore the value of
        `emms-lyrics-dir' when there is an lrc file in the current
        directory.

I'm not familiar with darcs, so sorry for the inconvenience.

Regards,
Andrea.

--- old-emms2/emms-lyrics.el    2007-02-16 14:44:13.000000000 +0100
+++ new-emms2/emms-lyrics.el    2007-02-16 14:44:13.000000000 +0100
@@ -340,14 +340,14 @@
 (defun emms-lyrics-find-lyric (file)
   "Use `emms-source-file-gnu-find' to find lrc FILE in
 `emms-lyrics-dir'."
-  (when (and (eq 'file (emms-track-get
-                        (emms-playlist-current-selected-track)
-                        'type))
-             (not (string= emms-lyrics-dir "")))
+  (when (eq 'file (emms-track-get
+                   (emms-playlist-current-selected-track)
+                   'type))
     ;; If find two or more lyric files, only return the first one. Good
     ;; luck! :-)
-    (if (file-exists-p file)             ; same directory
-        file
+    (cond
+     ((file-exists-p file) file)        ; same directory
+     ((not (string= emms-lyrics-dir ""))
       (let* ((ret (car (split-string
                         (shell-command-to-string
                          (concat emms-source-file-gnu-find " "
@@ -359,7 +359,7 @@
                                  "'"))
                         "\n"))))
         (unless (equal ret "")
-          ret)))))
+          ret))))))

 (defun emms-lyrics-find-current-lyric ()
   "Visit current selected track's lyric file."


--
Reclama i tuoi diritti digitali, elimina il DRM.  Approfondisci su
http://www.no1984.org
Reclaim your digital rights, eliminate DRM.  Learn more at
http://www.defectivebydesign.org/what_is_drm





reply via email to

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