[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[emms-help] ido-mode patch to emms-source-file.el
From: |
William Xu |
Subject: |
[emms-help] ido-mode patch to emms-source-file.el |
Date: |
Wed, 13 Jul 2005 00:09:08 +0800 |
User-agent: |
Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) |
Hi, guys~
This patch makes ido available to emms.
ps: ido.el is a really great package, which supports file/buffer name
substring matching. I hope someday it would become part of the standard
Emacs.
$ diff -u emms-source-file.el emms-source-file.el.new
======================================================
--- emms-source-file.el 2005-07-09 19:56:00.000000000 +0800
+++ emms-source-file.el.new 2005-07-12 23:35:29.576740296 +0800
@@ -73,11 +73,19 @@
:type 'string
:group 'emms-source-file)
+;; Integrated ido.el here.
+;; (2005/07/11 01:47:20 William Xu <address@hidden>)
+
;; The `read-directory-name' function is not available in Emacs 21.
(defalias 'emms-read-directory-name
- (if (fboundp 'read-directory-name)
- #'read-directory-name
- #'read-file-name))
+ (if (fboundp 'ido-read-directory-name)
+ 'ido-read-directory-name
+ 'read-file-name))
+
+(defun emms-read-file-name ()
+ (if (fboundp 'ido-read-file-name)
+ 'ido-read-file-name
+ 'read-file-name))
;;; Sources
@@ -86,10 +94,10 @@
(define-emms-source file (file)
"An EMMS source for a single file - either FILE, or queried from the
user."
- (interactive (list (read-file-name "Play file: "
- emms-source-file-default-directory
- emms-source-file-default-directory
- t)))
+ (interactive (list (emms-read-file-name "Play file: "
+ emms-source-file-default-directory
+ emms-source-file-default-directory
+ t)))
(if (file-directory-p file)
(emms-source-directory file)
(list (emms-track 'file (expand-file-name file)))))
@@ -145,10 +153,10 @@
(define-emms-source m3u-playlist (playlist)
"A source for simple .m3u playlists. It ignores empty lines, or
lines starting with '#'."
- (interactive (list (read-file-name "Play file: "
- emms-source-file-default-directory
- emms-source-file-default-directory
- t)))
+ (interactive (list (emms-read-file-name "Play file: "
+ emms-source-file-default-directory
+ emms-source-file-default-directory
+ t)))
(emms-source-files
(let ((files '())
(dir (file-name-directory playlist)))
--
William
emms-source-file.el.new
Description: Text document
- [emms-help] ido-mode patch to emms-source-file.el,
William Xu <=