aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2014-05-12 09:25:53 -0400
committerStefan Monnier2014-05-12 09:25:53 -0400
commit400e8286029ef08d2e8a6ab1b2a970c816c4662d (patch)
tree6014500a3bbf65b511acbfc10da272ad561c0159
parent9ce28d805f8777b3f7ca6a1039ed845319a5d4f5 (diff)
downloademacs-400e8286029ef08d2e8a6ab1b2a970c816c4662d.tar.gz
emacs-400e8286029ef08d2e8a6ab1b2a970c816c4662d.zip
* lisp/mpc.el (mpc-format): Trim Date to the year.
(mpc-songs-hashcons): Shorten the Date field.
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/mpc.el9
2 files changed, 10 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 0de3533c6c4..4f5d0734aec 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
12014-05-12 Stefan Monnier <monnier@iro.umontreal.ca> 12014-05-12 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * mpc.el (mpc-format): Trim Date to the year.
4 (mpc-songs-hashcons): Shorten the Date field.
5
3 * emacs-lisp/nadvice.el (advice--interactive-form): Don't get fooled 6 * emacs-lisp/nadvice.el (advice--interactive-form): Don't get fooled
4 into autoloading just because of a silly indirection. 7 into autoloading just because of a silly indirection.
5 8
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."
1024 (when (and (null val) (eq tag 'Title)) 1024 (when (and (null val) (eq tag 'Title))
1025 (setq val (cdr (assq 'file info)))) 1025 (setq val (cdr (assq 'file info))))
1026 (push `(equal ',val (cdr (assq ',tag info))) pred) 1026 (push `(equal ',val (cdr (assq ',tag info))) pred)
1027 val))))) 1027 (cond
1028 ((not (and (eq tag 'Date) (stringp val))) val)
1029 ;; For "date", only keep the year!
1030 ((string-match "[0-9]\\{4\\}" val)
1031 (match-string 0 val))
1032 (t val)))))))
1028 (space (when size 1033 (space (when size
1029 (setq size (string-to-number size)) 1034 (setq size (string-to-number size))
1030 (propertize " " 'display 1035 (propertize " " 'display
@@ -1866,7 +1871,7 @@ This is used so that they can be compared with `eq', which is needed for
1866`text-property-any'.") 1871`text-property-any'.")
1867(defun mpc-songs-hashcons (name) 1872(defun mpc-songs-hashcons (name)
1868 (or (gethash name mpc-songs-hashcons) (puthash name name mpc-songs-hashcons))) 1873 (or (gethash name mpc-songs-hashcons) (puthash name name mpc-songs-hashcons)))
1869(defcustom mpc-songs-format "%2{Disc--}%3{Track} %-5{Time} %25{Title} %20{Album} %20{Artist} %10{Date}" 1874(defcustom mpc-songs-format "%2{Disc--}%3{Track} %-5{Time} %25{Title} %20{Album} %20{Artist} %5{Date}"
1870 "Format used to display each song in the list of songs." 1875 "Format used to display each song in the list of songs."
1871 :type 'string) 1876 :type 'string)
1872 1877