From 7263ea6f64b1bbf4de89cac6501be2e5d8e3fe9c Mon Sep 17 00:00:00 2001 From: Yoni Rabkin Date: Tue, 27 Apr 2021 14:22:20 -0400 Subject: *.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 --- emms-last-played.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'emms-last-played.el') 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 ;; 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) -- cgit v1.2.3