emms-help
[Top][All Lists]
Advanced

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

Re: [emms-help] Filter recently added


From: Jim Burton
Subject: Re: [emms-help] Filter recently added
Date: Fri, 21 Mar 2008 17:44:39 +0000
User-agent: Wanderlust/2.15.5 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.7 Emacs/23.0.60 (i486-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

At Fri, 21 Mar 2008 14:43:14 +0000,
Jim Burton wrote:
> 
> ... My non-existent
> elisp skills are holding me back (which I intend to do something about
> some time soon!).
> 

After typing that I thought I should just get on with it so have had a
go at my first elisp functions. It doesn't seem to work though -- there are 
lots of files selected
which shouldn't be there (they are older than 7 days). But if I supply
a file name to jb:mod-time-lt it gives the right answer...any other
comments (i.e. conventions to follow, are there built-ins that do this etc) are 
very welcome, unless that's OT. 

(defun jb:secs-as-days (s)
  (/ (/ (/ s 60) 60) 24))
(defun jb:mod-time (attr)
  (car (cdr (cdr (cdr (cdr (cdr attr)))))))
(defun jb:mod-time-lt (d f)
  (> d (jb:secs-as-days (- (float-time) 
                           (float-time (jb:mod-time (file-attributes f)))))))
(defun jb:track-name (track)
  (cdr (car (cdr (cdr track))))) 

(emms-browser-make-filter "recently-added"
      (lambda (track)
       (jb:mod-time-lt 7 (jb:track-name track))))

> Thanks,
> 
> Jim
> 
> 
> _______________________________________________
> Emms-help mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emms-help




reply via email to

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