Function: gnus-topic-yank-group
gnus-topic-yank-group is an interactive and byte-compiled function
defined in gnus-topic.el.gz.
Signature
(gnus-topic-yank-group &optional ARG)
Documentation
Yank the last topic.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/gnus/gnus-topic.el.gz
(defun gnus-topic-yank-group (&optional arg)
"Yank the last topic."
(interactive "p" gnus-topic-mode)
(if gnus-topic-killed-topics
(let* ((previous
(or (gnus-group-topic-name)
(gnus-topic-next-topic (gnus-current-topic))))
(data (pop gnus-topic-killed-topics))
(alist (cdr data))
(item (cdar data)))
(push alist gnus-topic-alist)
(gnus-topic-create-topic
(caar item) (gnus-topic-parent-topic previous) previous
item)
(gnus-topic-enter-dribble)
(gnus-topic-goto-topic (caar item)))
(let* ((prev (gnus-group-group-name))
(gnus-topic-inhibit-change-level t)
(gnus-group-indentation
(make-string
(* gnus-topic-indent-level
(or (save-excursion
(gnus-topic-goto-topic (gnus-current-topic))
(gnus-group-topic-level))
0))
? ))
yanked alist)
;; We first yank the groups the normal way...
(setq yanked (gnus-group-yank-group arg))
;; Then we enter the yanked groups into the topics they belong
;; to.
(setq alist (assoc (save-excursion
(forward-line -1)
(gnus-current-topic))
gnus-topic-alist))
(when (stringp yanked)
(setq yanked (list yanked)))
(if (not prev)
(nconc alist yanked)
(if (not (cdr alist))
(setcdr alist (nconc yanked (cdr alist)))
(while (cdr alist)
(when (equal (cadr alist) prev)
(setcdr alist (nconc yanked (cdr alist)))
(setq alist nil))
(setq alist (cdr alist))))))
(gnus-topic-update-topic)))