aboutsummaryrefslogtreecommitdiff
path: root/emms-last-played.el
diff options
context:
space:
mode:
authorYoni Rabkin <yoni@rabkins.net>2021-04-27 14:22:20 -0400
committerYoni Rabkin <yoni@rabkins.net>2021-04-27 14:22:20 -0400
commit7263ea6f64b1bbf4de89cac6501be2e5d8e3fe9c (patch)
tree125878391cf880337ca4f044875ae97d46c1a775 /emms-last-played.el
parent75563821de35dacceb7bb118ee031790d0225583 (diff)
*.el: Misc improvements and fixes w.r.t lexical binding
* jack.el: Enable lexical-binding. * emms-playlist-limit.el (emms-playlist-limit--limit-playlist): Use a closure. * emms-player-mpg321-remote.el (emms-player-ignore-stop): Declare, so as to fix a mis-compilation in `emms-player-mpg321-remote-notify-emms`. * emms-last-played.el (emms-last-played-format-date): Use lexical binding. * emms-browser.el (emms-browser-filter-only-dir) (emms-browser-filter-only-type, emms-browser-filter-only-recent): Return a closure. Patch by Stefan Monnier
Diffstat (limited to 'emms-last-played.el')
-rw-r--r--emms-last-played.el10
1 files changed, 5 insertions, 5 deletions
diff --git a/emms-last-played.el b/emms-last-played.el
index 33f1c83..679e98a 100644
--- a/emms-last-played.el
+++ b/emms-last-played.el
@@ -1,6 +1,6 @@
;;; emms-last-played.el --- Support for last-played-time of a track -*- lexical-binding: t; -*-
-;; Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2006-2021 Free Software Foundation, Inc.
;; Author: Lucas Bonnet <lucas@rincevent.net>
;; Keywords: emms, mp3, mpeg, multimedia
@@ -99,7 +99,7 @@ If non-existent, it is set to 1."
(* (- (string-to-number days) 1) 3600 24))))
(defun emms-last-played-format-date (messy-date)
- "Format the messy-date according to emms-last-played-format-alist.
+ "Format the messy-date according to `emms-last-played-format-alist'.
Returns \" ? \" if there's bad input or if an other error occurs.
Input should look like this: \"Sun, 14 Oct 2001 13:34:39 +0200\"."
(condition-case ()
@@ -109,14 +109,14 @@ Input should look like this: \"Sun, 14 Oct 2001 13:34:39 +0200\"."
(my-format "%b %d '%y"))
(let* ((difference (- now messy-date))
(templist emms-last-played-format-alist)
- (top (eval (caar templist))))
+ (top (eval (caar templist) t)))
(while (if (numberp top) (< top difference) (not top))
(progn
(setq templist (cdr templist))
- (setq top (eval (caar templist)))))
+ (setq top (eval (caar templist) t))))
(if (stringp (cdr (car templist)))
(setq my-format (cdr (car templist)))))
- (format-time-string (eval my-format) (seconds-to-time messy-date)))
+ (format-time-string (eval my-format t) (seconds-to-time messy-date)))
(error "Never.")))
(provide 'emms-last-played)