aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoni Rabkin <yoni@rabkins.net>2017-07-14 16:16:21 -0400
committerYoni Rabkin <yoni@rabkins.net>2017-07-14 16:16:21 -0400
commit5401b0df9b4a45fb9f01b7f4236f99b34c79595a (patch)
treeecf5a37d4a06ca5a278b70d7a35c37ecae60a121
parenta4ec6697e45a006753bfd79c22f14524748df493 (diff)
Move from cl to cl-lib.
Patch by tumashu <tumashu@163.com>.
-rw-r--r--AUTHORS8
-rw-r--r--lisp/emms-browser.el7
-rw-r--r--lisp/emms-history.el2
-rw-r--r--lisp/emms-i18n.el2
-rw-r--r--lisp/emms-info-metaflac.el1
-rw-r--r--lisp/emms-mark.el11
-rw-r--r--lisp/emms-player-mpd.el9
-rw-r--r--lisp/emms-playing-time.el4
-rw-r--r--lisp/emms-playlist-sort.el6
-rw-r--r--lisp/emms-tag-editor.el2
-rw-r--r--lisp/emms-volume-pulse.el26
11 files changed, 35 insertions, 43 deletions
diff --git a/AUTHORS b/AUTHORS
index 429428a..5c111f5 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -32,12 +32,12 @@ Rasmus Pank Roulund <emacs@pank.eu>
The following is a list of people who contributed trivial patches,
-which is to say simple patches with a total of 12 lines or fewer. We
-started recording trivial patches this way in June of 2017, so trivial
-patches before that date would not appear below.
+which is to say very simple patches and those with total of 12 lines
+or fewer. We started recording trivial patches this way in June of
+2017, so trivial patches before that date would not appear below.
David Michael <fedora.dm0@gmail.com>
-
+tumashu <tumashu@163.com>
;; Local variables:
;; coding: utf-8
diff --git a/lisp/emms-browser.el b/lisp/emms-browser.el
index 94f0072..590a736 100644
--- a/lisp/emms-browser.el
+++ b/lisp/emms-browser.el
@@ -286,14 +286,13 @@
;;; Code:
+(require 'cl-lib)
(require 'emms)
(require 'emms-cache)
(require 'emms-source-file)
(require 'emms-playlist-sort)
(require 'sort)
-(eval-when-compile
- (require 'cl))
;; --------------------------------------------------
;; Variables and configuration
@@ -1068,7 +1067,7 @@ If DIRECTION is 1, move forward, otherwise move backwards."
(emms-browser-kill-subitems)
(if (emms-browser-subitems-exist)
(emms-browser-show-subitems)
- (assert (emms-browser-move-up-level))
+ (cl-assert (emms-browser-move-up-level))
(emms-browser-kill-subitems))))
(defun emms-browser-show-subitems ()
@@ -1637,7 +1636,7 @@ Based on from `emms-browser-covers' and
emms-browser-covers)))
(defun emms-browser-get-cover-from-album (bdata &optional size)
- (assert (eq (emms-browser-bdata-type bdata) 'info-album))
+ (cl-assert (eq (emms-browser-bdata-type bdata) 'info-album))
(let* ((track1data (emms-browser-bdata-data bdata))
(track1 (car (emms-browser-bdata-data (car track1data))))
(path (emms-track-get track1 'name)))
diff --git a/lisp/emms-history.el b/lisp/emms-history.el
index 4d3238b..9b913b2 100644
--- a/lisp/emms-history.el
+++ b/lisp/emms-history.el
@@ -36,8 +36,6 @@
;;; Code:
(require 'emms)
-(eval-when-compile
- (require 'cl))
(defgroup emms-history nil
"Saving and restoring all playlists when closing/restarting
diff --git a/lisp/emms-i18n.el b/lisp/emms-i18n.el
index 748f4aa..66a5eeb 100644
--- a/lisp/emms-i18n.el
+++ b/lisp/emms-i18n.el
@@ -46,8 +46,6 @@
;;; Code:
(provide 'emms-i18n)
-(eval-when-compile
- (require 'cl))
;; TODO: Use defcustom.
(defvar emms-i18n-never-used-coding-system
diff --git a/lisp/emms-info-metaflac.el b/lisp/emms-info-metaflac.el
index 5e50578..5a9f517 100644
--- a/lisp/emms-info-metaflac.el
+++ b/lisp/emms-info-metaflac.el
@@ -38,7 +38,6 @@
;;; Code:
-(eval-when-compile (require 'cl))
(require 'emms-info)
(defvar emms-info-metaflac-version "0.1 $Revision: 1.10 $"
diff --git a/lisp/emms-mark.el b/lisp/emms-mark.el
index 4f02c75..696fe2d 100644
--- a/lisp/emms-mark.el
+++ b/lisp/emms-mark.el
@@ -36,18 +36,17 @@
;;; Code:
(provide 'emms-mark)
+(require 'cl-lib)
(require 'emms)
(require 'emms-playlist-mode)
-(eval-when-compile
- (require 'cl))
;;{{{ set new description-function
(defun emms-mark-track-description (track)
"Return a description of the current track."
- (assert (not (eq (default-value 'emms-track-description-function)
- 'emms-mark-track-description))
- nil (concat "Do not set `emms-track-selection-function' to be"
- " emms-mark-track-description."))
+ (cl-assert (not (eq (default-value 'emms-track-description-function)
+ 'emms-mark-track-description))
+ nil (concat "Do not set `emms-track-selection-function' to be"
+ " emms-mark-track-description."))
(concat " " (funcall (default-value 'emms-track-description-function)
track)))
diff --git a/lisp/emms-player-mpd.el b/lisp/emms-player-mpd.el
index fdc3394..191d072 100644
--- a/lisp/emms-player-mpd.el
+++ b/lisp/emms-player-mpd.el
@@ -103,6 +103,7 @@
;; Adam Sjøgren implemented support for changing the volume.
+(require 'cl-lib)
(require 'emms-player-simple)
(require 'emms-source-playlist) ; for emms-source-file-parse-playlist
(require 'tq)
@@ -150,10 +151,10 @@ or nil if we cannot figure it out."
(let* ((b (match-end 0))
(e (string-match "Output plugins:$" out))
(plugs (split-string (substring out b e) "\n" t))
- (plugs (mapcan (lambda (x)
- (and (string-match " +\\[.*\\] +\\(.+\\)$" x)
- (split-string (match-string 1 x) nil t)))
- plugs))
+ (plugs (cl-mapcan (lambda (x)
+ (and (string-match " +\\[.*\\] +\\(.+\\)$" x)
+ (split-string (match-string 1 x) nil t)))
+ plugs))
(b (and (string-match "Protocols:$" out) (match-end 0)))
(prots (and b (substring out (+ 2 b) -1)))
(prots (split-string (or prots "") nil t)))
diff --git a/lisp/emms-playing-time.el b/lisp/emms-playing-time.el
index 54a7f12..9c4f96a 100644
--- a/lisp/emms-playing-time.el
+++ b/lisp/emms-playing-time.el
@@ -39,7 +39,7 @@
;;; Code:
-(eval-when-compile (require 'cl))
+(require 'cl-lib)
(require 'emms-info)
(require 'emms-player-simple)
@@ -177,7 +177,7 @@ could call `emms-playing-time-enable-display' and
0))
(total-min-only (/ total-playing-time 60))
(total-sec-only (% total-playing-time 60)))
- (case emms-playing-time-style
+ (cl-case emms-playing-time-style
((bar) ; `bar' style
(if (zerop total-playing-time)
(setq emms-playing-time-string "[==>........]")
diff --git a/lisp/emms-playlist-sort.el b/lisp/emms-playlist-sort.el
index 138308e..0c3b466 100644
--- a/lisp/emms-playlist-sort.el
+++ b/lisp/emms-playlist-sort.el
@@ -22,7 +22,7 @@
;;; Code:
-(eval-when-compile (require 'cl))
+(require 'cl-lib)
(require 'emms-last-played)
(require 'emms-playlist-mode)
@@ -188,10 +188,10 @@ ie. by album name and then by track number."
(defun emms-playlist-sort-by-list-p (a b)
(catch 'return
(dolist (info emms-playlist-sort-list)
- (case info
+ (cl-case info
((name info-artist info-composer info-performer info-title info-album info-genre)
(when (emms-string< (emms-track-get a info)
- (emms-track-get b info))
+ (emms-track-get b info))
(throw 'return t)))
((info-playing-time)
(when (< (emms-track-get a info)
diff --git a/lisp/emms-tag-editor.el b/lisp/emms-tag-editor.el
index c57a111..022990b 100644
--- a/lisp/emms-tag-editor.el
+++ b/lisp/emms-tag-editor.el
@@ -27,8 +27,6 @@
;;; Code:
-(eval-when-compile
- (require 'cl))
(condition-case nil
(require 'overlay)
(error nil))
diff --git a/lisp/emms-volume-pulse.el b/lisp/emms-volume-pulse.el
index 7fc6de5..a3f9620 100644
--- a/lisp/emms-volume-pulse.el
+++ b/lisp/emms-volume-pulse.el
@@ -42,7 +42,7 @@
;;; Code:
-(eval-when-compile (require 'cl))
+(require 'cl-lib)
;; TODO: it would be great if custom could have
;; choices based on pactl list short sinks | cut -f1-2
@@ -77,18 +77,18 @@ See full list of devices on your system by running
(if sink-number-p 'assq 'assoc)
emms-volume-pulse-sink
(mapcar (if sink-number-p 'identity 'cdr)
- (loop while
- (string-match
- (mapconcat 'identity
- '(".*Sink[ \t]+\\#\\([0-9]\\)"
- ".*Name:[ \t]\\([^\n]+\\)"
- ".*Volume:.*?\\([0-9]+\\)%.*\n?")
- "\n")
- output)
- collect (list (string-to-number (match-string 1 output))
- (match-string 2 output)
- (match-string 3 output))
- do (setq output (replace-match "" nil nil output))))))))))
+ (cl-loop while
+ (string-match
+ (mapconcat 'identity
+ '(".*Sink[ \t]+\\#\\([0-9]\\)"
+ ".*Name:[ \t]\\([^\n]+\\)"
+ ".*Volume:.*?\\([0-9]+\\)%.*\n?")
+ "\n")
+ output)
+ collect (list (string-to-number (match-string 1 output))
+ (match-string 2 output)
+ (match-string 3 output))
+ do (setq output (replace-match "" nil nil output))))))))))
;;;###autoload