comparison lisp/gnus/gnus-art.el @ 120:cca96a509cfe r20-1b12

Import from CVS: tag r20-1b12
author cvs
date Mon, 13 Aug 2007 09:25:29 +0200
parents 7d55a9ba150c
children d2f30a177268
comparison
equal deleted inserted replaced
119:d101af7320b8 120:cca96a509cfe
525 gnus-summary-mode-line-format-alist)) 525 gnus-summary-mode-line-format-alist))
526 526
527 (defvar gnus-number-of-articles-to-be-saved nil) 527 (defvar gnus-number-of-articles-to-be-saved nil)
528 528
529 (defvar gnus-inhibit-hiding nil) 529 (defvar gnus-inhibit-hiding nil)
530 (defvar gnus-newsgroup-name)
531 530
532 (defsubst gnus-article-hide-text (b e props) 531 (defsubst gnus-article-hide-text (b e props)
533 "Set text PROPS on the B to E region, extending `intangible' 1 past B." 532 "Set text PROPS on the B to E region, extending `intangible' 1 past B."
534 (add-text-properties b e props) 533 (add-text-properties b e props)
535 (when (memq 'intangible props) 534 (when (memq 'intangible props)
742 ;; Written by Per Abrahamsen <amanda@iesd.auc.dk>. 741 ;; Written by Per Abrahamsen <amanda@iesd.auc.dk>.
743 (defun article-treat-overstrike () 742 (defun article-treat-overstrike ()
744 "Translate overstrikes into bold text." 743 "Translate overstrikes into bold text."
745 (interactive) 744 (interactive)
746 (save-excursion 745 (save-excursion
746 (goto-char (point-min))
747 (re-search-forward "\n\n")
747 (let ((buffer-read-only nil)) 748 (let ((buffer-read-only nil))
748 (while (search-forward "\b" nil t) 749 (while (search-forward "\b" nil t)
749 (let ((next (following-char)) 750 (let ((next (following-char))
750 (previous (char-after (- (point) 2)))) 751 (previous (char-after (- (point) 2))))
751 ;; We do the boldification/underlining by hiding the 752 ;; We do the boldification/underlining by hiding the
1145 (gnus-article-show-hidden-text type) 1146 (gnus-article-show-hidden-text type)
1146 nil))))))) 1147 nil)))))))
1147 1148
1148 (defun gnus-article-hidden-text-p (type) 1149 (defun gnus-article-hidden-text-p (type)
1149 "Say whether the current buffer contains hidden text of type TYPE." 1150 "Say whether the current buffer contains hidden text of type TYPE."
1150 (let ((pos (text-property-any (point-min) (point-max) 'article-type type))) 1151 (let ((start (point-min))
1151 (when pos 1152 (pos (text-property-any (point-min) (point-max) 'article-type type)))
1152 (if (get-text-property pos 'invisible) 1153 (while (and pos
1153 'hidden 1154 (not (get-text-property pos 'invisible)))
1154 'shown)))) 1155 (setq pos
1156 (text-property-any (1+ pos) (point-max) 'article-type type)))
1157 (if pos
1158 'hidden
1159 'shown)))
1155 1160
1156 (defun gnus-article-show-hidden-text (type &optional hide) 1161 (defun gnus-article-show-hidden-text (type &optional hide)
1157 "Show all hidden text of type TYPE. 1162 "Show all hidden text of type TYPE.
1158 If HIDE, hide the text instead." 1163 If HIDE, hide the text instead."
1159 (save-excursion 1164 (save-excursion
1794 (unless (assq 'gnus-show-mime minor-mode-alist) 1799 (unless (assq 'gnus-show-mime minor-mode-alist)
1795 (push (list 'gnus-show-mime " MIME") minor-mode-alist)) 1800 (push (list 'gnus-show-mime " MIME") minor-mode-alist))
1796 (use-local-map gnus-article-mode-map) 1801 (use-local-map gnus-article-mode-map)
1797 (gnus-update-format-specifications nil 'article-mode) 1802 (gnus-update-format-specifications nil 'article-mode)
1798 (set (make-local-variable 'page-delimiter) gnus-page-delimiter) 1803 (set (make-local-variable 'page-delimiter) gnus-page-delimiter)
1804 (set (make-local-variable 'gnus-page-broken) nil)
1799 (set (make-local-variable 'gnus-button-marker-list) nil) 1805 (set (make-local-variable 'gnus-button-marker-list) nil)
1800 (gnus-set-default-directory) 1806 (gnus-set-default-directory)
1801 (buffer-disable-undo (current-buffer)) 1807 (buffer-disable-undo (current-buffer))
1802 (setq buffer-read-only t) 1808 (setq buffer-read-only t)
1803 (set-syntax-table gnus-article-mode-syntax-table) 1809 (set-syntax-table gnus-article-mode-syntax-table)
1968 (funcall gnus-decode-encoded-word-method))) 1974 (funcall gnus-decode-encoded-word-method)))
1969 ;; Perform the article display hooks. 1975 ;; Perform the article display hooks.
1970 (run-hooks 'gnus-article-display-hook)) 1976 (run-hooks 'gnus-article-display-hook))
1971 ;; Do page break. 1977 ;; Do page break.
1972 (goto-char (point-min)) 1978 (goto-char (point-min))
1973 (when gnus-break-pages 1979 (setq gnus-page-broken
1974 (gnus-narrow-to-page))) 1980 (when gnus-break-pages
1981 (gnus-narrow-to-page)
1982 t)))
1975 (gnus-set-mode-line 'article) 1983 (gnus-set-mode-line 'article)
1976 (gnus-configure-windows 'article) 1984 (gnus-configure-windows 'article)
1977 (goto-char (point-min)) 1985 (goto-char (point-min))
1978 t)))))) 1986 t))))))
1979 1987
2079 (if (save-excursion 2087 (if (save-excursion
2080 (end-of-line) 2088 (end-of-line)
2081 (and (pos-visible-in-window-p) ;Not continuation line. 2089 (and (pos-visible-in-window-p) ;Not continuation line.
2082 (eobp))) 2090 (eobp)))
2083 ;; Nothing in this page. 2091 ;; Nothing in this page.
2084 (if (or (not gnus-break-pages) 2092 (if (or (not gnus-page-broken)
2085 (save-excursion 2093 (save-excursion
2086 (save-restriction 2094 (save-restriction
2087 (widen) (forward-line 1) (eobp)))) ;Real end-of-buffer? 2095 (widen) (forward-line 1) (eobp)))) ;Real end-of-buffer?
2088 t ;Nothing more. 2096 t ;Nothing more.
2089 (gnus-narrow-to-page 1) ;Go to next page. 2097 (gnus-narrow-to-page 1) ;Go to next page.
2101 (defun gnus-article-prev-page (&optional lines) 2109 (defun gnus-article-prev-page (&optional lines)
2102 "Show previous page of current article. 2110 "Show previous page of current article.
2103 Argument LINES specifies lines to be scrolled down." 2111 Argument LINES specifies lines to be scrolled down."
2104 (interactive "p") 2112 (interactive "p")
2105 (move-to-window-line 0) 2113 (move-to-window-line 0)
2106 (if (and gnus-break-pages 2114 (if (and gnus-page-broken
2107 (bobp) 2115 (bobp)
2108 (not (save-restriction (widen) (bobp)))) ;Real beginning-of-buffer? 2116 (not (save-restriction (widen) (bobp)))) ;Real beginning-of-buffer?
2109 (progn 2117 (progn
2110 (gnus-narrow-to-page -1) ;Go to previous page. 2118 (gnus-narrow-to-page -1) ;Go to previous page.
2111 (goto-char (point-max)) 2119 (goto-char (point-max))