From 8f33c061613de6db51125f79398ee9ab78293cad Mon Sep 17 00:00:00 2001 From: ShengHuo ZHU Date: Sun, 15 Sep 2002 15:40:06 +0000 Subject: [PATCH] * gnus-sum.el (gnus-summary-toggle-header): The article window may not exist. Toggle it anyway. --- lisp/ChangeLog | 5 ++++ lisp/gnus-sum.el | 60 ++++++++++++++++++++++++------------------------ 2 files changed, 35 insertions(+), 30 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2855146db..acfa10937 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2002-09-15 John Paul Wallington + + * gnus-sum.el (gnus-summary-toggle-header): The article window may + not exist. Toggle it anyway. + 2002-09-13 ShengHuo ZHU * gnus-msg.el (gnus-copy-article-buffer): Bind mail-header-separator. diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index fd9cc6935..8e009e565 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -8350,37 +8350,37 @@ If ARG is a negative number, hide the unwanted header lines." (interactive "P") (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 + (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))) + 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 + (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)) (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))) - 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 - (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)) - (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)))))) + (if window + (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." -- 2.25.1