Function: gnus-summary-hide-thread

gnus-summary-hide-thread is an interactive and byte-compiled function defined in gnus-sum.el.gz.

Signature

(gnus-summary-hide-thread)

Documentation

Hide thread subtrees.

Returns nil if no threads were there to be hidden.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-sum.el.gz
(defun gnus-summary-hide-thread ()
  "Hide thread subtrees.
Returns nil if no threads were there to be hidden."
  (interactive nil gnus-summary-mode)
  (beginning-of-line)
  (let ((start (point))
	(starteol (line-end-position))
	(article (gnus-summary-article-number)))
    ;; Go forward until either the buffer ends or the subthread ends.
    (when (and (not (eobp))
	       (or (zerop (gnus-summary-next-thread 1 t))
		   (goto-char (point-max))))
      (if (and (> (point) start)
	       ;; FIXME: this should actually search for a non-invisible \n.
	       (search-backward "\n" start t))
	  (progn
	    (when (> (point) starteol)
	      (remove-overlays starteol (point) 'invisible 'gnus-sum)
	      (let ((ol (make-overlay starteol (point) nil t nil)))
		(overlay-put ol 'invisible 'gnus-sum)
		(overlay-put ol 'evaporate t)))
	    (gnus-summary-goto-subject article)
	    ;; We moved backward past the start point (invisible thread?)
            (when (> start (point))
              (goto-char starteol)))
	(goto-char start)
	nil))))