From 8d8bce91fb2e2ab4025f3f010f3fd6bf7833f6e1 Mon Sep 17 00:00:00 2001 From: djcb Date: Mon, 17 Dec 2012 00:33:25 +0200 Subject: [PATCH] * fix `mu4e~headers-human-date' --- mu4e/mu4e-headers.el | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/mu4e/mu4e-headers.el b/mu4e/mu4e-headers.el index 3d37e6ce..1f888f68 100644 --- a/mu4e/mu4e-headers.el +++ b/mu4e/mu4e-headers.el @@ -97,6 +97,15 @@ indexing operation showed changes." :type 'boolean :group 'mu4e-headers) +(defcustom mu4e-headers-skip-duplicates nil + "With this option set to non-nil, show only one of duplicate +messages. This is useful when you have multiple copies of the same +message, which is a common occurence for example when using Gmail +and offlineimap." + :type 'boolean + :group 'mu4e-headers) + + ;; marks for headers of the form; each is a cons-cell (basic . fancy) ;; each of which is basic ascii char and something fancy, respectively @@ -180,7 +189,6 @@ followed by the docid, followed by `mu4e~headers-docid-post'.") ("to" . :to)) "List of cells describing the various sort-options. In the format needed for `mu4e-read-option'.") - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun mu4e~headers-clear () @@ -338,13 +346,16 @@ otherwise ; show the from address; prefixed with the appropriate If the date is today, 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 (= (nth 3 (decode-time date)) (nth 3 (decode-time (current-time)))) + (let* ((date (mu4e-msg-field msg :date)) + (day1 (decode-time date)) + (day2 (decode-time (current-time)))) + (if (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) (format-time-string mu4e-headers-date-format date)))) - - ;; note: this function is very performance-sensitive (defun mu4e~headers-header-handler (msg &optional point) "Create a one line description of MSG in this buffer, at POINT, @@ -835,7 +846,8 @@ the query history stack." mu4e-headers-show-threads mu4e~headers-sort-field mu4e~headers-sort-direction - (unless mu4e-headers-full-search mu4e-search-results-limit)))) + (unless mu4e-headers-full-search mu4e-search-results-limit) + mu4e-headers-skip-duplicates))) (defun mu4e~headers-redraw-get-view-window () "Close all windows, redraw the headers buffer based on the value