Function: gnus-summary-toggle-header

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

Signature

(gnus-summary-toggle-header &optional ARG)

Documentation

Show the headers if they are hidden, or hide them if they are shown.

If ARG is a positive number, show the entire header. If ARG is a negative number, hide the unwanted header lines.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-sum.el.gz
(defun gnus-summary-toggle-header (&optional arg)
  "Show the headers if they are hidden, or hide them if they are shown.
If ARG is a positive number, show the entire header.
If ARG is a negative number, hide the unwanted header lines."
  (interactive "P" gnus-summary-mode)
  (let ((window (and (gnus-buffer-live-p gnus-article-buffer)
		     (get-buffer-window gnus-article-buffer t))))
    (with-current-buffer gnus-article-buffer
      (widen)
      (article-narrow-to-head)
      (let* ((inhibit-read-only t)
	     (inhibit-point-motion-hooks t)
	     (hidden (if (numberp arg)
			 (>= arg 0)
		       (or
			;; The case where there's no visible header
			;; that matches `gnus-visible-headers'.
			(looking-at "\n?\\'")
			(gnus-article-hidden-text-p 'headers))))
	     s e)
	(delete-region (point-min) (point-max))
	(with-current-buffer gnus-original-article-buffer
	  (goto-char (setq s (point-min)))
	  (setq e (if (search-forward "\n\n" nil t)
		      (1- (point))
		    (point-max))))
	(insert-buffer-substring gnus-original-article-buffer s e)
	(run-hooks 'gnus-article-decode-hook)
	(if hidden
	    (let ((gnus-treat-hide-headers nil)
		  (gnus-treat-hide-boring-headers nil))
	      (gnus-delete-wash-type 'headers)
	      (gnus-treat-article 'head))
	  (gnus-treat-article 'head)
	  ;; Add attachment buttons to the header.
	  (when gnus-mime-display-attachment-buttons-in-header
	    (gnus-mime-buttonize-attachments-in-header)))
	(widen)
	(if window
	    (set-window-start window (goto-char (point-min))))
	(if gnus-break-pages
	    (gnus-narrow-to-page)
	  (when (gnus-visual-p 'page-marker)
	    (let ((inhibit-read-only t))
	      (gnus-remove-text-with-property 'gnus-prev)
	      (gnus-remove-text-with-property 'gnus-next))))
	(gnus-set-mode-line 'article)))))