+(defun gnus-group-transpose-groups (arg)
+ "Exchange current newsgroup and previous newsgroup.
+With argument ARG, takes previous newsgroup and moves it past ARG newsgroup."
+ (interactive "p")
+ ;; BUG: last newsgroup and the last but one cannot be transposed
+ ;; since gnus-group-search-forward does not move forward beyond the
+ ;; last. If we instead use forward-line, no problem, but I don't
+ ;; want to use it for later extension.
+ (while (> arg 0)
+ (gnus-group-search-forward t t)
+ (gnus-group-kill-group 1)
+ (gnus-group-search-forward nil t)
+ (gnus-group-yank-group)
+ (gnus-group-search-forward nil t)
+ (setq arg (1- arg))
+ ))
+
+(defun gnus-group-kill-region (begin end)
+ "Kill newsgroups in current region (excluding current point).
+The killed newsgroups can be yanked by using \\[gnus-group-yank-group]."
+ (interactive "r")
+ (let ((lines
+ ;; Exclude a line where current point is on.
+ (1-
+ ;; Count lines.
+ (save-excursion
+ (count-lines
+ (progn
+ (goto-char begin)
+ (beginning-of-line)
+ (point))
+ (progn
+ (goto-char end)
+ (end-of-line)
+ (point)))))))
+ (goto-char begin)
+ (beginning-of-line) ;Important when LINES < 1
+ (gnus-group-kill-group lines)))
+
+(defun gnus-group-kill-group (n)