emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r100564: Synch with Gnus trunk.


From: Katsumi Yamaoka
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r100564: Synch with Gnus trunk.
Date: Thu, 10 Jun 2010 00:31:03 +0000
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 100564 [merge]
committer: Katsumi Yamaoka <address@hidden>
branch nick: trunk
timestamp: Thu 2010-06-10 00:31:03 +0000
message:
  Synch with Gnus trunk.
  2010-06-10  Dan Christensen  <address@hidden>
   * gnus-util.el (gnus-user-date): Use gnus-date-get-time.
   (gnus-dd-mmm): Use gnus-date-get-time.
   * gnus-sum.el (gnus-thread-latest-date): Use gnus-date-get-time and
   simplify logic.
   (gnus-summary-limit-to-age): Use gnus-date-get-time.
   (gnus-sort-threads): emit message if gnus-sort-threads-loop used.
modified:
  lisp/gnus/ChangeLog
  lisp/gnus/gnus-sum.el
  lisp/gnus/gnus-util.el
=== modified file 'lisp/gnus/ChangeLog'
--- a/lisp/gnus/ChangeLog       2010-06-08 13:05:11 +0000
+++ b/lisp/gnus/ChangeLog       2010-06-10 00:30:13 +0000
@@ -1,3 +1,12 @@
+2010-06-10  Dan Christensen  <address@hidden>
+
+       * gnus-util.el (gnus-user-date): Use gnus-date-get-time.
+       (gnus-dd-mmm): Use gnus-date-get-time.
+       * gnus-sum.el (gnus-thread-latest-date): Use gnus-date-get-time and
+       simplify logic.
+       (gnus-summary-limit-to-age): Use gnus-date-get-time.
+       (gnus-sort-threads): emit message if gnus-sort-threads-loop used.
+
 2010-06-08  Michael Albinus  <address@hidden>
 
        * auth-source.el (top): Autoload `secrets-list-collections',

=== modified file 'lisp/gnus/gnus-sum.el'
--- a/lisp/gnus/gnus-sum.el     2010-05-14 07:48:21 +0000
+++ b/lisp/gnus/gnus-sum.el     2010-06-10 00:30:13 +0000
@@ -4819,7 +4819,8 @@
          ;; Even after binding max-lisp-eval-depth, the recursive
          ;; sorter might fail for very long threads.  In that case,
          ;; try using a (less well-tested) non-recursive sorter.
-         (error (gnus-sort-threads-loop
+         (error (gnus-message 9 "Sorting threads with loop...")
+                (gnus-sort-threads-loop
                  threads (gnus-make-sort-function
                           gnus-thread-sort-functions))))
       (gnus-message 8 "Sorting threads...done"))))
@@ -4986,22 +4987,17 @@
   "Sort threads such that the thread with the most recently dated article 
comes first."
   (> (gnus-thread-latest-date h1) (gnus-thread-latest-date h2)))
 
+; Since this is called not only to sort the top-level threads, but
+; also in recursive sorts to order the articles within a thread, each
+; article will be processed many times.  Thus it speeds things up
+; quite a bit to use gnus-date-get-time, which caches the time value.
 (defun gnus-thread-latest-date (thread)
   "Return the highest article date in THREAD."
-  (let ((previous-time 0))
-    (apply 'max
-          (mapcar
-           (lambda (header)
-             (setq previous-time
-                   (condition-case ()
-                       (gnus-float-time (mail-header-parse-date
-                                         (mail-header-date header)))
-                     (error previous-time))))
-           (sort
-            (message-flatten-list thread)
-            (lambda (h1 h2)
-              (< (mail-header-number h1)
-                 (mail-header-number h2))))))))
+  (apply 'max
+        (mapcar (lambda (header) (gnus-float-time
+                                  (gnus-date-get-time
+                                   (mail-header-date header))))
+                (message-flatten-list thread))))
 
 (defun gnus-thread-total-score-1 (root)
   ;; This function find the total score of the thread below ROOT.
@@ -8236,9 +8232,7 @@
          (when (and (vectorp (gnus-data-header d))
                     (setq date (mail-header-date (gnus-data-header d))))
            (setq is-younger (time-less-p
-                             (time-since (condition-case ()
-                                             (date-to-time date)
-                                           (error '(0 0))))
+                             (time-since (gnus-date-get-time date))
                              cutoff))
            (when (if younger-p
                      is-younger

=== modified file 'lisp/gnus/gnus-util.el'
--- a/lisp/gnus/gnus-util.el    2010-04-27 06:40:58 +0000
+++ b/lisp/gnus/gnus-util.el    2010-06-10 00:30:13 +0000
@@ -455,10 +455,10 @@
 
 (defun gnus-user-date (messy-date)
   "Format the messy-date according to gnus-user-date-format-alist.
-Returns \"  ?  \" if there's bad input or if an other error occurs.
+Returns \"  ?  \" if there's bad input or if another error occurs.
 Input should look like this: \"Sun, 14 Oct 2001 13:34:39 +0200\"."
   (condition-case ()
-      (let* ((messy-date (gnus-float-time (safe-date-to-time messy-date)))
+      (let* ((messy-date (gnus-float-time (gnus-date-get-time messy-date)))
             (now (gnus-float-time))
             ;;If we don't find something suitable we'll use this one
             (my-format "%b %d '%y"))
@@ -477,7 +477,7 @@
 (defun gnus-dd-mmm (messy-date)
   "Return a string like DD-MMM from a big messy string."
   (condition-case ()
-      (format-time-string "%d-%b" (safe-date-to-time messy-date))
+      (format-time-string "%d-%b" (gnus-date-get-time messy-date))
     (error "  -   ")))
 
 (defmacro gnus-date-get-time (date)


reply via email to

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