Hi all,
the following might make displaying the header view slower, so it might
not be for everybody. However, I personally find this potentially
useful (I'll be testing it over the course of the following days). It
changes the "human" date/time format to display the /yesterday's/ times
as "Y-18:59:00", for instance, and only earlier dates as pure dates.
Optimizations welcome, since this is going to be run multiple times
during the headers display, of course.
--8<---------------cut here---------------start------------->8---
(defsubst mu4e~headers-human-date (msg)
"Show a 'human' date.
If the date is today or yesterday, show the time, otherwise, show
the date. The formats used for date and time are
`mu4e-headers-date-format' and `mu4e-headers-time-format'."
(let ((date (mu4e-msg-field msg :date)))
(if (equal date '(0 0 0))
"None"
(let ((day1 (decode-time date))
(day2 (decode-time (current-time))))
(cond ((and
(eq (nth 3 day1) (nth 3 day2)) ;; day
(eq (nth 4 day1) (nth 4 day2)) ;; month
(eq (nth 5 day1) (nth 5 day2))) ;; year
(format-time-string mu4e-headers-time-format date))
((eq (- (time-to-days current-time) (time-to-days date)) 1)
(format-time-string mu4e-headers-yesterday-time-format date))
(t
(format-time-string mu4e-headers-date-format date)))))))
(defcustom mu4e-headers-yesterday-time-format "Y-%X"
"Time format to use in the headers view for yesterday's
messages. In the format of `format-time-string'."
:type 'string
:group 'mu4e-headers)
--8<---------------cut here---------------end--------------->8---
Best,
--
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University