Stefan Monnier writes: >> +;;; Stats viewer ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; >> + >> +(defcustom mpc-mpd-stats-date-format "%c" >> + "Format used for dates in `mpc-mpd-stats'. >> +See `format-time-string' for formatting details." >> + :version "31.1" >> + :type 'string) >> + >> +(defcustom mpc-mpd-stats-duration-format "%Y, %D, %z%h:%.2m:%.2s" >> + "Format used for durations in `mpc-mpd-stats'. >> +See `format-seconds' for formatting details." >> + :version "31.1" >> + :type 'string) > > Do we need this level of customization? I hope not. >> + :objects (let-alist (mpc-proc-cmd-to-alist (list "stats")) >> + `(("Artists" ,.artists) >> + ("Albums" ,.albums) >> + ("Songs" ,.songs) >> + ("Play Time" ,(mpc--mpd-stats-duration .playtime)) >> + ("Uptime" ,(mpc--mpd-stats-duration .uptime)) >> + ("DB Play Time" ,(mpc--mpd-stats-duration .db_playtime)) >> + ("DB Updated" ,(mpc--mpd-stats-date .db_update)))))) > > But here I'd be tempted not to hardcode the list, so it will always > print all the info returned by the server: > > - Maybe have a generic heuristic to make the keys pretty (e.g. turn > "albums" into "Albums" and "db_update" into "DB Update") > - Provide ad-hoc elements for those specific entries where we want to > prettify the raw value before displaying it (i.e. where we want to > apply `mpc--mpd-stats-duration` or `mpc--mpd-stats-date`). > > WDYT? Sounds good. How about the attached?