with `gnus-summary-toggle-header'.
(gnus-summary-wash-map): Ditto.
(gnus-summary-wash-hide-map): Replace `gnus-article-toggle-headers' with
`gnus-article-hide-headers'.
(gnus-summary-article-menu): Ditto.
* gnus.el: Remove autoload for `gnus-article-toggle-headers'.
* gnus-art.el (article-toggle-headers): Abolished.
And synch with Oort Gnus.
+2002-07-05 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * lisp/gnus-sum.el (gnus-summary-mode-map): Replace
+ `gnus-article-toggle-headers' with `gnus-summary-toggle-header'.
+ (gnus-summary-wash-map): Ditto.
+ (gnus-summary-wash-hide-map): Replace
+ `gnus-article-toggle-headers' with `gnus-article-hide-headers'.
+ (gnus-summary-article-menu): Ditto.
+
+ * lisp/gnus.el: Remove autoload for `gnus-article-toggle-headers'.
+
+ * lisp/gnus-art.el (article-toggle-headers): Abolished.
+
2002-07-04 Katsumi Yamaoka <yamaoka@jpl.org>
* lisp/dgnushack.el (byte-optimize-form-code-walker): Don't modify
2002-07-05 Katsumi Yamaoka <yamaoka@jpl.org>
+ * gnus-sum.el (gnus-summary-toggle-header): Show headers anyway;
+ don't break a narrowed article.
+
* nntp.el (nntp-via-rlogin-command-switches): Doc fix.
(nntp-open-via-rlogin-and-telnet): Ditto.
(point-max)))
'boring-headers))))
-(defun article-toggle-headers (&optional arg)
- "Toggle hiding of headers. If given a negative prefix, always show;
-if given a positive prefix, always hide."
- (interactive (gnus-article-hidden-arg))
- (let ((force (when (numberp arg)
- (cond ((> arg 0) 'always-hide)
- ((< arg 0) 'always-show))))
- (window (get-buffer-window gnus-article-buffer))
- (header-end (point-min))
- header-start field-end field-start
- (inhibit-point-motion-hooks t)
- (inhibit-read-only t))
- (save-restriction
- (widen)
- (while (and (setq header-start
- (text-property-any header-end (point-max)
- 'article-treated-header t))
- (setq header-end
- (text-property-not-all header-start (point-max)
- 'article-treated-header t)))
- (setq field-end header-start)
- (cond
- (;; Hide exposed invisible fields.
- (and (not (eq 'always-show force))
- (setq field-start
- (text-property-any field-end header-end
- 'exposed-invisible-field t)))
- (while (and field-start
- (setq field-end (text-property-not-all
- field-start header-end
- 'exposed-invisible-field t)))
- (add-text-properties field-start field-end gnus-hidden-properties)
- (setq field-start (text-property-any field-end header-end
- 'exposed-invisible-field t)))
- (put-text-property header-start header-end
- 'exposed-invisible-field nil))
- (;; Expose invisible fields.
- (and (not (eq 'always-hide force))
- (setq field-start
- (text-property-any field-end header-end 'invisible t)))
- (while (and field-start
- (setq field-end (text-property-not-all
- field-start header-end
- 'invisible t)))
- ;; If the invisible text is not terminated with newline, we
- ;; won't expose it. Because it may be created by x-face-mule.
- ;; BTW, XEmacs sometimes fail in putting an invisible text
- ;; property with `gnus-article-hide-text' (really?). In that
- ;; case, the invisible text might be started from the middle of
- ;; a line, so we will expose the sort of thing.
- (when (or (not (or (eq header-start field-start)
- (eq ?\n (char-before field-start))))
- (eq ?\n (char-before field-end))
- ;; Expose a boundary line anyway.
- (string-equal
- "\nX-Boundary: "
- (buffer-substring (max (- field-end 13) header-start)
- field-end)))
- (remove-text-properties field-start field-end
- gnus-hidden-properties)
- (put-text-property field-start field-end
- 'exposed-invisible-field t))
- (setq field-start (text-property-any field-end header-end
- 'invisible t))))
- (;; Hide fields.
- (not (eq 'always-show force))
- (narrow-to-region header-start header-end)
- (article-hide-headers)
- ;; Re-display X-Face image under XEmacs.
- (when (and (featurep 'xemacs)
- (gnus-functionp gnus-article-x-face-command))
- (let ((func (cadr (assq 'gnus-treat-display-xface
- gnus-treatment-function-alist)))
- (condition 'head))
- (when (and (not gnus-inhibit-treatment)
- func
- (gnus-treat-predicate gnus-treat-display-xface))
- (funcall func)
- (put-text-property header-start header-end 'read-only nil))))
- (widen))
- ))
- (goto-char (point-min))
- (when window
- (set-window-start window (point-min))))))
-
(defvar gnus-article-normalized-header-length 40
"Length of normalized headers.")
article-verify-cancel-lock
article-monafy
article-hide-boring-headers
- article-toggle-headers
article-treat-overstrike
article-fill-long-lines
article-capitalize-sentences
gnus-article-treatment-menu gnus-article-mode-map ""
;; Fixme: this should use :active (and maybe :visible).
'("Treatment"
- ["Hide headers" gnus-article-toggle-headers t]
+ ["Hide headers" gnus-article-hide-headers t]
["Hide signature" gnus-article-hide-signature t]
["Hide citation" gnus-article-hide-citation t]
["Treat overstrike" gnus-article-treat-overstrike t]
"i" gnus-summary-news-other-window
"x" gnus-summary-limit-to-unread
"s" gnus-summary-isearch-article
- "t" gnus-article-toggle-headers
+ "t" gnus-summary-toggle-header
"g" gnus-summary-show-article
"l" gnus-summary-goto-last-article
"v" gnus-summary-preview-mime-message
"f" gnus-article-display-x-face
"l" gnus-summary-stop-page-breaking
"r" gnus-summary-caesar-message
- "t" gnus-article-toggle-headers
+ "t" gnus-summary-toggle-header
"g" gnus-treat-smiley
"v" gnus-summary-verbose-headers
"m" gnus-summary-toggle-mime
(gnus-define-keys (gnus-summary-wash-hide-map "W" gnus-summary-wash-map)
"a" gnus-article-hide
- "h" gnus-article-toggle-headers
+ "h" gnus-article-hide-headers
"b" gnus-article-hide-boring-headers
"s" gnus-article-hide-signature
"c" gnus-article-hide-citation
(let ((innards
`(("Hide"
["All" gnus-article-hide t]
- ["Headers" gnus-article-toggle-headers t]
+ ["Headers" gnus-article-hide-headers t]
["Signature" gnus-article-hide-signature t]
["Citation" gnus-article-hide-citation t]
["List identifiers" gnus-article-hide-list-identifiers t]
If ARG is a positive number, show the entire header.
If ARG is a negative number, hide the unwanted header lines."
(interactive "P")
- (save-excursion
- (set-buffer gnus-article-buffer)
- (save-restriction
- (let* ((buffer-read-only nil)
- (inhibit-point-motion-hooks t)
- hidden s e)
- (save-restriction
- (article-narrow-to-head)
- (setq e (point-max)
- hidden (if (numberp arg)
+ (let ((window (and (gnus-buffer-live-p gnus-article-buffer)
+ (get-buffer-window gnus-article-buffer t))))
+ (when window
+ (with-current-buffer gnus-article-buffer
+ (widen)
+ (article-narrow-to-head)
+ (let* ((buffer-read-only nil)
+ (inhibit-point-motion-hooks t)
+ (hidden (if (numberp arg)
(>= arg 0)
- (gnus-article-hidden-text-p 'headers))))
- (delete-region (point-min) e)
- (goto-char (point-min))
- (with-current-buffer gnus-original-article-buffer
- (goto-char (setq s (point-min)))
- (setq e (search-forward "\n\n" nil t)
- e (if e (1- e) (point-max))))
- (insert-buffer-substring gnus-original-article-buffer s e)
- (save-restriction
- (narrow-to-region (point-min) (point))
+ (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)
(article-decode-encoded-words)
- (if hidden
+ (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)))
- (gnus-set-mode-line 'article)))))
+ (gnus-treat-article 'head))
+ (widen)
+ (set-window-start window (goto-char (point-min)))
+ (setq gnus-page-broken
+ (when gnus-break-pages
+ (gnus-narrow-to-page)
+ t))
+ (gnus-set-mode-line 'article))))))
(defun gnus-summary-show-all-headers ()
"Make all header lines visible."
;; gnus-article-show-all
gnus-article-edit-mode gnus-article-edit-article
gnus-article-edit-done article-decode-encoded-words
- gnus-start-date-timer gnus-stop-date-timer
- gnus-article-toggle-headers)
+ gnus-start-date-timer gnus-stop-date-timer)
("gnus-int" gnus-request-type)
("gnus-start" gnus-newsrc-parse-options gnus-1 gnus-no-server-1
gnus-dribble-enter gnus-read-init-file gnus-dribble-touch)
@item W W h
@kindex W W h (\e$B35N,\e(B)
-@findex gnus-article-toggle-headers
-\e$B%X%C%@!<$r1#$7$^$9\e(B (@code{gnus-article-toggle-headers})\e$B!#\e(B
+@findex gnus-article-hide-headers
+\e$B%X%C%@!<$r1#$7$^$9\e(B (@code{gnus-article-hide-headers})\e$B!#\e(B
@xref{Hiding Headers}.
@item W W b
@item t
@kindex W t (\e$B35N,\e(B)
@kindex t (\e$B35N,\e(B)
-@findex gnus-article-toggle-headers
+@findex gnus-summary-toggle-header
\e$B5-;v%P%C%U%!$K$9$Y$F$N%X%C%@!<$rI=<($9$k$+$I$&$+$r@Z$jBX$($^\e(B
-\e$B$9\e(B (@code{gnus-article-toggle-headers})\e$B!#\e(B
+\e$B$9\e(B (@code{gnus-summary-toggle-header})\e$B!#\e(B
@item W v
@kindex W v (\e$B35N,\e(B)
@item W W h
@kindex W W h (Summary)
-@findex gnus-article-toggle-headers
-Toggle hiding of headers (@code{gnus-article-toggle-headers}). @xref{Hiding
+@findex gnus-article-hide-headers
+Hide headers (@code{gnus-article-hide-headers}). @xref{Hiding
Headers}.
@item W W b
@item t
@kindex W t (Summary)
@kindex t (Summary)
-@findex gnus-article-toggle-headers
+@findex gnus-summary-toggle-header
Toggle whether to display all headers in the article buffer
-(@code{gnus-article-toggle-headers}).
+(@code{gnus-summary-toggle-header}).
@item W v
@kindex W v (Summary)