emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r117091: * lisp/mpc.el (mpc-format): Trim Date to th


From: Stefan Monnier
Subject: [Emacs-diffs] trunk r117091: * lisp/mpc.el (mpc-format): Trim Date to the year.
Date: Mon, 12 May 2014 13:26:03 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117091
revision-id: address@hidden
parent: address@hidden
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Mon 2014-05-12 09:25:53 -0400
message:
  * lisp/mpc.el (mpc-format): Trim Date to the year.
  (mpc-songs-hashcons): Shorten the Date field.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/mpc.el                    mpc.el-20091201190351-ubdosyf8lle4bzd3-10
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-05-12 06:59:30 +0000
+++ b/lisp/ChangeLog    2014-05-12 13:25:53 +0000
@@ -1,5 +1,8 @@
 2014-05-12  Stefan Monnier  <address@hidden>
 
+       * mpc.el (mpc-format): Trim Date to the year.
+       (mpc-songs-hashcons): Shorten the Date field.
+
        * emacs-lisp/nadvice.el (advice--interactive-form): Don't get fooled
        into autoloading just because of a silly indirection.
 

=== modified file 'lisp/mpc.el'
--- a/lisp/mpc.el       2014-05-01 01:08:08 +0000
+++ b/lisp/mpc.el       2014-05-12 13:25:53 +0000
@@ -1024,7 +1024,12 @@
                          (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 @@
 `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)
 


reply via email to

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