From: ichikawa Date: Sat, 21 Nov 1998 11:58:44 +0000 (+0000) Subject: Sync up with pgnus-0.53 X-Git-Tag: pgnus-ichikawa-199811302358~13 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e308ebca5276fa8156c52b28db768c4339aca562;p=elisp%2Fgnus.git- Sync up with pgnus-0.53 --- diff --git a/ChangeLog b/ChangeLog index d7a88c0..afc3334 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 1998-11-21 Tatsuya Ichikawa + * lisp/gnus.el (gnus-version-number): Update to 6.10.038. + + * Sync up with Pterodactyl Gnus 0.52. + * lisp/pop3-fma.el (pop3-fma-init-message-hook): Change message-send-hook to mime-edit-translate-hook - enbug. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 450803f..6f6404b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -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. diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index bacf915..fa6f3be 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -888,8 +888,7 @@ always hide." 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) + (when (article-goto-body) (let ((buffer-read-only nil) (x (make-string 225 ?x)) (i -1)) @@ -905,8 +904,7 @@ characters to translate to." "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) + (when (article-goto-body) (let ((buffer-read-only nil) elem) (while (setq elem (pop map)) @@ -918,8 +916,7 @@ MAP is an alist where the elements are on the form (\"from\" \"to\")." "Translate overstrikes into bold text." (interactive) (save-excursion - (goto-char (point-min)) - (when (search-forward "\n\n" nil t) + (when (article-goto-body) (let ((buffer-read-only nil)) (while (search-forward "\b" nil t) (let ((next (char-after)) @@ -947,8 +944,7 @@ MAP is an alist where the elements are on the form (\"from\" \"to\")." (save-excursion (let ((buffer-read-only nil)) (widen) - (goto-char (point-min)) - (search-forward "\n\n" nil t) + (article-goto-body) (end-of-line 1) (let ((paragraph-start "^[>|#:<;* ]*[ \t]*$") (adaptive-fill-regexp "[ \t]*\\([|#:<;>*]+ *\\)?") @@ -1044,7 +1040,9 @@ MAP is an alist where the elements are on the form (\"from\" \"to\")." (save-excursion (set-buffer gnus-article-buffer) (let ((inhibit-point-motion-hooks t) - buffer-read-only) + 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) @@ -1066,9 +1064,9 @@ If PROMPT (the prefix), prompt for a coding system to use." (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)))) + (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) @@ -1097,16 +1095,18 @@ or not." (interactive (list 'force)) (save-excursion (let ((buffer-read-only nil) - (type (gnus-fetch-field "content-transfer-encoding"))) + (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)))) - (goto-char (point-min)) - (search-forward "\n\n" nil 'move) + (article-goto-body) (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))))))) + (when charset + (mm-decode-body charset))))))) (defun article-hide-pgp (&optional arg) "Toggle hiding of any PGP headers and signatures in the current article. @@ -1193,12 +1193,19 @@ always hide." (save-excursion (let ((inhibit-point-motion-hooks t) buffer-read-only) - (goto-char (point-min)) - (when (search-forward "\n\n" nil t) + (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) @@ -1206,15 +1213,13 @@ always hide." (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) + (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. - (goto-char (point-min)) - (search-forward "\n\n" nil t) + (article-goto-body) (while (re-search-forward "\n\n\n+" nil t) (unless (gnus-annotation-in-region-p (match-beginning 0) (match-end 0)) @@ -1226,8 +1231,7 @@ always hide." (save-excursion (let ((inhibit-point-motion-hooks t) buffer-read-only) - (goto-char (point-min)) - (search-forward "\n\n" nil t) + (article-goto-body) (while (re-search-forward "^[ \t]+" nil t) (replace-match "" t t))))) @@ -1244,8 +1248,7 @@ always hide." (save-excursion (let ((inhibit-point-motion-hooks t) buffer-read-only) - (goto-char (point-min)) - (search-forward "\n\n" nil t) + (article-goto-body) (while (re-search-forward "^[ \t]*\n" nil t) (replace-match "" t t))))) @@ -1595,8 +1598,7 @@ This format is defined by the `gnus-article-time-format' variable." (props (append '(article-type emphasis) gnus-hidden-properties)) regexp elem beg invisible visible face) - (goto-char (point-min)) - (search-forward "\n\n" nil t) + (article-goto-body) (setq beg (point)) (while (setq elem (pop alist)) (goto-char beg) @@ -1807,8 +1809,7 @@ The directory to save in defaults to `gnus-article-save-directory'." (save-excursion (save-restriction (widen) - (goto-char (point-min)) - (when (search-forward "\n\n" nil t) + (when (article-goto-body) (narrow-to-region (point) (point-max))) (gnus-output-to-file filename)))) filename) @@ -2262,8 +2263,7 @@ If ALL-HEADERS is non-nil, no headers are hidden." t))) (gnus-set-mode-line 'article) (gnus-configure-windows 'article) - (goto-char (point-min)) - (search-forward "\n\n" nil t) + (article-goto-body) (set-window-point (get-buffer-window (current-buffer)) (point)) t)))))) @@ -2344,7 +2344,9 @@ If ALL-HEADERS is non-nil, no headers are hidden." "View all the MIME parts." (interactive) (gnus-article-check-buffer) - (let ((handles gnus-article-mime-handles)) + (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))))) @@ -2388,9 +2390,9 @@ If ALL-HEADERS is non-nil, no headers are hidden." (normal-mode) (goto-char (point-min)))) -(defun gnus-mime-inline-part () +(defun gnus-mime-inline-part (&optional charset) "Insert the MIME part under point into the current buffer." - (interactive) + (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)) @@ -2400,6 +2402,10 @@ If ALL-HEADERS is non-nil, no headers are hidden." (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)))) @@ -2409,7 +2415,9 @@ If ALL-HEADERS is non-nil, no headers are hidden." (gnus-article-check-buffer) (let* ((handle (get-text-property (point) 'gnus-data)) (url-standalone-mode (not gnus-plugged)) - (mm-user-display-methods nil)) + (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)))) @@ -2437,7 +2445,9 @@ If ALL-HEADERS is non-nil, no headers are hidden." (gnus-insert-mime-button handle id (list (not (mm-handle-displayed-p handle)))) (prog1 - (let ((window (selected-window))) + (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))) @@ -2512,8 +2522,7 @@ If ALL-HEADERS is non-nil, no headers are hidden." (cdr handles))) (unless ihandles ;; Clean up for mime parts. - (goto-char (point-min)) - (search-forward "\n\n" nil t) + (article-goto-body) (delete-region (point) (point-max))) (if (stringp (car handles)) (if (equal (car handles) "multipart/alternative") @@ -2567,73 +2576,58 @@ If ALL-HEADERS is non-nil, no headers are hidden." (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)))))) - (insert "\n\n") + (and (not not-attachment) text)))) + (gnus-article-insert-newline))) + (gnus-article-insert-newline) (cond (display (forward-line -2) - (mm-display-part handle t) + (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) - (insert "\n") + (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-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)) + (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 "[%c] %-18s" - (if (equal handle preferred) ?* ? ) - (if (stringp (car handle)) - (car handle) - (car (mm-handle-type handle))))) + (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 ',handle ',begend ,id)) + (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 @@ -2643,14 +2637,44 @@ If ALL-HEADERS is non-nil, no headers are hidden." (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)))) + ;; 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)))) @@ -3169,8 +3193,7 @@ groups." (save-excursion (save-restriction (widen) - (goto-char (point-min)) - (when (search-forward "\n\n" nil 1) + (when (article-goto-body) (let ((lines (count-lines (point) (point-max))) (length (- (point-max) (point))) (case-fold-search t) @@ -3581,9 +3604,7 @@ specified by `gnus-button-alist'." '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))) + (article-goto-body) (setq beg (point)) (while (setq entry (pop alist)) (setq regexp (car entry)) diff --git a/lisp/gnus-cus.el b/lisp/gnus-cus.el index 5a839e8..3fca44b 100644 --- a/lisp/gnus-cus.el +++ b/lisp/gnus-cus.el @@ -164,6 +164,10 @@ in it..") (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. diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index 01d45d2..2554e52 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -810,6 +810,22 @@ which it may alter in any way.") :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-scores-exclude-files nil) @@ -997,6 +1013,9 @@ variable (string, integer, character, etc).") (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 @@ -1027,7 +1046,8 @@ variable (string, integer, character, etc).") (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-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. @@ -1478,7 +1498,11 @@ increase the score of each group you read." "h" gnus-summary-save-article-folder "v" gnus-summary-save-article-vm "p" gnus-summary-pipe-output - "s" gnus-soup-add-article)) + "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) @@ -2336,7 +2360,9 @@ marks of articles." (original gnus-original-article-buffer) (gac gnus-article-current) (reffed gnus-reffed-article-number) - (score-file gnus-current-score-file)) + (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 @@ -2349,7 +2375,9 @@ marks of articles." gnus-article-buffer article-buffer gnus-original-article-buffer original gnus-reffed-article-number reffed - gnus-current-score-file score-file) + 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) @@ -2425,7 +2453,9 @@ marks of articles." (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))))) + (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 @@ -4453,7 +4483,9 @@ The resulting hash table is returned, or nil if no Xrefs were found." (or dependencies (save-excursion (set-buffer gnus-summary-buffer) gnus-newsgroup-dependencies))) - headers id end ref) + 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. @@ -4615,7 +4647,9 @@ list of headers that match SEQUENCE (see `nntp-retrieve-headers')." ;; 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) + (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 @@ -9123,6 +9157,48 @@ save those articles instead." ;;; @ end ;;; +(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) diff --git a/lisp/gnus-util.el b/lisp/gnus-util.el index ff0176b..1d6fe92 100644 --- a/lisp/gnus-util.el +++ b/lisp/gnus-util.el @@ -937,6 +937,11 @@ ARG is passed to the first function." (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 diff --git a/lisp/gnus-xmas.el b/lisp/gnus-xmas.el index 334ccfa..dfc5251 100644 --- a/lisp/gnus-xmas.el +++ b/lisp/gnus-xmas.el @@ -898,7 +898,10 @@ XEmacs compatibility workaround." (gnus-splash))) (defun gnus-xmas-annotation-in-region-p (b e) - (map-extents (lambda (e u) t) nil b e nil nil 'mm t)) + (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." diff --git a/lisp/gnus.el b/lisp/gnus.el index 50cc038..ef98f5d 100644 --- a/lisp/gnus.el +++ b/lisp/gnus.el @@ -259,10 +259,10 @@ is restarted, and sometimes reloaded." (defconst gnus-product-name "T-gnus" "Product name of this version of gnus.") -(defconst gnus-version-number "6.10.038" +(defconst gnus-version-number "6.10.039" "Version number for this version of gnus.") -(defconst gnus-original-version-number "0.52" +(defconst gnus-original-version-number "0.53" "Version number for this version of Gnus.") (defconst gnus-original-product-name "Pterodactyl Gnus" @@ -306,7 +306,6 @@ be set in `.emacs' instead." (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 diff --git a/lisp/lpath.el b/lisp/lpath.el index e02ac22..2ea3faf 100644 --- a/lisp/lpath.el +++ b/lisp/lpath.el @@ -50,6 +50,8 @@ 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))) diff --git a/lisp/message.el b/lisp/message.el index 1881daf..9a28318 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -1302,7 +1302,7 @@ Return the number of headers removed." (forward-line 1) (if (re-search-forward "^[^ \t]" nil t) (goto-char (match-beginning 0)) - (point-max)))) + (goto-char (point-max))))) number)) (defun message-narrow-to-headers () diff --git a/lisp/mm-bodies.el b/lisp/mm-bodies.el index 78bf4c5..09a776e 100644 --- a/lisp/mm-bodies.el +++ b/lisp/mm-bodies.el @@ -137,7 +137,9 @@ The characters in CHARSET should then be decoded." (let (mule-charset) (when (and charset (setq mule-charset (mm-charset-to-coding-system charset)) - buffer-file-coding-system + ;; 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))) diff --git a/lisp/mm-decode.el b/lisp/mm-decode.el index 3ae0f30..e5e4dc8 100644 --- a/lisp/mm-decode.el +++ b/lisp/mm-decode.el @@ -46,10 +46,14 @@ `(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/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)) @@ -493,6 +497,26 @@ This overrides entries in the mailcap file." "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) ;; mm-decode.el ends here diff --git a/lisp/mm-util.el b/lisp/mm-util.el index 2cd6003..b83ce74 100644 --- a/lisp/mm-util.el +++ b/lisp/mm-util.el @@ -116,6 +116,9 @@ 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,6 +137,9 @@ If optional argument LBT (`unix', `dos' or `mac') is specified, it is 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)) diff --git a/lisp/mm-view.el b/lisp/mm-view.el index 3433a68..d7a94b1 100644 --- a/lisp/mm-view.el +++ b/lisp/mm-view.el @@ -33,19 +33,11 @@ ;;; (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)))) + (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,8 +56,7 @@ (narrow-to-region b (point)) (let ((charset (mail-content-type-get (mm-handle-type handle) 'charset))) - (when charset - (mm-decode-body charset nil))) + (mm-decode-body charset nil)) (mm-handle-set-undisplayer handle `(lambda () diff --git a/texi/gnus-ja.texi b/texi/gnus-ja.texi index e00a19e..828a67d 100644 --- a/texi/gnus-ja.texi +++ b/texi/gnus-ja.texi @@ -1,7 +1,7 @@ \input texinfo @c -*-texinfo-*- @setfilename gnus-ja -@settitle Semi-gnus 6.10.038 Manual +@settitle Semi-gnus 6.10.039 Manual @synindex fn cp @synindex vr cp @synindex pg cp @@ -345,7 +345,7 @@ into another language, under the above conditions for modified versions. @tex @titlepage -@title Semi-gnus 6.10.038 Manual +@title Semi-gnus 6.10.039 Manual @author by Lars Magne Ingebrigtsen @author by members of Semi-gnus mailing-list @@ -399,7 +399,7 @@ Semi-gnus $B$O!"Bg$-$J3($,F~$C$F$$$?$j$5$^$6$^$J7A<0$rMQ$$$?$j$7$F$$$k$A$g$C(B $B$J8@8l7w$r:9JL$7$^$;$s!#$"$"!"%/%j%s%4%s$NJ}$O(B Unicode Next Generation$B$r(B $B$*BT$A$/$@$5$$!#(B -$B$3$N@bL@=q$O(B Semi-gnus 6.10.038 $B$KBP1~$7$^$9!#(B +$B$3$N@bL@=q$O(B Semi-gnus 6.10.039 $B$KBP1~$7$^$9!#(B @end ifinfo diff --git a/texi/gnus.texi b/texi/gnus.texi index e7049e8..9c61d91 100644 --- a/texi/gnus.texi +++ b/texi/gnus.texi @@ -1,7 +1,7 @@ \input texinfo @c -*-texinfo-*- @setfilename gnus -@settitle Semi-gnus 6.10.038 Manual +@settitle Semi-gnus 6.10.039 Manual @synindex fn cp @synindex vr cp @synindex pg cp @@ -318,7 +318,7 @@ into another language, under the above conditions for modified versions. @tex @titlepage -@title Semi-gnus 6.10.038 Manual +@title Semi-gnus 6.10.039 Manual @author by Lars Magne Ingebrigtsen @page @@ -361,7 +361,7 @@ internationalization/localization and multiscript features based on MULE API. So Semi-gnus does not discriminate various language communities. Oh, if you are a Klingon, please wait Unicode Next Generation. -This manual corresponds to Semi-gnus 6.10.038. +This manual corresponds to Semi-gnus 6.10.039. @end ifinfo diff --git a/texi/message-ja.texi b/texi/message-ja.texi index f8d64a8..de51811 100644 --- a/texi/message-ja.texi +++ b/texi/message-ja.texi @@ -1,7 +1,7 @@ \input texinfo @c -*-texinfo-*- @setfilename message-ja -@settitle Message 6.10.038 Manual +@settitle Message 6.10.039 Manual @synindex fn cp @synindex vr cp @synindex pg cp @@ -60,7 +60,7 @@ into another language, under the above conditions for modified versions. @tex @titlepage -@title Message 6.10.038 Manual +@title Message 6.10.039 Manual @author by Lars Magne Ingebrigtsen @translated by members of Semi-gnus mailing-list @@ -112,7 +112,7 @@ Gnus $B$NA4$F$N%a%C%;!<%8$N:n@.(B ($B%a!<%k$H%K%e!<%9$NN>J}(B) $B$O%a%C%;!< * Key Index:: $B%a%C%;!<%8%b!<%I%-!<$N0lMw!#(B @end menu -$B$3$N%^%K%e%"%k$O(B Message 6.10.038 $B$KBP1~$7$^$9!#(BMessage $B$O$3$N%^%K%e%"%k$H(B +$B$3$N%^%K%e%"%k$O(B Message 6.10.039 $B$KBP1~$7$^$9!#(BMessage $B$O$3$N%^%K%e%"%k$H(B $BF1$8HGHV9f$N(B Gnus $B$NG[I[$H6&$KG[I[$5$l$^$9!#(B diff --git a/texi/message.texi b/texi/message.texi index 2b6f087..3966928 100644 --- a/texi/message.texi +++ b/texi/message.texi @@ -1,7 +1,7 @@ \input texinfo @c -*-texinfo-*- @setfilename message -@settitle Message 6.10.038 Manual +@settitle Message 6.10.039 Manual @synindex fn cp @synindex vr cp @synindex pg cp @@ -42,7 +42,7 @@ into another language, under the above conditions for modified versions. @tex @titlepage -@title Message 6.10.038 Manual +@title Message 6.10.039 Manual @author by Lars Magne Ingebrigtsen @page @@ -83,7 +83,7 @@ Message mode buffers. * Key Index:: List of Message mode keys. @end menu -This manual corresponds to Message 6.10.038. Message is +This manual corresponds to Message 6.10.039. Message is distributed with the Gnus distribution bearing the same version number as this manual.