From 1af25b1aeba0b49aa3978a7ac236f76cb41ad73e Mon Sep 17 00:00:00 2001 From: yamaoka Date: Fri, 5 Jul 2002 09:35:47 +0000 Subject: [PATCH] * 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. * gnus.el: Remove autoload for `gnus-article-toggle-headers'. * gnus-art.el (article-toggle-headers): Abolished. And synch with Oort Gnus. --- ChangeLog | 13 ++++++++ lisp/ChangeLog | 3 ++ lisp/gnus-art.el | 88 +---------------------------------------------------- lisp/gnus-sum.el | 58 +++++++++++++++++++---------------- lisp/gnus.el | 3 +- texi/gnus-ja.texi | 8 ++--- texi/gnus.texi | 8 ++--- 7 files changed, 57 insertions(+), 124 deletions(-) diff --git a/ChangeLog b/ChangeLog index 712de7c..f15081f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2002-07-05 Katsumi Yamaoka + + * 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 * lisp/dgnushack.el (byte-optimize-form-code-walker): Don't modify diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 141c554..e58cbfa 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2002-07-05 Katsumi Yamaoka + * 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. diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index ddb9ea4..b93239d 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -1695,91 +1695,6 @@ always hide." (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.") @@ -3484,7 +3399,6 @@ If variable `gnus-use-long-file-name' is non-nil, it is article-verify-cancel-lock article-monafy article-hide-boring-headers - article-toggle-headers article-treat-overstrike article-fill-long-lines article-capitalize-sentences @@ -3594,7 +3508,7 @@ If variable `gnus-use-long-file-name' is non-nil, it is 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] diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index bbb81a6..ff45117 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -1598,7 +1598,7 @@ increase the score of each group you read." "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 @@ -1766,7 +1766,7 @@ increase the score of each group you read." "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 @@ -1777,7 +1777,7 @@ increase the score of each group you read." (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 @@ -1987,7 +1987,7 @@ increase the score of each group you read." (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] @@ -8428,35 +8428,39 @@ If ARG is a negative number, turn header display off." 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." diff --git a/lisp/gnus.el b/lisp/gnus.el index 0bad07b..8fd586d 100644 --- a/lisp/gnus.el +++ b/lisp/gnus.el @@ -2235,8 +2235,7 @@ gnus-newsrc-hashtb should be kept so that both hold the same information.") ;; 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) diff --git a/texi/gnus-ja.texi b/texi/gnus-ja.texi index 5a3290b..7c2104b 100644 --- a/texi/gnus-ja.texi +++ b/texi/gnus-ja.texi @@ -7734,8 +7734,8 @@ Fonts})$B!#F1$8%a%C%;!<%8$NCf$KJ#?t$N5-;v$+$i$N0zMQ$,$"$k$H!"(Bgnus $B$O$=$l$ @item W W h @kindex W W h ($B35N,(B) -@findex gnus-article-toggle-headers -$B%X%C%@!<$r1#$7$^$9(B (@code{gnus-article-toggle-headers})$B!#(B +@findex gnus-article-hide-headers +$B%X%C%@!<$r1#$7$^$9(B (@code{gnus-article-hide-headers})$B!#(B @xref{Hiding Headers}. @item W W b @@ -7931,9 +7931,9 @@ gnus $B$,5-;v$rI=<($9$k4{Dj$N$d$jJ}$rJQ$($?$$$H$-(B @item t @kindex W t ($B35N,(B) @kindex t ($B35N,(B) -@findex gnus-article-toggle-headers +@findex gnus-summary-toggle-header $B5-;v%P%C%U%!$K$9$Y$F$N%X%C%@!<$rI=<($9$k$+$I$&$+$r@Z$jBX$($^(B -$B$9(B (@code{gnus-article-toggle-headers})$B!#(B +$B$9(B (@code{gnus-summary-toggle-header})$B!#(B @item W v @kindex W v ($B35N,(B) diff --git a/texi/gnus.texi b/texi/gnus.texi index 1f5c11a..a566f9f 100644 --- a/texi/gnus.texi +++ b/texi/gnus.texi @@ -7866,8 +7866,8 @@ headers, PGP, cited text and the signature. @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 @@ -8072,9 +8072,9 @@ is rumored to have employed this form of, uh, somewhat weak encryption. @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) -- 1.7.10.4