Function: gnus-sort-threads

gnus-sort-threads is a byte-compiled function defined in gnus-sum.el.gz.

Signature

(gnus-sort-threads THREADS)

Documentation

Sort THREADS.

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-sum.el.gz
(defun gnus-sort-threads (threads)
  "Sort THREADS."
  (if (not gnus-thread-sort-functions)
      threads
    (gnus-message 8 "Sorting threads...")
    (prog1
	(condition-case nil
	    (let ((max-lisp-eval-depth (max max-lisp-eval-depth 5000))
		  (sort-func (gnus-make-sort-function gnus-thread-sort-functions)))
	      (gnus-sort-threads-recursive threads sort-func))
	  ;; 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-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"))))