*** pub/pgnus/lisp/gnus-art.el Fri Nov 20 05:25:06 1998 --- pgnus/lisp/gnus-art.el Sat Nov 21 09:51:15 1998 *************** *** 865,872 **** FROM is a string of characters to translate from; to is a string of characters to translate to." (save-excursion ! (goto-char (point-min)) ! (when (search-forward "\n\n" nil t) (let ((buffer-read-only nil) (x (make-string 225 ?x)) (i -1)) --- 865,871 ---- FROM is a string of characters to translate from; to is a string of characters to translate to." (save-excursion ! (when (article-goto-body) (let ((buffer-read-only nil) (x (make-string 225 ?x)) (i -1)) *************** *** 882,889 **** "Translate all string in the body of the article according to MAP. MAP is an alist where the elements are on the form (\"from\" \"to\")." (save-excursion ! (goto-char (point-min)) ! (when (search-forward "\n\n" nil t) (let ((buffer-read-only nil) elem) (while (setq elem (pop map)) --- 881,887 ---- "Translate all string in the body of the article according to MAP. MAP is an alist where the elements are on the form (\"from\" \"to\")." (save-excursion ! (when (article-goto-body) (let ((buffer-read-only nil) elem) (while (setq elem (pop map)) *************** *** 895,902 **** "Translate overstrikes into bold text." (interactive) (save-excursion ! (goto-char (point-min)) ! (when (search-forward "\n\n" nil t) (let ((buffer-read-only nil)) (while (search-forward "\b" nil t) (let ((next (char-after)) --- 893,899 ---- "Translate overstrikes into bold text." (interactive) (save-excursion ! (when (article-goto-body) (let ((buffer-read-only nil)) (while (search-forward "\b" nil t) (let ((next (char-after)) *************** *** 924,931 **** (save-excursion (let ((buffer-read-only nil)) (widen) ! (goto-char (point-min)) ! (search-forward "\n\n" nil t) (end-of-line 1) (let ((paragraph-start "^[>|#:<;* ]*[ \t]*$") (adaptive-fill-regexp "[ \t]*\\([|#:<;>*]+ *\\)?") --- 921,927 ---- (save-excursion (let ((buffer-read-only nil)) (widen) ! (article-goto-body) (end-of-line 1) (let ((paragraph-start "^[>|#:<;* ]*[ \t]*$") (adaptive-fill-regexp "[ \t]*\\([|#:<;>*]+ *\\)?") *************** *** 1021,1027 **** (save-excursion (set-buffer gnus-article-buffer) (let ((inhibit-point-motion-hooks t) ! buffer-read-only) (mail-decode-encoded-word-region (point-min) (point-max))))) (defun article-decode-charset (&optional prompt) --- 1017,1025 ---- (save-excursion (set-buffer gnus-article-buffer) (let ((inhibit-point-motion-hooks t) ! buffer-read-only ! (rfc2047-default-charset gnus-newsgroup-coding-system) ! (mm-charset-iso-8859-1-forced gnus-newsgroup-iso-8859-1-forced)) (mail-decode-encoded-word-region (point-min) (point-max))))) (defun article-decode-charset (&optional prompt) *************** *** 1043,1051 **** (mm-read-coding-system "Charset to decode: ")) (ctl (mail-content-type-get ctl 'charset)) ! (gnus-newsgroup-name ! (gnus-group-find-parameter ! gnus-newsgroup-name 'charset)))) buffer-read-only) (goto-char (point-max)) (widen) --- 1041,1049 ---- (mm-read-coding-system "Charset to decode: ")) (ctl (mail-content-type-get ctl 'charset)) ! (t ! gnus-newsgroup-coding-system))) ! (mm-charset-iso-8859-1-forced gnus-newsgroup-iso-8859-1-forced) buffer-read-only) (goto-char (point-max)) (widen) *************** *** 1061,1067 **** (defun article-decode-encoded-words () "Remove encoded-word encoding from headers." (let ((inhibit-point-motion-hooks t) ! (buffer-read-only nil)) (save-restriction (message-narrow-to-head) (funcall gnus-decode-header-function (point-min) (point-max))))) --- 1059,1067 ---- (defun article-decode-encoded-words () "Remove encoded-word encoding from headers." (let ((inhibit-point-motion-hooks t) ! buffer-read-only ! (rfc2047-default-charset gnus-newsgroup-coding-system) ! (mm-charset-iso-8859-1-forced gnus-newsgroup-iso-8859-1-forced)) (save-restriction (message-narrow-to-head) (funcall gnus-decode-header-function (point-min) (point-max))))) *************** *** 1073,1088 **** (interactive (list 'force)) (save-excursion (let ((buffer-read-only nil) ! (type (gnus-fetch-field "content-transfer-encoding"))) (when (or force (and type (string-match "quoted-printable" (downcase type)))) ! (goto-char (point-min)) ! (search-forward "\n\n" nil 'move) (save-restriction (narrow-to-region (point) (point-max)) (quoted-printable-decode-region (point-min) (point-max)) ! (when mm-default-coding-system ! (mm-decode-body mm-default-coding-system))))))) (defun article-hide-pgp (&optional arg) "Toggle hiding of any PGP headers and signatures in the current article. --- 1073,1090 ---- (interactive (list 'force)) (save-excursion (let ((buffer-read-only nil) ! (type (gnus-fetch-field "content-transfer-encoding")) ! (charset ! (or gnus-newsgroup-coding-system mm-default-coding-system)) ! (mm-charset-iso-8859-1-forced gnus-newsgroup-iso-8859-1-forced)) (when (or force (and type (string-match "quoted-printable" (downcase type)))) ! (article-goto-body) (save-restriction (narrow-to-region (point) (point-max)) (quoted-printable-decode-region (point-min) (point-max)) ! (when charset ! (mm-decode-body charset))))))) (defun article-hide-pgp (&optional arg) "Toggle hiding of any PGP headers and signatures in the current article. *************** *** 1169,1180 **** (save-excursion (let ((inhibit-point-motion-hooks t) buffer-read-only) ! (goto-char (point-min)) ! (when (search-forward "\n\n" nil t) (while (and (not (eobp)) (looking-at "[ \t]*$")) (gnus-delete-line)))))) (defun article-strip-multiple-blank-lines () "Replace consecutive blank lines with one empty line." (interactive) --- 1171,1189 ---- (save-excursion (let ((inhibit-point-motion-hooks t) buffer-read-only) ! (when (article-goto-body) (while (and (not (eobp)) (looking-at "[ \t]*$")) (gnus-delete-line)))))) + (defun article-goto-body () + "Place point at the start of the body." + (goto-char (point-min)) + (if (search-forward "\n\n" nil t) + t + (goto-char (point-max)) + nil)) + (defun article-strip-multiple-blank-lines () "Replace consecutive blank lines with one empty line." (interactive) *************** *** 1182,1196 **** (let ((inhibit-point-motion-hooks t) buffer-read-only) ;; First make all blank lines empty. ! (goto-char (point-min)) ! (search-forward "\n\n" nil t) (while (re-search-forward "^[ \t]+$" nil t) (unless (gnus-annotation-in-region-p (match-beginning 0) (match-end 0)) (replace-match "" nil t))) ;; Then replace multiple empty lines with a single empty line. ! (goto-char (point-min)) ! (search-forward "\n\n" nil t) (while (re-search-forward "\n\n\n+" nil t) (unless (gnus-annotation-in-region-p (match-beginning 0) (match-end 0)) --- 1191,1203 ---- (let ((inhibit-point-motion-hooks t) buffer-read-only) ;; First make all blank lines empty. ! (article-goto-body) (while (re-search-forward "^[ \t]+$" nil t) (unless (gnus-annotation-in-region-p (match-beginning 0) (match-end 0)) (replace-match "" nil t))) ;; Then replace multiple empty lines with a single empty line. ! (article-goto-body) (while (re-search-forward "\n\n\n+" nil t) (unless (gnus-annotation-in-region-p (match-beginning 0) (match-end 0)) *************** *** 1202,1209 **** (save-excursion (let ((inhibit-point-motion-hooks t) buffer-read-only) ! (goto-char (point-min)) ! (search-forward "\n\n" nil t) (while (re-search-forward "^[ \t]+" nil t) (replace-match "" t t))))) --- 1209,1215 ---- (save-excursion (let ((inhibit-point-motion-hooks t) buffer-read-only) ! (article-goto-body) (while (re-search-forward "^[ \t]+" nil t) (replace-match "" t t))))) *************** *** 1220,1227 **** (save-excursion (let ((inhibit-point-motion-hooks t) buffer-read-only) ! (goto-char (point-min)) ! (search-forward "\n\n" nil t) (while (re-search-forward "^[ \t]*\n" nil t) (replace-match "" t t))))) --- 1226,1232 ---- (save-excursion (let ((inhibit-point-motion-hooks t) buffer-read-only) ! (article-goto-body) (while (re-search-forward "^[ \t]*\n" nil t) (replace-match "" t t))))) *************** *** 1571,1578 **** (props (append '(article-type emphasis) gnus-hidden-properties)) regexp elem beg invisible visible face) ! (goto-char (point-min)) ! (search-forward "\n\n" nil t) (setq beg (point)) (while (setq elem (pop alist)) (goto-char beg) --- 1576,1582 ---- (props (append '(article-type emphasis) gnus-hidden-properties)) regexp elem beg invisible visible face) ! (article-goto-body) (setq beg (point)) (while (setq elem (pop alist)) (goto-char beg) *************** *** 1783,1790 **** (save-excursion (save-restriction (widen) ! (goto-char (point-min)) ! (when (search-forward "\n\n" nil t) (narrow-to-region (point) (point-max))) (gnus-output-to-file filename)))) filename) --- 1787,1793 ---- (save-excursion (save-restriction (widen) ! (when (article-goto-body) (narrow-to-region (point) (point-max))) (gnus-output-to-file filename)))) filename) *************** *** 2186,2193 **** t))) (gnus-set-mode-line 'article) (gnus-configure-windows 'article) ! (goto-char (point-min)) ! (search-forward "\n\n" nil t) (set-window-point (get-buffer-window (current-buffer)) (point)) t)))))) --- 2189,2195 ---- t))) (gnus-set-mode-line 'article) (gnus-configure-windows 'article) ! (article-goto-body) (set-window-point (get-buffer-window (current-buffer)) (point)) t)))))) *************** *** 2268,2274 **** "View all the MIME parts." (interactive) (gnus-article-check-buffer) ! (let ((handles gnus-article-mime-handles)) (while handles (mm-display-part (pop handles))))) --- 2270,2278 ---- "View all the MIME parts." (interactive) (gnus-article-check-buffer) ! (let ((handles gnus-article-mime-handles) ! (rfc2047-default-charset gnus-newsgroup-coding-system) ! (mm-charset-iso-8859-1-forced gnus-newsgroup-iso-8859-1-forced)) (while handles (mm-display-part (pop handles))))) *************** *** 2312,2320 **** (normal-mode) (goto-char (point-min)))) ! (defun gnus-mime-inline-part () "Insert the MIME part under point into the current buffer." ! (interactive) (gnus-article-check-buffer) (let* ((data (get-text-property (point) 'gnus-data)) (contents (mm-get-part data)) --- 2316,2324 ---- (normal-mode) (goto-char (point-min)))) ! (defun gnus-mime-inline-part (&optional charset) "Insert the MIME part under point into the current buffer." ! (interactive "P") ; For compatible reason, not using "z". (gnus-article-check-buffer) (let* ((data (get-text-property (point) 'gnus-data)) (contents (mm-get-part data)) *************** *** 2324,2329 **** --- 2328,2337 ---- (if (mm-handle-undisplayer data) (mm-remove-part data) (forward-line 2) + (when charset + (unless (symbolp charset) + (setq charset (mm-read-coding-system "Charset: "))) + (setq contents (mm-decode-coding-string contents charset))) (mm-insert-inline data contents) (goto-char b)))) *************** *** 2333,2339 **** (gnus-article-check-buffer) (let* ((handle (get-text-property (point) 'gnus-data)) (url-standalone-mode (not gnus-plugged)) ! (mm-user-display-methods nil)) (if (mm-handle-undisplayer handle) (mm-remove-part handle) (mm-display-part handle)))) --- 2341,2349 ---- (gnus-article-check-buffer) (let* ((handle (get-text-property (point) 'gnus-data)) (url-standalone-mode (not gnus-plugged)) ! (mm-user-display-methods nil) ! (rfc2047-default-charset gnus-newsgroup-coding-system) ! (mm-charset-iso-8859-1-forced gnus-newsgroup-iso-8859-1-forced)) (if (mm-handle-undisplayer handle) (mm-remove-part handle) (mm-display-part handle)))) *************** *** 2361,2367 **** (gnus-insert-mime-button handle id (list (not (mm-handle-displayed-p handle)))) (prog1 ! (let ((window (selected-window))) (save-excursion (unwind-protect (let ((win (get-buffer-window (current-buffer) t))) --- 2371,2379 ---- (gnus-insert-mime-button handle id (list (not (mm-handle-displayed-p handle)))) (prog1 ! (let ((window (selected-window)) ! (rfc2047-default-charset gnus-newsgroup-coding-system) ! (mm-charset-iso-8859-1-forced gnus-newsgroup-iso-8859-1-forced)) (save-excursion (unwind-protect (let ((win (get-buffer-window (current-buffer) t))) *************** *** 2436,2443 **** (cdr handles))) (unless ihandles ;; Clean up for mime parts. ! (goto-char (point-min)) ! (search-forward "\n\n" nil t) (delete-region (point) (point-max))) (if (stringp (car handles)) (if (equal (car handles) "multipart/alternative") --- 2448,2454 ---- (cdr handles))) (unless ihandles ;; Clean up for mime parts. ! (article-goto-body) (delete-region (point) (point-max))) (if (stringp (car handles)) (if (equal (car handles) "multipart/alternative") *************** *** 2491,2563 **** (while types (when (string-match (pop types) type) (throw 'found t))))))) (gnus-insert-mime-button handle id (list (or display ! (and (not not-attachment) text)))))) ! (insert "\n\n") (cond (display (forward-line -2) ! (mm-display-part handle t) (goto-char (point-max))) ((and text not-attachment) (forward-line -2) ! (insert "\n") (mm-insert-inline handle (mm-get-part handle)) (goto-char (point-max)))))))) (defun gnus-mime-display-alternative (handles &optional preferred ibegend id) (let* ((preferred (or preferred (mm-preferred-alternative handles))) (ihandles handles) (point (point)) handle buffer-read-only from props begend not-pref) ! (save-restriction ! (when ibegend ! (narrow-to-region (car ibegend) (cdr ibegend)) ! (delete-region (point-min) (point-max)) ! (mm-remove-parts handles)) ! (setq begend (list (point-marker))) ! ;; Do the toggle. ! (unless (setq not-pref (cadr (member preferred ihandles))) ! (setq not-pref (car ihandles))) ! (gnus-add-text-properties ! (setq from (point)) ! (progn ! (insert (format "%d. " id)) ! (point)) ! `(gnus-callback ! (lambda (handles) ! (unless ,(not ibegend) ! (setq gnus-article-mime-handle-alist ! ',gnus-article-mime-handle-alist)) ! (gnus-mime-display-alternative ! ',ihandles ',not-pref ',begend ,id)) ! local-map ,gnus-mime-button-map ! ,gnus-mouse-face-prop ,gnus-article-mouse-face ! face ,gnus-article-button-face ! keymap ,gnus-mime-button-map ! gnus-part ,id ! gnus-data ,handle)) ! (widget-convert-button 'link from (point) ! :action 'gnus-widget-press-button ! :button-keymap gnus-widget-button-keymap) ! ;; Do the handles ! (while (setq handle (pop handles)) (gnus-add-text-properties (setq from (point)) (progn ! (insert (format "[%c] %-18s" ! (if (equal handle preferred) ?* ? ) ! (if (stringp (car handle)) ! (car handle) ! (car (mm-handle-type handle))))) (point)) `(gnus-callback (lambda (handles) (unless ,(not ibegend) (setq gnus-article-mime-handle-alist ',gnus-article-mime-handle-alist)) ! (gnus-mime-display-alternative ',ihandles ',handle ',begend ,id)) local-map ,gnus-mime-button-map ,gnus-mouse-face-prop ,gnus-article-mouse-face face ,gnus-article-button-face --- 2502,2559 ---- (while types (when (string-match (pop types) type) (throw 'found t))))))) + (gnus-article-insert-newline) (gnus-insert-mime-button handle id (list (or display ! (and (not not-attachment) text)))) ! (gnus-article-insert-newline))) ! (gnus-article-insert-newline) (cond (display (forward-line -2) ! (let ((rfc2047-default-charset gnus-newsgroup-coding-system) ! (mm-charset-iso-8859-1-forced ! gnus-newsgroup-iso-8859-1-forced)) ! (mm-display-part handle t)) (goto-char (point-max))) ((and text not-attachment) (forward-line -2) ! (gnus-article-insert-newline) (mm-insert-inline handle (mm-get-part handle)) (goto-char (point-max)))))))) + (defun gnus-article-insert-newline () + "Insert a newline, but mark it as undeletable." + (gnus-put-text-property + (point) (progn (insert "\n") (point)) 'gnus-undeletable t)) + (defun gnus-mime-display-alternative (handles &optional preferred ibegend id) (let* ((preferred (or preferred (mm-preferred-alternative handles))) (ihandles handles) (point (point)) handle buffer-read-only from props begend not-pref) ! (save-window-excursion ! (save-restriction ! (when ibegend ! (narrow-to-region (car ibegend) (cdr ibegend)) ! (delete-region (point-min) (point-max)) ! (mm-remove-parts handles)) ! (setq begend (list (point-marker))) ! ;; Do the toggle. ! (unless (setq not-pref (cadr (member preferred ihandles))) ! (setq not-pref (car ihandles))) (gnus-add-text-properties (setq from (point)) (progn ! (insert (format "%d. " id)) (point)) `(gnus-callback (lambda (handles) (unless ,(not ibegend) (setq gnus-article-mime-handle-alist ',gnus-article-mime-handle-alist)) ! (gnus-mime-display-alternative ! ',ihandles ',not-pref ',begend ,id)) local-map ,gnus-mime-button-map ,gnus-mouse-face-prop ,gnus-article-mouse-face face ,gnus-article-button-face *************** *** 2567,2580 **** (widget-convert-button 'link from (point) :action 'gnus-widget-press-button :button-keymap gnus-widget-button-keymap) ! (insert " ")) ! (insert "\n\n") ! (when preferred ! (if (stringp (car preferred)) ! (gnus-display-mime preferred) ! (mm-display-part preferred) ! (goto-char (point-max))) ! (setcdr begend (point-marker)))) (when ibegend (goto-char point)))) --- 2563,2606 ---- (widget-convert-button 'link from (point) :action 'gnus-widget-press-button :button-keymap gnus-widget-button-keymap) ! ;; Do the handles ! (while (setq handle (pop handles)) ! (gnus-add-text-properties ! (setq from (point)) ! (progn ! (insert (format "[%c] %-18s" ! (if (equal handle preferred) ?* ? ) ! (if (stringp (car handle)) ! (car handle) ! (car (mm-handle-type handle))))) ! (point)) ! `(gnus-callback ! (lambda (handles) ! (unless ,(not ibegend) ! (setq gnus-article-mime-handle-alist ! ',gnus-article-mime-handle-alist)) ! (gnus-mime-display-alternative ! ',ihandles ',handle ',begend ,id)) ! local-map ,gnus-mime-button-map ! ,gnus-mouse-face-prop ,gnus-article-mouse-face ! face ,gnus-article-button-face ! keymap ,gnus-mime-button-map ! gnus-part ,id ! gnus-data ,handle)) ! (widget-convert-button 'link from (point) ! :action 'gnus-widget-press-button ! :button-keymap gnus-widget-button-keymap) ! (insert " ")) ! (insert "\n\n") ! (when preferred ! (if (stringp (car preferred)) ! (gnus-display-mime preferred) ! (let ((rfc2047-default-charset gnus-newsgroup-coding-system) ! (mm-charset-iso-8859-1-forced ! gnus-newsgroup-iso-8859-1-forced)) ! (mm-display-part preferred))) ! (goto-char (point-max)) ! (setcdr begend (point-marker))))) (when ibegend (goto-char point)))) *************** *** 3092,3099 **** (save-excursion (save-restriction (widen) ! (goto-char (point-min)) ! (when (search-forward "\n\n" nil 1) (let ((lines (count-lines (point) (point-max))) (length (- (point-max) (point))) (case-fold-search t) --- 3118,3124 ---- (save-excursion (save-restriction (widen) ! (when (article-goto-body) (let ((lines (count-lines (point) (point-max))) (length (- (point-max) (point))) (case-fold-search t) *************** *** 3386,3394 **** 'gnus-callback nil)) (set-marker marker nil))) ;; We skip the headers. ! (goto-char (point-min)) ! (unless (search-forward "\n\n" nil t) ! (goto-char (point-max))) (setq beg (point)) (while (setq entry (pop alist)) (setq regexp (car entry)) --- 3411,3417 ---- 'gnus-callback nil)) (set-marker marker nil))) ;; We skip the headers. ! (article-goto-body) (setq beg (point)) (while (setq entry (pop alist)) (setq regexp (car entry)) *** pub/pgnus/lisp/gnus-cus.el Thu Nov 19 04:44:22 1998 --- pgnus/lisp/gnus-cus.el Sat Nov 21 09:51:15 1998 *************** *** 164,169 **** --- 164,173 ---- (charset (string :tag "Charset") "\ The default charset to use in the group.") + + (iso-8859-1-forced (const :tag "Force ISO 8859-1 to default charset" + t)"\ + Force ISO 8859-1 to default charset in the group.") ) "Alist of valid group parameters. *** pub/pgnus/lisp/gnus-sum.el Fri Nov 20 05:25:07 1998 --- pgnus/lisp/gnus-sum.el Sat Nov 21 09:51:16 1998 *************** *** 797,802 **** --- 797,818 ---- :group 'gnus-summary :type 'regexp) + (defcustom gnus-newsgroup-coding-system-alist + '(("^hk\\>\\|^tw\\>\\|\\" . cn-big5) + ("^cn\\>\\|\\" . cn-gb-2312) + ("^fj\\>" . iso-2022-jp-2) + ("^relcom\\>" . koi8-r)) + "Alist of Regexps (to match group names) and CODING-SYSTEMs to be applied." + :type '(repeat (cons (regexp :tag "Group") + (symbol :tag "Charset"))) + :group 'gnus) + + (defcustom gnus-newsgroup-iso-8859-1-forced-regexp + "^tw\\>\\|^hk\\>\\|^cn\\>\\|\\" + "Regexp of newsgroup in which ISO-8859-1 is forced to other charset." + :type 'regexp + :group 'gnus) + ;;; Internal variables (defvar gnus-article-mime-handles nil) *************** *** 985,990 **** --- 1001,1009 ---- (defvar gnus-last-article nil) (defvar gnus-newsgroup-history nil) + (defvar gnus-newsgroup-coding-system nil) + (defvar gnus-newsgroup-iso-8859-1-forced nil) + (defconst gnus-summary-local-variables '(gnus-newsgroup-name gnus-newsgroup-begin gnus-newsgroup-end *************** *** 1015,1021 **** (gnus-newsgroup-expunged-tally . 0) gnus-cache-removable-articles gnus-newsgroup-cached gnus-newsgroup-data gnus-newsgroup-data-reverse ! gnus-newsgroup-limit gnus-newsgroup-limits) "Variables that are buffer-local to the summary buffers.") ;; Byte-compiler warning. --- 1034,1041 ---- (gnus-newsgroup-expunged-tally . 0) gnus-cache-removable-articles gnus-newsgroup-cached gnus-newsgroup-data gnus-newsgroup-data-reverse ! gnus-newsgroup-limit gnus-newsgroup-limits ! gnus-newsgroup-coding-system gnus-newsgroup-iso-8859-1-forced) "Variables that are buffer-local to the summary buffers.") ;; Byte-compiler warning. *************** *** 1510,1516 **** "h" gnus-summary-save-article-folder "v" gnus-summary-save-article-vm "p" gnus-summary-pipe-output ! "s" gnus-soup-add-article)) (defun gnus-summary-make-menu-bar () (gnus-turn-off-edit-menu 'summary) --- 1530,1540 ---- "h" gnus-summary-save-article-folder "v" gnus-summary-save-article-vm "p" gnus-summary-pipe-output ! "s" gnus-soup-add-article) ! ! (gnus-define-keys (gnus-summary-mime-map "K" gnus-summary-mode-map) ! "b" gnus-summary-display-buttonized) ! ) (defun gnus-summary-make-menu-bar () (gnus-turn-off-edit-menu 'summary) *************** *** 2374,2380 **** (original gnus-original-article-buffer) (gac gnus-article-current) (reffed gnus-reffed-article-number) ! (score-file gnus-current-score-file)) (save-excursion (set-buffer gnus-group-buffer) (setq gnus-newsgroup-name name --- 2398,2406 ---- (original gnus-original-article-buffer) (gac gnus-article-current) (reffed gnus-reffed-article-number) ! (score-file gnus-current-score-file) ! (coding-system gnus-newsgroup-coding-system) ! (iso-8859-1-forced gnus-newsgroup-iso-8859-1-forced)) (save-excursion (set-buffer gnus-group-buffer) (setq gnus-newsgroup-name name *************** *** 2387,2393 **** gnus-article-buffer article-buffer gnus-original-article-buffer original gnus-reffed-article-number reffed ! gnus-current-score-file score-file) ;; The article buffer also has local variables. (when (gnus-buffer-live-p gnus-article-buffer) (set-buffer gnus-article-buffer) --- 2413,2421 ---- gnus-article-buffer article-buffer gnus-original-article-buffer original gnus-reffed-article-number reffed ! gnus-current-score-file score-file ! gnus-newsgroup-coding-system coding-system ! gnus-newsgroup-iso-8859-1-forced iso-8859-1-forced) ;; The article buffer also has local variables. (when (gnus-buffer-live-p gnus-article-buffer) (set-buffer gnus-article-buffer) *************** *** 2462,2468 **** (defun gnus-summary-from-or-to-or-newsgroups (header) (let ((to (cdr (assq 'To (mail-header-extra header)))) ! (newsgroups (cdr (assq 'Newsgroups (mail-header-extra header))))) (cond ((and to gnus-ignored-from-addresses --- 2490,2498 ---- (defun gnus-summary-from-or-to-or-newsgroups (header) (let ((to (cdr (assq 'To (mail-header-extra header)))) ! (newsgroups (cdr (assq 'Newsgroups (mail-header-extra header)))) ! (rfc2047-default-charset gnus-newsgroup-coding-system) ! (mm-charset-iso-8859-1-forced gnus-newsgroup-iso-8859-1-forced)) (cond ((and to gnus-ignored-from-addresses *************** *** 3981,3986 **** --- 4011,4017 ---- (setq gnus-newsgroup-name group) (setq gnus-newsgroup-unselected nil) (setq gnus-newsgroup-unreads (gnus-list-of-unread-articles group)) + (gnus-newsgroup-setup-coding-system) ;; Adjust and set lists of article marks. (when info *************** *** 4491,4497 **** (or dependencies (save-excursion (set-buffer gnus-summary-buffer) gnus-newsgroup-dependencies))) ! headers id end ref) (save-excursion (set-buffer nntp-server-buffer) ;; Translate all TAB characters into SPACE characters. --- 4522,4530 ---- (or dependencies (save-excursion (set-buffer gnus-summary-buffer) gnus-newsgroup-dependencies))) ! headers id end ref ! (rfc2047-default-charset gnus-newsgroup-coding-system) ! (mm-charset-iso-8859-1-forced gnus-newsgroup-iso-8859-1-forced)) (save-excursion (set-buffer nntp-server-buffer) ;; Translate all TAB characters into SPACE characters. *************** *** 4644,4650 **** ;; Get the Xref when the users reads the articles since most/some ;; NNTP servers do not include Xrefs when using XOVER. (setq gnus-article-internal-prepare-hook '(gnus-article-get-xrefs)) ! (let ((cur nntp-server-buffer) (dependencies (or dependencies gnus-newsgroup-dependencies)) number headers header) (save-excursion --- 4677,4685 ---- ;; Get the Xref when the users reads the articles since most/some ;; NNTP servers do not include Xrefs when using XOVER. (setq gnus-article-internal-prepare-hook '(gnus-article-get-xrefs)) ! (let ((rfc2047-default-charset gnus-newsgroup-coding-system) ! (mm-charset-iso-8859-1-forced gnus-newsgroup-iso-8859-1-forced) ! (cur nntp-server-buffer) (dependencies (or dependencies gnus-newsgroup-dependencies)) number headers header) (save-excursion *************** *** 9110,9115 **** --- 9145,9192 ---- (gnus-summary-exit)) buffers))))) + (defun gnus-newsgroup-setup-coding-system () + "Setup newsgroup default coding system." + (setq gnus-newsgroup-coding-system + (or (and gnus-newsgroup-name + (or (gnus-group-find-parameter + gnus-newsgroup-name 'charset) + (let ((alist gnus-newsgroup-coding-system-alist) + elem (charset nil)) + (while alist + (if (string-match + (car (setq elem (pop alist))) + gnus-newsgroup-name) + (setq alist nil + charset (cdr elem)))) + charset))) + rfc2047-default-charset)) + (setq gnus-newsgroup-iso-8859-1-forced + (and gnus-newsgroup-name + (or (gnus-group-find-parameter + gnus-newsgroup-name 'iso-8859-1-forced) + (string-match gnus-newsgroup-iso-8859-1-forced-regexp + gnus-newsgroup-name)))) + (if (stringp gnus-newsgroup-coding-system) + (setq gnus-newsgroup-coding-system + (intern (downcase gnus-newsgroup-coding-system)))) + (setq gnus-newsgroup-iso-8859-1-forced + (if (stringp gnus-newsgroup-iso-8859-1-forced) + (intern (downcase gnus-newsgroup-iso-8859-1-forced)) + (and gnus-newsgroup-iso-8859-1-forced + gnus-newsgroup-coding-system)))) + + ;;; + ;;; MIME Commands + ;;; + + (defun gnus-summary-display-buttonized (&optional arg) + "Display the current buffer fully MIME-buttonized." + (interactive "P") + (require 'gnus-art) + (let ((gnus-unbuttonized-mime-types nil)) + (gnus-summary-show-article arg))) + (gnus-ems-redefine) (provide 'gnus-sum) *** pub/pgnus/lisp/gnus-util.el Sat Nov 14 01:50:25 1998 --- pgnus/lisp/gnus-util.el Sat Nov 21 09:51:16 1998 *************** *** 929,934 **** --- 929,939 ---- (when win (set-window-start win (or point (point)))))) + (defun gnus-annotation-in-region-p (b e) + (if (= b e) + (eq (cadr (memq 'gnus-undeletable (text-properties-at b))) t) + (text-property-any b e 'gnus-undeletable t))) + (provide 'gnus-util) ;;; gnus-util.el ends here *** pub/pgnus/lisp/gnus-xmas.el Sun Nov 8 01:04:34 1998 --- pgnus/lisp/gnus-xmas.el Sat Nov 21 09:51:16 1998 *************** *** 793,799 **** (gnus-splash))) (defun gnus-xmas-annotation-in-region-p (b e) ! (map-extents (lambda (e u) t) nil b e nil nil 'mm t)) (defun gnus-xmas-mime-button-menu (event) "Construct a context-sensitive menu of MIME commands." --- 793,802 ---- (gnus-splash))) (defun gnus-xmas-annotation-in-region-p (b e) ! (or (map-extents (lambda (e u) t) nil b e nil nil 'mm t) ! (if (= b e) ! (eq (cadr (memq 'gnus-undeletable (text-properties-at b))) t) ! (text-property-any b e 'gnus-undeletable t)))) (defun gnus-xmas-mime-button-menu (event) "Construct a context-sensitive menu of MIME commands." *** pub/pgnus/lisp/gnus.el Fri Nov 20 05:25:08 1998 --- pgnus/lisp/gnus.el Sat Nov 21 09:51:17 1998 *************** *** 254,260 **** :link '(custom-manual "(gnus)Exiting Gnus") :group 'gnus) ! (defconst gnus-version-number "0.52" "Version number for this version of Gnus.") (defconst gnus-version (format "Pterodactyl Gnus v%s" gnus-version-number) --- 254,260 ---- :link '(custom-manual "(gnus)Exiting Gnus") :group 'gnus) ! (defconst gnus-version-number "0.53" "Version number for this version of Gnus.") (defconst gnus-version (format "Pterodactyl Gnus v%s" gnus-version-number) *************** *** 292,298 **** (defalias 'gnus-deactivate-mark 'deactivate-mark) (defalias 'gnus-window-edges 'window-edges) (defalias 'gnus-key-press-event-p 'numberp) - (defalias 'gnus-annotation-in-region-p 'ignore) (defalias 'gnus-decode-rfc1522 'ignore)) ;; We define these group faces here to avoid the display --- 292,297 ---- *** pub/pgnus/lisp/lpath.el Tue Oct 20 00:27:07 1998 --- pgnus/lisp/lpath.el Sat Nov 21 09:51:17 1998 *************** *** 45,50 **** --- 45,52 ---- mouse-selection-click-count-buffer buffer-display-table font-lock-defaults user-full-name user-login-name gnus-newsgroup-name gnus-article-x-face-too-ugly + gnus-newsgroup-coding-system + gnus-newsgroup-iso-8859-1-forced mail-mode-hook enable-multibyte-characters adaptive-fill-first-line-regexp adaptive-fill-regexp url-current-mime-headers buffer-file-coding-system))) *** pub/pgnus/lisp/message.el Fri Nov 20 05:25:08 1998 --- pgnus/lisp/message.el Sat Nov 21 09:51:17 1998 *************** *** 1139,1145 **** (forward-line 1) (if (re-search-forward "^[^ \t]" nil t) (goto-char (match-beginning 0)) ! (point-max)))) number)) (defun message-narrow-to-headers () --- 1139,1145 ---- (forward-line 1) (if (re-search-forward "^[^ \t]" nil t) (goto-char (match-beginning 0)) ! (goto-char (point-max))))) number)) (defun message-narrow-to-headers () *** pub/pgnus/lisp/mm-bodies.el Mon Nov 16 01:56:41 1998 --- pgnus/lisp/mm-bodies.el Sat Nov 21 09:51:17 1998 *************** *** 137,143 **** (let (mule-charset) (when (and charset (setq mule-charset (mm-charset-to-coding-system charset)) ! buffer-file-coding-system enable-multibyte-characters (or (not (eq mule-charset 'ascii)) (setq mule-charset rfc2047-default-charset))) --- 137,145 ---- (let (mule-charset) (when (and charset (setq mule-charset (mm-charset-to-coding-system charset)) ! ;; buffer-file-coding-system ! ;Article buffer is nil coding system ! ;in XEmacs enable-multibyte-characters (or (not (eq mule-charset 'ascii)) (setq mule-charset rfc2047-default-charset))) *** pub/pgnus/lisp/mm-decode.el Fri Nov 20 05:25:08 1998 --- pgnus/lisp/mm-decode.el Sat Nov 21 09:51:17 1998 *************** *** 46,55 **** `(nth 5 ,handle)) (defvar mm-inline-media-tests ! '(("image/jpeg" mm-inline-image (featurep 'jpeg)) ! ("image/png" mm-inline-image (featurep 'png)) ! ("image/gif" mm-inline-image (featurep 'gif)) ! ("image/tiff" mm-inline-image (featurep 'tiff)) ("image/xbm" mm-inline-image (and (fboundp 'device-type) (eq (device-type) 'x))) ("image/xpm" mm-inline-image (featurep 'xpm)) --- 46,59 ---- `(nth 5 ,handle)) (defvar mm-inline-media-tests ! '(("image/jpeg" mm-inline-image ! (and (featurep 'jpeg) (mm-image-fit-p handle))) ! ("image/png" mm-inline-image ! (and (featurep 'png) (mm-image-fit-p handle))) ! ("image/gif" mm-inline-image ! (and (featurep 'gif) (mm-image-fit-p handle))) ! ("image/tiff" mm-inline-image ! (and (featurep 'tiff) (mm-image-fit-p handle))) ("image/xbm" mm-inline-image (and (fboundp 'device-type) (eq (device-type) 'x))) ("image/xpm" mm-inline-image (featurep 'xpm)) *************** *** 492,497 **** --- 496,521 ---- (defun mm-get-content-id (id) "Return the handle(s) referred to by ID." (cdr (assoc id mm-content-id-alist))) + + (defun mm-get-image (handle) + "Return an image instance based on HANDLE." + (let ((type (cadr (split-string (car (mm-handle-type handle)) "/")))) + (mm-with-unibyte-buffer + (insert-buffer-substring (mm-handle-buffer handle)) + (mm-decode-content-transfer-encoding + (mm-handle-encoding handle) + (car (mm-handle-type handle))) + (make-image-specifier + (vector (intern type) :data (buffer-string)))))) + + (defun mm-image-fit-p (handle) + "Say whether the image in HANDLE will fit the current window." + (or t + (let ((image (make-image-instance (mm-get-image handle)))) + (and (< (image-instance-width image) + (window-pixel-width)) + (< (image-instance-height image) + (window-pixel-height)))))) (provide 'mm-decode) *** pub/pgnus/lisp/mm-util.el Mon Nov 16 01:56:42 1998 --- pgnus/lisp/mm-util.el Sat Nov 21 09:51:18 1998 *************** *** 116,121 **** --- 116,124 ---- dest) "Charset/coding system alist.") + ;;;Internal variable + (defvar mm-charset-iso-8859-1-forced nil) + (defun mm-mule-charset-to-mime-charset (charset) "Return the MIME charset corresponding to MULE CHARSET." (let ((alist mm-mime-mule-charset-alist) *************** *** 134,139 **** --- 137,145 ---- used as the line break code type of the coding system." (when (stringp charset) (setq charset (intern (downcase charset)))) + (if (and mm-charset-iso-8859-1-forced + (eq charset 'iso-8859-1)) + (setq charset mm-charset-iso-8859-1-forced)) (setq charset (or (cdr (assq charset mm-charset-coding-system-alist)) charset)) *** pub/pgnus/lisp/mm-view.el Fri Nov 20 05:25:09 1998 --- pgnus/lisp/mm-view.el Sat Nov 21 09:51:18 1998 *************** *** 33,51 **** ;;; (defun mm-inline-image (handle) ! (let ((type (cadr (split-string (car (mm-handle-type handle)) "/"))) ! buffer-read-only image) ! (mm-with-unibyte-buffer ! (insert-buffer-substring (mm-handle-buffer handle)) ! (mm-decode-content-transfer-encoding ! (mm-handle-encoding handle) ! (car (mm-handle-type handle))) ! (setq image (make-image-specifier ! (vector (intern type) :data (buffer-string))))) ! (let ((annot (make-annotation image nil 'text))) ! (mm-insert-inline handle ".\n") ! (set-extent-property annot 'mm t) ! (set-extent-property annot 'duplicable t)))) (defun mm-inline-text (handle) (let ((type (cadr (split-string (car (mm-handle-type handle)) "/"))) --- 33,43 ---- ;;; (defun mm-inline-image (handle) ! (let ((annot (make-annotation (mm-get-image handle) nil 'text)) ! buffer-read-only) ! (mm-insert-inline handle ".\n") ! (set-extent-property annot 'mm t) ! (set-extent-property annot 'duplicable t))) (defun mm-inline-text (handle) (let ((type (cadr (split-string (car (mm-handle-type handle)) "/"))) *************** *** 64,71 **** (narrow-to-region b (point)) (let ((charset (mail-content-type-get (mm-handle-type handle) 'charset))) ! (when charset ! (mm-decode-body charset nil))) (mm-handle-set-undisplayer handle `(lambda () --- 56,62 ---- (narrow-to-region b (point)) (let ((charset (mail-content-type-get (mm-handle-type handle) 'charset))) ! (mm-decode-body charset nil)) (mm-handle-set-undisplayer handle `(lambda () *** pub/pgnus/lisp/ChangeLog Fri Nov 20 05:25:06 1998 --- pgnus/lisp/ChangeLog Sat Nov 21 09:51:14 1998 *************** *** 1,3 **** --- 1,78 ---- + Sat Nov 21 09:57:01 1998 Lars Magne Ingebrigtsen + + * gnus.el: Pterodactyl Gnus v0.53 is released. + + 1998-11-21 05:54:19 Lars Magne Ingebrigtsen + + * mm-decode.el (mm-get-image): New function. + (mm-image-fit-p): New function. + + * gnus-xmas.el (gnus-xmas-annotation-in-region-p): Ditto. + + * gnus-util.el (gnus-annotation-in-region-p): New definition. + + * gnus-art.el (gnus-article-insert-newline): New function. + (article-goto-body): New function. + + 1998-11-20 10:34:04 Lars Magne Ingebrigtsen + + * gnus-art.el (gnus-mime-display-single): Insert blank line before + buttons. + + * gnus-sum.el (gnus-summary-display-buttonized): New command and + keystroke. + + * gnus-art.el (gnus-mime-display-single): Don't insert a blank + line between parts. + + * message.el (message-remove-header): Go to end if wanted. + + 1998-11-20 Karl Kleinpaste + + * gnus-art.el (gnus-mime-display-alternative): Avoid window + movement with save-window-excursion. + + Fri Nov 20 03:50:30 1998 Shenghuo ZHU + + * gnus-art.el (gnus-mime-inline-part): Use argument as charset. + + Fri Nov 20 03:37:53 1998 Shenghuo ZHU + + * mm-bodies.el (mm-decode-body): Remove buffer-file-coding-system. + + Fri Nov 20 01:20:38 1998 Shenghuo ZHU + + * gnus-sum.el (gnus-summary-from-or-to-or-newsgroups): Use + gnus-newsgroup-coding-system. + (gnus-get-newsgroup-headers): Ditto. + (gnus-get-newsgroup-headers-xover): Ditto. + (gnus-set-global-variables): Ditto. + * gnus-art.el (article-decode-mime-words): Ditto. + (article-decode-charset): Ditto. + (article-decode-encoded-words): Ditto. + (article-de-quoted-unreadable): Ditto. + (gnus-mime-view-all-parts): Ditto. + (gnus-mime-externalize-part): Ditto. + (gnus-mm-display-part): Ditto. + (gnus-mime-display-alternative): Ditto. + (gnus-mime-display-single): Ditto. + * mm-view.el (mm-inline-text): Use default coding system. + + Fri Nov 20 00:54:37 1998 Shenghuo ZHU + + * gnus-sum.el (gnus-newsgroup-coding-system-alist): New variable. + (gnus-newsgroup-iso-8859-1-forced-regexp): New variable. + (gnus-newsgroup-coding-system): New local variable. + (gnus-newsgroup-iso-8859-1-forced): New local variable. + (gnus-summary-local-variables): Add two new local variables. + (gnus-newsgroup-setup-coding-system): New function. + (gnus-select-newsgroup): Setup coding system. + * lpath.el: Add two new variables. + * mm-util.el (mm-charset-iso-8859-1-forced): New variable. + (mm-charset-to-coding-system): Use mm-charset-iso-8859-1-forced. + * gnus-cus.el (gnus-group-parameters): Customizable + iso-8859-1-forced. + Fri Nov 20 05:30:26 1998 Lars Magne Ingebrigtsen * gnus.el: Pterodactyl Gnus v0.52 is released. *** pub/pgnus/texi/gnus.texi Fri Nov 20 05:25:11 1998 --- pgnus/texi/gnus.texi Sat Nov 21 09:51:19 1998 *************** *** 1,7 **** \input texinfo @c -*-texinfo-*- @setfilename gnus ! @settitle Pterodactyl Gnus 0.52 Manual @synindex fn cp @synindex vr cp @synindex pg cp --- 1,7 ---- \input texinfo @c -*-texinfo-*- @setfilename gnus ! @settitle Pterodactyl Gnus 0.53 Manual @synindex fn cp @synindex vr cp @synindex pg cp *************** *** 318,324 **** @tex @titlepage ! @title Pterodactyl Gnus 0.52 Manual @author by Lars Magne Ingebrigtsen @page --- 318,324 ---- @tex @titlepage ! @title Pterodactyl Gnus 0.53 Manual @author by Lars Magne Ingebrigtsen @page *************** *** 354,360 **** spool or your mbox file. All at the same time, if you want to push your luck. ! This manual corresponds to Pterodactyl Gnus 0.52. @end ifinfo --- 354,360 ---- spool or your mbox file. All at the same time, if you want to push your luck. ! This manual corresponds to Pterodactyl Gnus 0.53. @end ifinfo *** pub/pgnus/texi/message.texi Fri Nov 20 05:25:11 1998 --- pgnus/texi/message.texi Sat Nov 21 09:51:19 1998 *************** *** 1,7 **** \input texinfo @c -*-texinfo-*- @setfilename message ! @settitle Pterodactyl Message 0.52 Manual @synindex fn cp @synindex vr cp @synindex pg cp --- 1,7 ---- \input texinfo @c -*-texinfo-*- @setfilename message ! @settitle Pterodactyl Message 0.53 Manual @synindex fn cp @synindex vr cp @synindex pg cp *************** *** 42,48 **** @tex @titlepage ! @title Pterodactyl Message 0.52 Manual @author by Lars Magne Ingebrigtsen @page --- 42,48 ---- @tex @titlepage ! @title Pterodactyl Message 0.53 Manual @author by Lars Magne Ingebrigtsen @page *************** *** 83,89 **** * Key Index:: List of Message mode keys. @end menu ! This manual corresponds to Pterodactyl Message 0.52. Message is distributed with the Gnus distribution bearing the same version number as this manual. --- 83,89 ---- * Key Index:: List of Message mode keys. @end menu ! This manual corresponds to Pterodactyl Message 0.53. Message is distributed with the Gnus distribution bearing the same version number as this manual.