Function: gnus-topic-sort-topic

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

Signature

(gnus-topic-sort-topic TOPIC FUNC REVERSE)

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-topic.el.gz
(defun gnus-topic-sort-topic (topic func reverse)
  ;; Each topic only lists the name of the group, while
  ;; the sort predicates expect group infos as inputs.
  ;; So we first transform the group names into infos,
  ;; then sort, and then transform back into group names.
  (setcdr
   topic
   (mapcar
    (lambda (info) (gnus-info-group info))
    (sort
     (mapcar
      (lambda (group) (gnus-get-info group))
      (cdr topic))
     func)))
  ;; Do the reversal, if necessary.
  (when reverse
    (setcdr topic (nreverse (cdr topic)))))