Re: New ‘--list-generations’ and ‘--delete-generations’ options

2013-09-16 Thread Nikita Karetnikov
Cool. The diff looks great... but it lacks tests. Yes, I wanted to finish the recutils part first. I’ve been thinking about that, and I don’t like that we’d have to use two record sets. It’d be necessary to post-process the output nearly every time. Then why bother? We can already filter

Re: New ‘--list-generations’ and ‘--delete-generations’ options

2013-09-16 Thread Ludovic Courtès
Nikita Karetnikov nik...@karetnikov.org skribis: Cool. The diff looks great... but it lacks tests. Yes, I wanted to finish the recutils part first. I think it’s reasonable to have a first milestone without recutils output. I’ve been thinking about that, and I don’t like that we’d have to

Re: New ‘--list-generations’ and ‘--delete-generations’ options

2013-09-13 Thread Nikita Karetnikov
I’d prefer clearer case analysis as shown above. OK, what do you think about this diff? If everything is fine, I’ll make it output generations in the recutils format. (Is it necessary to mention that ‘maybe-comma-separated-integers’ accepts something like ‘1,2,3,’ or ‘1,,,2’. Or should I

Re: New ‘--list-generations’ and ‘--delete-generations’ options

2013-09-12 Thread Nikita Karetnikov
By definition submatches 1 and 2 exist when RES is true. Thus, I’d remove ‘safe-match:substring-number’ and do: (match (string-match ^([0-9]+)\\.\\.([0-9]+)$ str) (#f #f) (matches (let ((start (number-string (match:substring matches 1))) (end (number-string

Re: New ‘--list-generations’ and ‘--delete-generations’ options

2013-09-12 Thread Ludovic Courtès
Nikita Karetnikov nik...@karetnikov.org skribis: Probably this can reduce to a big ‘cond’, which would be even more readable: (cond ((maybe-integer) = list) ((string-match ^([0-9]+)\\.\\.([0-9]+)$ str) = (lambda (match) ...))

Re: New ‘--list-generations’ and ‘--delete-generations’ options

2013-09-10 Thread Nikita Karetnikov
How can I subtract 22 days from (current-time) using SRFI-19? Note that the above example suggests that ‘string-duration’ returns a time object with of type ‘time-duration’ (thus independent of the current time.) Ah, OK. But we’ll have to subtract from (current-time) later anyway, right?

Re: New ‘--list-generations’ and ‘--delete-generations’ options

2013-09-08 Thread Nikita Karetnikov
I’m asking because if we do that, ‘--list-generations’ may just as well print out *all* the generation records. Users who want to select only less than one-month old generations can do that with ‘recsel’, and we don’t have anything more to do. WDYT? I see recutils as an advanced option

Re: New ‘--list-generations’ and ‘--delete-generations’ options

2013-09-08 Thread Ludovic Courtès
Nikita Karetnikov nik...@karetnikov.org skribis: I’m asking because if we do that, ‘--list-generations’ may just as well print out *all* the generation records. Users who want to select only less than one-month old generations can do that with ‘recsel’, and we don’t have anything more to do.

Re: New ‘--list-generations’ and ‘--delete-generations’ options

2013-09-05 Thread Ludovic Courtès
Nikita Karetnikov nik...@karetnikov.org skribis: The attached procedure will be invoked when either option is called with an argument. Nice. BTW, what did you think of the idea of using recutils format as the output? (Either as the sole output format, or otherwise as a secondary format.)

Re: New ‘--list-generations’ and ‘--delete-generations’ options

2013-09-05 Thread Nikita Karetnikov
BTW, what did you think of the idea of using recutils format as the output? (Either as the sole output format, or otherwise as a secondary format.) I like the idea. It’s always better to use a documented format, especially when it comes with a mode for Emacs. And don’t forget that

Re: New ‘--list-generations’ and ‘--delete-generations’ options

2013-09-02 Thread Ludovic Courtès
Nikita Karetnikov nik...@karetnikov.org skribis: I’m trying to handle the “last-month” and the “first-month” cases. I’d like to use ‘profile-numbers’* to construct an alist of generations and their creation dates. What can I use to get the creation date of a file? I can’t find anything in