* gnus-group.el (gnus-group-sort-by-server): Use it.
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Sun, 14 Oct 2001 23:12:42 +0000 (23:12 +0000)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Sun, 14 Oct 2001 23:12:42 +0000 (23:12 +0000)
* gnus.el (gnus-method-to-full-server-name): New, bogus function.

* gnus-topic.el (gnus-topic-sort-groups-by-server): New command
and keystroke.

lisp/ChangeLog
lisp/gnus-group.el
lisp/gnus-topic.el
lisp/gnus.el

index a5648c3..8fe4ad3 100644 (file)
@@ -1,3 +1,12 @@
+2001-09-04 21:42:23  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * gnus-group.el (gnus-group-sort-by-server): Use it.
+
+       * gnus.el (gnus-method-to-full-server-name): New, bogus function.
+
+       * gnus-topic.el (gnus-topic-sort-groups-by-server): New command
+       and keystroke.
+
 2001-10-14  Simon Josefsson  <jas@extundo.com>
 
        * dig.el: Doc fix.
index 9775c4e..d1507b5 100644 (file)
@@ -2800,10 +2800,10 @@ sort in reverse order."
 
 (defun gnus-group-sort-by-server (info1 info2)
   "Sort alphabetically by server name."
-  (string< (gnus-method-to-server-name
+  (string< (gnus-method-to-full-server-name
            (gnus-find-method-for-group
             (gnus-info-group info1) info1))
-          (gnus-method-to-server-name
+          (gnus-method-to-full-server-name
            (gnus-find-method-for-group
             (gnus-info-group info2) info2))))
 
index 62c9179..07485dd 100644 (file)
@@ -1039,6 +1039,7 @@ articles in the topic and its subtopics."
     "a" gnus-topic-sort-groups-by-alphabet
     "u" gnus-topic-sort-groups-by-unread
     "l" gnus-topic-sort-groups-by-level
+    "e" gnus-topic-sort-groups-by-server
     "v" gnus-topic-sort-groups-by-score
     "r" gnus-topic-sort-groups-by-rank
     "m" gnus-topic-sort-groups-by-method))
@@ -1621,6 +1622,12 @@ If REVERSE, sort in reverse order."
   (interactive "P")
   (gnus-topic-sort-groups 'gnus-group-sort-by-method reverse))
 
+(defun gnus-topic-sort-groups-by-server (&optional reverse)
+  "Sort the current topic alphabetically by server name.
+If REVERSE, sort in reverse order."
+  (interactive "P")
+  (gnus-topic-sort-groups 'gnus-group-sort-by-server reverse))
+
 (defun gnus-topic-sort-topics-1 (top reverse)
   (if (cdr top)
       (let ((subtop
index ad0b9bc..a999e05 100644 (file)
@@ -2702,6 +2702,9 @@ that that variable is buffer-local to the summary buffers."
          (not (string= (nth 1 method) "")))
      (concat "+" (nth 1 method)))))
 
+(defsubst gnus-method-to-full-server-name (method)
+  (format "%s+%s" (car method) (nth 1 method)))
+
 (defun gnus-group-prefixed-name (group method)
   "Return the whole name from GROUP and METHOD."
   (and (stringp method) (setq method (gnus-server-to-method method)))