From bc91639ac1de2d600d1123f0a22db5e17c670e56 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Wed, 2 Dec 1998 04:16:55 +0000 Subject: [PATCH] Importing Pterodactyl Gnus v0.59 (retry). --- lisp/ChangeLog | 50 ++++++++++++++++++++++++++++ lisp/gnus-art.el | 88 +++++++++++++++++++++++++++++--------------------- lisp/gnus-picon.el | 8 +++-- lisp/gnus-sum.el | 4 ++- lisp/gnus.el | 2 +- lisp/mm-bodies.el | 18 ++++++----- lisp/mm-decode.el | 21 ++++++++++-- lisp/mm-uu.el | 28 ++++++++-------- lisp/mml.el | 7 ++-- lisp/nndoc.el | 12 +++---- texi/ChangeLog | 4 +++ texi/emacs-mime.texi | 4 +-- texi/gnus.texi | 13 ++++---- texi/message.texi | 6 ++-- 14 files changed, 180 insertions(+), 85 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3338e4d..296d269 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,53 @@ +Wed Dec 2 01:43:48 1998 Lars Magne Ingebrigtsen + + * gnus.el: Pterodactyl Gnus v0.59 is released. + +1998-12-02 01:38:31 Lars Magne Ingebrigtsen + + * mml.el (mml-insert-mime-headers): Beep at multiple charsets. + + * gnus-art.el (gnus-mime-copy-part): Set buffer-file-name. + +1998-11-30 Hrvoje Niksic + + * mml.el (mml-generate-mime-1): Handle unquoting end-tags. + +1998-12-02 00:15:30 Lars Magne Ingebrigtsen + + * mm-decode.el (mm-all-images-fit): New variable. + (mm-image-fit-p): Use it. + + * gnus-art.el (gnus-mime-display-single): Use it. + (gnus-mime-internalize-part): New command and keystroke. + + * mm-decode.el (mm-user-automatic-external-display): New + variable. + (mm-automatic-external-display-p): New function. + + * gnus-picon.el (gnus-picons-xbm-face): Default to sensible + colors. + +1998-12-01 23:52:05 Lars Magne Ingebrigtsen + + * gnus-sum.el (gnus-summary-repair-multipart): Reselect article. + + * gnus-art.el (gnus-with-article): Work in the original article + buffer. + (gnus-with-article): Work in read-only groups. + +Tue Dec 1 00:15:36 1998 Shenghuo ZHU + + * mm-bodies.el (mm-decode-string): Return original string if not + decode. + +Mon Nov 30 23:38:02 1998 Shenghuo ZHU + + * mm-uu.el (mm-uu-dissect): Use mm-make-handle. + +1998-12-01 01:53:49 François Pinard + + * nndoc.el (nndoc-mime-parts-type-p): Do related. + Tue Dec 1 00:46:20 1998 Lars Magne Ingebrigtsen * gnus.el: Pterodactyl Gnus v0.58 is released. diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index b912b57..67ea432 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -637,33 +637,28 @@ Initialized from `text-mode-syntax-table.") b 'intangible (cddr (memq 'intangible props))))) (defmacro gnus-with-article (article &rest forms) - "Select ARTICLE, copy the contents of the original article buffer to a new buffer, and then perform FORMS there. + "Select ARTICLE and perform FORMS in the original article buffer. Then replace the article with the result." `(progn ;; We don't want the article to be marked as read. (let (gnus-mark-article-hook) (gnus-summary-select-article t t nil ,article)) (set-buffer gnus-original-article-buffer) - (let ((buf (format "%s" (buffer-string)))) - (with-temp-buffer - (insert buf) - ,@forms - (unless (gnus-request-replace-article - ,article (car gnus-article-current) - (current-buffer) t) - (error "Couldn't replace article")) - ;; The cache and backlog have to be flushed somewhat. - (when gnus-keep-backlog - (gnus-backlog-remove-article - (car gnus-article-current) (cdr gnus-article-current))) - ;; Flush original article as well. - (save-excursion - (when (get-buffer gnus-original-article-buffer) - (set-buffer gnus-original-article-buffer) - (setq gnus-original-article nil))) - (when gnus-use-cache - (gnus-cache-update-article - (car gnus-article-current) (cdr gnus-article-current))))))) + ,@forms + (if (not (gnus-check-backend-function + 'request-replace-article (car gnus-article-current))) + (gnus-message 5 "Read-only group; not replacing") + (unless (gnus-request-replace-article + ,article (car gnus-article-current) + (current-buffer) t) + (error "Couldn't replace article"))) + ;; The cache and backlog have to be flushed somewhat. + (when gnus-keep-backlog + (gnus-backlog-remove-article + (car gnus-article-current) (cdr gnus-article-current))) + (when gnus-use-cache + (gnus-cache-update-article + (car gnus-article-current) (cdr gnus-article-current))))) (put 'gnus-with-article 'lisp-indent-function 1) (put 'gnus-with-article 'edebug-form-spec '(form body)) @@ -2287,11 +2282,11 @@ If ALL-HEADERS is non-nil, no headers are hidden." (defvar gnus-mime-button-commands '((gnus-article-press-button "\r" "Toggle Display") - ;(gnus-mime-view-part "\M-\r" "View Interactively...") (gnus-mime-view-part "v" "View Interactively...") (gnus-mime-save-part "o" "Save...") (gnus-mime-copy-part "c" "View As Text, In Other Buffer") (gnus-mime-inline-part "i" "View As Text, In This Buffer") + (gnus-mime-internalize-part "E" "View Internally") (gnus-mime-externalize-part "e" "View Externally") (gnus-mime-pipe-part "|" "Pipe To Command..."))) @@ -2355,8 +2350,7 @@ If ALL-HEADERS is non-nil, no headers are hidden." (interactive) (gnus-article-check-buffer) (let ((data (get-text-property (point) 'gnus-data)) - ;(url-standalone-mode (not gnus-plugged)) - ) + (url-standalone-mode (not gnus-plugged))) (mm-interactively-view-part data))) (defun gnus-mime-copy-part (&optional handle) @@ -2364,17 +2358,22 @@ If ALL-HEADERS is non-nil, no headers are hidden." (interactive) (gnus-article-check-buffer) (let* ((handle (or handle (get-text-property (point) 'gnus-data))) - (contents (mm-get-part handle)) - (buffer (generate-new-buffer - (file-name-nondirectory - (or - (mail-content-type-get (mm-handle-type handle) 'name) - (mail-content-type-get (mm-handle-type handle) - 'filename) - "*decoded*"))))) + (contents (mm-get-part handle))| + (base (file-name-nondirectory + (or + (mail-content-type-get (mm-handle-type handle) 'name) + (mail-content-type-get (mm-handle-type handle) + 'filename) + "*decoded*"))) + (buffer (generate-new-buffer base))) (switch-to-buffer buffer) (insert contents) - (normal-mode) + ;; We do it this way to make `normal-mode' set the appropriate mode. + (unwind-protect + (progn + (setq buffer-file-name (expand-file-name base)) + (normal-mode)) + (setq buffer-file-name nil)) (goto-char (point-min)))) (defun gnus-mime-inline-part (&optional charset) @@ -2383,7 +2382,7 @@ If ALL-HEADERS is non-nil, no headers are hidden." (gnus-article-check-buffer) (let* ((data (get-text-property (point) 'gnus-data)) contents - ;(url-standalone-mode (not gnus-plugged)) + (url-standalone-mode (not gnus-plugged)) (b (point)) buffer-read-only) (if (mm-handle-undisplayer data) @@ -2398,12 +2397,26 @@ If ALL-HEADERS is non-nil, no headers are hidden." (goto-char b)))) (defun gnus-mime-externalize-part (&optional handle) - "Insert the MIME part under point into the current buffer." + "View the MIME part under point with an external viewer." (interactive) (gnus-article-check-buffer) (let* ((handle (or handle (get-text-property (point) 'gnus-data))) - ;(url-standalone-mode (not gnus-plugged)) + (url-standalone-mode (not gnus-plugged)) (mm-user-display-methods nil) + (mm-all-images-fit t) + (rfc2047-default-charset gnus-newsgroup-default-charset) + (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)))) + +(defun gnus-mime-internalize-part (&optional handle) + "View the MIME part under point with an internal viewer." + (interactive) + (gnus-article-check-buffer) + (let* ((handle (or handle (get-text-property (point) 'gnus-data))) + (url-standalone-mode (not gnus-plugged)) + (mm-user-display-methods '(".*")) (rfc2047-default-charset gnus-newsgroup-default-charset) (mm-charset-iso-8859-1-forced gnus-newsgroup-iso-8859-1-forced)) (if (mm-handle-undisplayer handle) @@ -2594,7 +2607,8 @@ If ALL-HEADERS is non-nil, no headers are hidden." (when (string-match (pop ignored) type) (throw 'ignored nil))) (if (and (mm-automatic-display-p type) - (mm-inlinable-part-p type) + (or (mm-inlinable-part-p type) + (mm-automatic-external-display-p type)) (setq not-attachment (or (not (mm-handle-disposition handle)) (equal (car (mm-handle-disposition handle)) diff --git a/lisp/gnus-picon.el b/lisp/gnus-picon.el index a3b5418..11d0560 100644 --- a/lisp/gnus-picon.el +++ b/lisp/gnus-picon.el @@ -144,8 +144,12 @@ please tell me so that we can list it." (string)) :group 'picons) -(defface gnus-picons-xbm-face '((t (:foreground "black" :background "white"))) - "Face to show X face" +(defface gnus-picons-xbm-face + '((((background dark)) + (:foreground "green" :background "black")) + (t + (:foreground "black" :background "blue"))) + "Face to show xbm picons in." :group 'picons) ;;; Internal variables: diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index 2198a03..d01676a 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -9213,7 +9213,9 @@ save those articles instead." (insert (format "Content-Type: multipart/mixed; boundary=\"%s\"\n" separator)) (insert "Mime-Version: 1.0\n") - (widen))))) + (widen)))) + (let (gnus-mark-article-hook) + (gnus-summary-select-article t t nil article))) (defun gnus-summary-toggle-display-buttonized () "Toggle the buttonizing of the article buffer." diff --git a/lisp/gnus.el b/lisp/gnus.el index bc7c8be..fb57c2a 100644 --- a/lisp/gnus.el +++ b/lisp/gnus.el @@ -254,7 +254,7 @@ is restarted, and sometimes reloaded." :link '(custom-manual "(gnus)Exiting Gnus") :group 'gnus) -(defconst gnus-version-number "0.58" +(defconst gnus-version-number "0.59" "Version number for this version of Gnus.") (defconst gnus-version (format "Pterodactyl Gnus v%s" gnus-version-number) diff --git a/lisp/mm-bodies.el b/lisp/mm-bodies.el index 22d2ae4..6662702 100644 --- a/lisp/mm-bodies.el +++ b/lisp/mm-bodies.el @@ -172,14 +172,16 @@ The characters in CHARSET should then be decoded." (defun mm-decode-string (string charset) "Decode STRING with CHARSET." (setq charset (or charset rfc2047-default-charset)) - (when (featurep 'mule) - (let (mule-charset) - (when (and charset - (setq mule-charset (mm-charset-to-coding-system charset)) - enable-multibyte-characters - (or (not (eq mule-charset 'ascii)) - (setq mule-charset rfc2047-default-charset))) - (mm-decode-coding-string string mule-charset))))) + (or + (when (featurep 'mule) + (let (mule-charset) + (when (and charset + (setq mule-charset (mm-charset-to-coding-system charset)) + enable-multibyte-characters + (or (not (eq mule-charset 'ascii)) + (setq mule-charset rfc2047-default-charset))) + (mm-decode-coding-string string mule-charset)))) + string)) (provide 'mm-bodies) diff --git a/lisp/mm-decode.el b/lisp/mm-decode.el index f208252..6f12485 100644 --- a/lisp/mm-decode.el +++ b/lisp/mm-decode.el @@ -91,6 +91,9 @@ '("text/plain" "text/enriched" "text/richtext" "text/html" "image/.*" "message/delivery-status" "multipart/.*")) +(defvar mm-user-automatic-external-display nil + "List of MIME type regexps that will be displayed externally automatically.") + (defvar mm-alternative-precedence '("image/jpeg" "image/gif" "text/html" "text/enriched" "text/richtext" "text/plain") @@ -99,6 +102,9 @@ (defvar mm-tmp-directory "/tmp/" "Where mm will store its temporary files.") +(defvar mm-all-images-fit nil + "If non-nil, then all images fit in the buffer.") + ;;; Internal variables. (defvar mm-dissection-list nil) @@ -399,6 +405,16 @@ external if displayed external." methods nil))) result)) +(defun mm-automatic-external-display-p (type) + "Return the user-defined method for TYPE." + (let ((methods mm-user-automatic-external-display) + method result) + (while (setq method (pop methods)) + (when (string-match method type) + (setq result t + methods nil))) + result)) + (defun add-mime-display-method (type method) "Make parts of TYPE be displayed with METHOD. This overrides entries in the mailcap file." @@ -541,8 +557,9 @@ This overrides entries in the mailcap file." (defun mm-image-fit-p (handle) "Say whether the image in HANDLE will fit the current window." (let ((image (mm-get-image handle))) - (and (< (glyph-width image) (window-pixel-width)) - (< (glyph-height image) (window-pixel-height))))) + (or mm-all-images-fit + (and (< (glyph-width image) (window-pixel-width)) + (< (glyph-height image) (window-pixel-height)))))) (provide 'mm-decode) diff --git a/lisp/mm-uu.el b/lisp/mm-uu.el index 50b5310..e7d2e44 100644 --- a/lisp/mm-uu.el +++ b/lisp/mm-uu.el @@ -2,7 +2,7 @@ ;; Copyright (c) 1998 by Shenghuo Zhu ;; Author: Shenghuo Zhu -;; $Revision: 1.1.1.4 $ +;; $Revision: 1.1.1.5 $ ;; Keywords: news postscript uudecode binhex shar ;; This file is not part of GNU Emacs, but the same permissions @@ -118,16 +118,16 @@ (error nil)))) (if (> start-char text-start) (push - (list (mm-uu-copy-to-buffer text-start start-char) - text-plain-type cte nil nil nil) + (mm-make-handle (mm-uu-copy-to-buffer text-start start-char) + text-plain-type cte) result)) (push (cond ((eq type 'postscript) - (list (mm-uu-copy-to-buffer start-char end-char) - '("application/postscript") nil nil nil nil)) + (mm-make-handle (mm-uu-copy-to-buffer start-char end-char) + '("application/postscript"))) ((eq type 'uu) - (list (mm-uu-copy-to-buffer start-char end-char) + (mm-make-handle (mm-uu-copy-to-buffer start-char end-char) (list (or (and file-name (string-match "\\.[^\\.]+$" file-name) (mailcap-extension-to-mime @@ -135,10 +135,9 @@ "application/octet-stream")) mm-uu-decode-function nil (if (and file-name (not (equal file-name ""))) - (list "attachment" (cons 'filename file-name))) - file-name)) + (list "attachment" (cons 'filename file-name))))) ((eq type 'binhex) - (list (mm-uu-copy-to-buffer start-char end-char) + (mm-make-handle (mm-uu-copy-to-buffer start-char end-char) (list (or (and file-name (string-match "\\.[^\\.]+$" file-name) (mailcap-extension-to-mime @@ -146,18 +145,17 @@ "application/octet-stream")) mm-uu-binhex-decode-function nil (if (and file-name (not (equal file-name ""))) - (list "attachment" (cons 'filename file-name))) - file-name)) + (list "attachment" (cons 'filename file-name))))) ((eq type 'shar) - (list (mm-uu-copy-to-buffer start-char end-char) - '("application/x-shar") nil nil nil nil))) + (mm-make-handle (mm-uu-copy-to-buffer start-char end-char) + '("application/x-shar")))) result) (setq text-start end-char)))) (when result (if (> (point-max) (1+ text-start)) (push - (list (mm-uu-copy-to-buffer text-start (point-max)) - text-plain-type cte nil nil nil) + (mm-make-handle (mm-uu-copy-to-buffer text-start (point-max)) + text-plain-type cte) result)) (setq result (cons "multipart/mixed" (nreverse result)))) result))) diff --git a/lisp/mml.el b/lisp/mml.el index 1cc8cc6..f788a9e 100644 --- a/lisp/mml.el +++ b/lisp/mml.el @@ -129,7 +129,7 @@ (defun mml-generate-mime-1 (cont) (cond ((eq (car cont) 'part) - (let (coded encoding charset filename type parameters) + (let (coded encoding charset filename type) (setq type (or (cdr (assq 'type cont)) "text/plain")) (if (equal (car (split-string type "/")) "text") (with-temp-buffer @@ -141,7 +141,7 @@ ;; Remove quotes from quoted tags. (goto-char (point-min)) (while (re-search-forward - "<#!+\\(part\\|multipart\\|external\\)" nil t) + "<#!+/?\\(part\\|multipart\\|external\\)" nil t) (delete-region (+ (match-beginning 0) 2) (+ (match-beginning 0) 3))))) (setq charset (mm-encode-body) @@ -246,6 +246,9 @@ (mml-parameter-string cont '(name access-type expiration size permission))) (not (equal type "text/plain"))) + (when (listp charset) + (error + "Can't encode a part with several charsets. Insert a <#part>.")) (insert "Content-Type: " type) (when charset (insert "; " (mail-header-encode-parameter diff --git a/lisp/nndoc.el b/lisp/nndoc.el index be026de..a15cd40 100644 --- a/lisp/nndoc.el +++ b/lisp/nndoc.el @@ -453,18 +453,18 @@ from the document.") (limit (search-forward "\n\n" nil t))) (goto-char (point-min)) (when (and limit - (re-search-forward - (concat "\ -^Content-Type:[ \t]*multipart/[a-z]+ *;\\(.*;\\)*" - "[ \t\n]*[ \t]boundary=\"?[^\"\n]*[^\" \t\n]") - limit t)) + (re-search-forward + (concat "\ +^Content-Type:[ \t]*multipart/[a-z]+ *;\\(\\(\n[ \t]\\)?.*;\\)*" + "\\(\n[ \t]\\)?[ \t]*boundary=\"?[^\"\n]*[^\" \t\n]") + limit t)) t))) (defun nndoc-transform-mime-parts (article) (let* ((entry (cdr (assq article nndoc-dissection-alist))) (headers (nth 5 entry))) (when headers - (goto-char (point-min)) + (goto-char (point-min)) (insert headers)))) (defun nndoc-generate-mime-parts-head (article) diff --git a/texi/ChangeLog b/texi/ChangeLog index 0cecc0b..700c4ad 100644 --- a/texi/ChangeLog +++ b/texi/ChangeLog @@ -1,3 +1,7 @@ +1998-12-02 01:04:22 Lars Magne Ingebrigtsen + + * gnus.texi (Emacsen): Addition. + 1998-12-01 00:27:04 Lars Magne Ingebrigtsen * emacs-mime.texi (rfc2045): New. diff --git a/texi/emacs-mime.texi b/texi/emacs-mime.texi index 916878d..d45602a 100644 --- a/texi/emacs-mime.texi +++ b/texi/emacs-mime.texi @@ -276,8 +276,8 @@ Decode the encoded words in the string and return the result. @end table Currently, @code{mail-parse} is an abstraction over @code{ietf-drums}, -@code{rfc2047} and @code{rfc2231}. These are documented in the -subsequent sections. +@code{rfc2047}, @code{rfc2045} and @code{rfc2231}. These are documented +in the subsequent sections. diff --git a/texi/gnus.texi b/texi/gnus.texi index b24ab75..64e2832 100644 --- a/texi/gnus.texi +++ b/texi/gnus.texi @@ -1,7 +1,7 @@ \input texinfo @c -*-texinfo-*- @setfilename gnus -@settitle Pterodactyl Gnus 0.58 Manual +@settitle Pterodactyl Gnus 0.59 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 Pterodactyl Gnus 0.58 Manual +@title Pterodactyl Gnus 0.59 Manual @author by Lars Magne Ingebrigtsen @page @@ -354,7 +354,7 @@ can be gotten by any nefarious means you can think of---@sc{nntp}, local spool or your mbox file. All at the same time, if you want to push your luck. -This manual corresponds to Pterodactyl Gnus 0.58. +This manual corresponds to Pterodactyl Gnus 0.59. @end ifinfo @@ -16208,15 +16208,16 @@ Gnus should work on : @itemize @bullet @item -Emacs 20.2 and up. +Emacs 20.3 and up. @item XEmacs 20.4 and up. @end itemize -Gnus will absolutely not work on any Emacsen older than that. Not -reliably, at least. +This Gnus version will absolutely not work on any Emacsen older than +that. Not reliably, at least. Older versions of Gnus may work on older +Emacs versions. There are some vague differences between Gnus on the various platforms---XEmacs features more graphics (a logo and a toolbar)---but diff --git a/texi/message.texi b/texi/message.texi index d65d8d4..68fb7e9 100644 --- a/texi/message.texi +++ b/texi/message.texi @@ -1,7 +1,7 @@ \input texinfo @c -*-texinfo-*- @setfilename message -@settitle Pterodactyl Message 0.58 Manual +@settitle Pterodactyl Message 0.59 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 Pterodactyl Message 0.58 Manual +@title Pterodactyl Message 0.59 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 Pterodactyl Message 0.58. Message is +This manual corresponds to Pterodactyl Message 0.59. Message is distributed with the Gnus distribution bearing the same version number as this manual. -- 1.7.10.4