diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2014-05-12 09:25:53 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2014-05-12 09:25:53 -0400 |
commit | 400e8286029ef08d2e8a6ab1b2a970c816c4662d (patch) | |
tree | 6014500a3bbf65b511acbfc10da272ad561c0159 /lisp/mpc.el | |
parent | 9ce28d805f8777b3f7ca6a1039ed845319a5d4f5 (diff) | |
download | emacs-400e8286029ef08d2e8a6ab1b2a970c816c4662d.tar.gz |
* lisp/mpc.el (mpc-format): Trim Date to the year.
(mpc-songs-hashcons): Shorten the Date field.
Diffstat (limited to 'lisp/mpc.el')
-rw-r--r-- | lisp/mpc.el | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lisp/mpc.el b/lisp/mpc.el index d569610a615..d03edf86bba 100644 --- a/lisp/mpc.el +++ b/lisp/mpc.el @@ -1024,7 +1024,12 @@ If PLAYLIST is t or nil or missing, use the main playlist." (when (and (null val) (eq tag 'Title)) (setq val (cdr (assq 'file info)))) (push `(equal ',val (cdr (assq ',tag info))) pred) - val))))) + (cond + ((not (and (eq tag 'Date) (stringp val))) val) + ;; For "date", only keep the year! + ((string-match "[0-9]\\{4\\}" val) + (match-string 0 val)) + (t val))))))) (space (when size (setq size (string-to-number size)) (propertize " " 'display @@ -1866,7 +1871,7 @@ This is used so that they can be compared with `eq', which is needed for `text-property-any'.") (defun mpc-songs-hashcons (name) (or (gethash name mpc-songs-hashcons) (puthash name name mpc-songs-hashcons))) -(defcustom mpc-songs-format "%2{Disc--}%3{Track} %-5{Time} %25{Title} %20{Album} %20{Artist} %10{Date}" +(defcustom mpc-songs-format "%2{Disc--}%3{Track} %-5{Time} %25{Title} %20{Album} %20{Artist} %5{Date}" "Format used to display each song in the list of songs." :type 'string) |