From 14a0423cdf6dfa0901c35f3028006336b94d4f1c Mon Sep 17 00:00:00 2001 From: yamaoka Date: Tue, 15 Dec 1998 22:43:07 +0000 Subject: [PATCH] Sync up with Pterodactyl Gnus v0.68. --- lisp/ChangeLog | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++ lisp/gnus-art.el | 21 +++++------ lisp/gnus-draft.el | 7 ++-- lisp/gnus-mailcap.el | 3 +- lisp/gnus-picon.el | 9 +++-- lisp/gnus-sum.el | 14 ++++---- lisp/gnus-xmas.el | 4 ++- lisp/gnus.el | 4 +-- lisp/message.el | 18 ++++++++++ lisp/mm-bodies.el | 56 ++++++++++++++--------------- lisp/mm-decode.el | 9 ++++- lisp/mm-encode.el | 2 ++ lisp/mm-util.el | 15 ++++++++ lisp/mm-uu.el | 6 ++-- lisp/mm-view.el | 7 ++++ lisp/mml.el | 3 +- lisp/nnfolder.el | 5 ++- lisp/nnmail.el | 6 +++- 18 files changed, 222 insertions(+), 65 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 744da48..1b2cead 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,101 @@ +Tue Dec 15 19:17:43 1998 Lars Magne Ingebrigtsen + + * gnus.el: Pterodactyl Gnus v0.68 is released. + +Tue Dec 15 18:28:24 1998 Lars Magne Ingebrigtsen + + * gnus.el: Pterodactyl Gnus v0.67 is released. + +Tue Dec 15 17:31:44 1998 Lars Magne Ingebrigtsen + + * gnus.el: Pterodactyl Gnus v0.66 is released. + +1998-12-13 11:00:43 Lars Magne Ingebrigtsen + + * gnus-art.el (gnus-insert-mime-button): Decode description. + +Sat Dec 5 16:50:49 1998 Shenghuo ZHU + + * gnus-art.el (article-decode-encoded-words): Rollback to 0.55. + (gnus-decode-header-methods): Ditto. + (gnus-decode-with-mail-decode-encoded-word-region): Ditto. + +1998-12-13 10:04:39 Lloyd Zusman + + * gnus-xmas.el (gnus-xmas-summary-recenter): Allow numbers. + +1998-12-13 09:32:38 Lars Magne Ingebrigtsen + + * mml.el (mml-insert-mime-headers): Encode description. + + * nnfolder.el (nnfolder-request-expire-articles): Go to the date + line. + + * gnus-sum.el (gnus-default-charset): Doc fix. + +Wed Dec 9 15:18:39 1998 Shenghuo ZHU + + * mm-decode.el (mm-display-part): Forward a line. + +Wed Dec 9 13:30:29 1998 Shenghuo ZHU + + * mm-util.el (mm-running-ntemacs): New variable. + (mm-text-coding-system): Ditto. + * nnmail.el (nnmail-incoming-coding-system): Ditto. + (nnmail-split-incoming): Use nnmail-incoming-coding-system. + +1998-12-13 08:52:45 Lars Magne Ingebrigtsen + + * gnus-picon.el (gnus-picons-network-display-internal): Don't set + buffer. + + * message.el (message-insert-headers): New command and keystroke. + +1998-12-07 23:42:14 Lars Magne Ingebrigtsen + + * mm-decode.el (mm-inline-media-tests): Recognize x-xbitmap. + (mm-get-image): Ditto. + + * mm-bodies.el (mm-decode-content-transfer-encoding): Only for + base64, uudecode and binhex. + +Sun Dec 6 21:58:31 1998 Shenghuo ZHU + + * mm-bodies.el (mm-decode-content-transfer-encoding): Replace CRLF + in text/plain. + * mm-uu.el (mm-uu-dissect): Use inline. + +1998-12-07 23:19:14 Lars Magne Ingebrigtsen + + * mm-view.el (mm-view-message): New function. + + * mm-encode.el (mm-content-transfer-encoding-defaults): Changed to + qp. + +1998-12-07 Karl Kleinpaste + + * mm-encode.el (mm-content-transfer-encoding-defaults): Add an + entry for message/rfc822 as 8bit. + +1998-12-07 23:16:54 Lars Magne Ingebrigtsen + + * mailcap.el (mailcap-mime-extensions): Add patch. + +1998-12-05 Dale Hagglund + + * gnus-sum.el (gnus-summary-display-buttonized): Use prefix + argument to force all multipart/* to look like multipart/mixed. + + * gnus-art.el (gnus-mime-display-multipart-as-mixed): New + variable. + (gnus-mime-display-part): Use it. + +1998-12-07 22:46:37 Lars Magne Ingebrigtsen + + * gnus-draft.el (gnus-draft-send): Only disable checks for + non-interactive use. + (gnus-draft-send-message): Use it. + Sun Dec 6 19:36:53 1998 Lars Magne Ingebrigtsen * gnus.el: Pterodactyl Gnus v0.65 is released. diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index 29d7281..5d34e5d 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -2359,6 +2359,7 @@ If ALL-HEADERS is non-nil, no headers are hidden." (set-window-point (get-buffer-window (current-buffer)) (point)) t)))))) +;;;###autoload (defun gnus-article-prepare-display () "Make the current buffer look like a nice article." (let ((method @@ -2624,8 +2625,9 @@ If ALL-HEADERS is non-nil, no headers are hidden." 'filename) "")) (gnus-tmp-type (car (mm-handle-type handle))) - (gnus-tmp-description (or (mm-handle-description handle) - "")) + (gnus-tmp-description + (mail-decode-encoded-word-string (or (mm-handle-description handle) + ""))) (gnus-tmp-dots (if (if displayed (car displayed) (mm-handle-displayed-p handle)) @@ -2702,18 +2704,22 @@ If ALL-HEADERS is non-nil, no headers are hidden." (delete-region (point) (point-max))) (gnus-mime-display-part handles)))))) +(defvar gnus-mime-display-multipart-as-mixed nil) + (defun gnus-mime-display-part (handle) (cond ;; Single part. ((not (stringp (car handle))) (gnus-mime-display-single handle)) ;; multipart/alternative - ((equal (car handle) "multipart/alternative") + ((and (equal (car handle) "multipart/alternative") + (not gnus-mime-display-multipart-as-mixed)) (let ((id (1+ (length gnus-article-mime-handle-alist)))) (push (cons id handle) gnus-article-mime-handle-alist) (gnus-mime-display-alternative (cdr handle) nil nil id))) ;; multipart/related - ((equal (car handle) "multipart/related") + ((and (equal (car handle) "multipart/related") + (not gnus-mime-display-multipart-as-mixed)) ;;;!!!We should find the start part, but we just default ;;;!!!to the first part. (gnus-mime-display-part (cadr handle))) @@ -4115,7 +4121,7 @@ forbidden in URL encoding." (select-window win))) (defvar gnus-decode-header-methods - '(gnus-decode-with-mail-decode-encoded-word-region) + '(mail-decode-encoded-word-region) "List of methods used to decode headers. This variable is a list of FUNCTION or (REGEXP . FUNCTION). If item is @@ -4131,11 +4137,6 @@ For example: (defvar gnus-decode-header-methods-cache nil) -(defun gnus-decode-with-mail-decode-encoded-word-region (start end) - (let ((rfc2047-default-charset gnus-newsgroup-default-charset) - (mm-charset-iso-8859-1-forced gnus-newsgroup-iso-8859-1-forced)) - (mail-decode-encoded-word-region start end))) - (defun gnus-multi-decode-header (start end) "Apply the functions from `gnus-encoded-word-methods' that match." (unless (and gnus-decode-header-methods-cache diff --git a/lisp/gnus-draft.el b/lisp/gnus-draft.el index 4136b5e..6148b5a 100644 --- a/lisp/gnus-draft.el +++ b/lisp/gnus-draft.el @@ -117,13 +117,14 @@ (while (setq article (pop articles)) (gnus-summary-remove-process-mark article) (unless (memq article gnus-newsgroup-unsendable) - (gnus-draft-send article gnus-newsgroup-name) + (gnus-draft-send article gnus-newsgroup-name t) (gnus-summary-mark-article article gnus-canceled-mark))))) -(defun gnus-draft-send (article &optional group) +(defun gnus-draft-send (article &optional group interactive) "Send message ARTICLE." (gnus-draft-setup-for-sending article (or group "nndraft:queue")) - (let ((message-syntax-checks 'dont-check-for-anything-just-trust-me) + (let ((message-syntax-checks (if interactive nil + 'dont-check-for-anything-just-trust-me)) message-send-hook type method) ;; We read the meta-information that says how and where ;; this message is to be sent. diff --git a/lisp/gnus-mailcap.el b/lisp/gnus-mailcap.el index be2a40c..ed62652 100644 --- a/lisp/gnus-mailcap.el +++ b/lisp/gnus-mailcap.el @@ -126,7 +126,7 @@ (type . "audio/*"))) ("message" ("rfc-*822" - (viewer . gnus-article-prepare-display) + (viewer . mm-view-message) (test . (and (featurep 'gnus) (gnus-alive-p))) (type . "message/rfc-822")) @@ -714,6 +714,7 @@ this type is returned." (".nc" . "application/x-netcdf") (".nc" . "application/x-netcdf") (".oda" . "application/oda") + (".patch" . "application/x-patch") (".pbm" . "image/x-portable-bitmap") (".pdf" . "application/pdf") (".pgm" . "image/portable-graymap") diff --git a/lisp/gnus-picon.el b/lisp/gnus-picon.el index 26dbb0d..8e35879 100644 --- a/lisp/gnus-picon.el +++ b/lisp/gnus-picon.el @@ -261,8 +261,8 @@ arguments necessary for the job.") (setq gnus-picons-processes-alist (delq process gnus-picons-processes-alist)) (gnus-picons-set-buffer) - (gnus-picons-make-annotation (make-glyph gnus-picons-x-face-file-name) - nil 'text) + (gnus-picons-make-annotation + (make-glyph gnus-picons-x-face-file-name) nil 'text) (when (file-exists-p gnus-picons-x-face-file-name) (delete-file gnus-picons-x-face-file-name)))) @@ -285,8 +285,8 @@ To use: (setq gnus-article-x-face-command 'gnus-picons-display-x-face)" nil 'text nil nil nil t))) ;; convert the x-face header to a .xbm file (let* ((process-connection-type nil) - (process (start-process-shell-command "gnus-x-face" nil - gnus-picons-convert-x-face))) + (process (start-process-shell-command + "gnus-x-face" nil gnus-picons-convert-x-face))) (push process gnus-picons-processes-alist) (process-kill-without-query process) (set-process-sentinel process 'gnus-picons-x-face-sentinel) @@ -619,7 +619,6 @@ none, and whose CDR is the corresponding element of DOMAINS." ;;; picon network display functions : (defun gnus-picons-network-display-internal (sym-ann glyph part right-p) - (gnus-picons-set-buffer) (gnus-picons-display-picon-or-name glyph part right-p) (gnus-picons-next-job-internal)) diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index e75633b..05df22f 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -811,8 +811,7 @@ which it may alter in any way.") :type 'regexp) (defcustom gnus-default-charset 'iso-8859-1 - "Default charset assumed to be used when viewing non-ASCII characters. -This variable is used only in non-Mule Emacsen.") + "Default charset assumed to be used when viewing non-ASCII characters.") (defcustom gnus-newsgroup-default-charset-alist '(("^hk\\>\\|^tw\\>\\|\\" . cn-big5) @@ -9200,11 +9199,14 @@ save those articles instead." ;;; MIME Commands ;;; -(defun gnus-summary-display-buttonized () - "Display the current article buffer fully MIME-buttonized." - (interactive) +(defun gnus-summary-display-buttonized (&optional show-all-parts) + "Display the current article buffer fully MIME-buttonized. +If SHOW-ALL-PARTS (the prefix) is non-nil, all multipart/* parts are +treated as multipart/mixed." + (interactive "P") (require 'gnus-art) - (let ((gnus-unbuttonized-mime-types nil)) + (let ((gnus-unbuttonized-mime-types nil) + (gnus-mime-display-multipart-as-mixed show-all-parts)) (gnus-summary-show-article))) (defun gnus-summary-repair-multipart (article) diff --git a/lisp/gnus-xmas.el b/lisp/gnus-xmas.el index dfc5251..083b188 100644 --- a/lisp/gnus-xmas.el +++ b/lisp/gnus-xmas.el @@ -182,7 +182,9 @@ displayed, no centering will be performed." (- (window-height) 2))) (top (cond ((< height 4) 0) ((< height 7) 1) - (t 2))) + (t (if (numberp gnus-auto-center-summary) + gnus-auto-center-summary + 2)))) (bottom (save-excursion (goto-char (point-max)) (forward-line (- height)) (point))) diff --git a/lisp/gnus.el b/lisp/gnus.el index 115a49d..867806b 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.050" +(defconst gnus-version-number "6.10.051" "Version number for this version of gnus.") -(defconst gnus-original-version-number "0.65" +(defconst gnus-original-version-number "0.68" "Version number for this version of Gnus.") (defconst gnus-original-product-name "Pterodactyl Gnus" diff --git a/lisp/message.el b/lisp/message.el index aeae6b8..25d5f18 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -1481,6 +1481,7 @@ Point is left at the beginning of the narrowed-to region." (define-key message-mode-map "\C-c\C-y" 'message-yank-original) (define-key message-mode-map "\C-c\C-q" 'message-fill-yanked-message) (define-key message-mode-map "\C-c\C-w" 'message-insert-signature) + (define-key message-mode-map "\C-c\M-h" 'message-insert-headers) (define-key message-mode-map "\C-c\C-r" 'message-caesar-buffer-body) (define-key message-mode-map "\C-c\C-o" 'message-sort-headers) (define-key message-mode-map "\C-c\M-r" 'message-rename-buffer) @@ -3821,6 +3822,23 @@ Headers already prepared in the buffer are not modified." (nndraft-request-expire-articles (list message-draft-article) "drafts" nil t))) +(defun message-insert-headers () + "Generate the headers for the article." + (interactive) + (save-excursion + (save-restriction + (message-narrow-to-headers) + (when (message-news-p) + (message-generate-headers + (delq 'Lines + (delq 'Subject + (copy-sequence message-required-news-headers))))) + (when (message-mail-p) + (message-generate-headers + (delq 'Lines + (delq 'Subject + (copy-sequence message-required-mail-headers)))))))) + ;;; diff --git a/lisp/mm-bodies.el b/lisp/mm-bodies.el index 6662702..6f46b92 100644 --- a/lisp/mm-bodies.el +++ b/lisp/mm-bodies.el @@ -119,36 +119,32 @@ If no encoding was done, nil is returned." ;;; (defun mm-decode-content-transfer-encoding (encoding &optional type) - (cond - ((eq encoding 'quoted-printable) - (quoted-printable-decode-region (point-min) (point-max))) - ((eq encoding 'base64) - (prog1 - (condition-case () - (base64-decode-region (point-min) (point-max)) - (error nil)) - (when (equal type "text/plain") - (goto-char (point-min)) - (while (search-forward "\r\n" nil t) - (replace-match "\n" t t))))) - ((memq encoding '(7bit 8bit binary)) - ) - ((null encoding) - ) - ((eq encoding 'x-uuencode) - (condition-case () - (uudecode-decode-region (point-min) (point-max)) - (error nil))) - ((eq encoding 'x-binhex) - (condition-case () - (binhex-decode-region (point-min) (point-max)) - (error nil))) - ((functionp encoding) - (condition-case () - (funcall encoding (point-min) (point-max)) - (error nil))) - (t - (message "Unknown encoding %s; defaulting to 8bit" encoding)))) + (prog1 + (condition-case () + (cond + ((eq encoding 'quoted-printable) + (quoted-printable-decode-region (point-min) (point-max))) + ((eq encoding 'base64) + (base64-decode-region (point-min) (point-max))) + ((memq encoding '(7bit 8bit binary)) + ) + ((null encoding) + ) + ((eq encoding 'x-uuencode) + (uudecode-decode-region (point-min) (point-max))) + ((eq encoding 'x-binhex) + (binhex-decode-region (point-min) (point-max))) + ((functionp encoding) + (funcall encoding (point-min) (point-max))) + (t + (message "Unknown encoding %s; defaulting to 8bit" encoding))) + (error nil)) + (when (and + (memq encoding '(base64 x-uuencode x-binhex)) + (equal type "text/plain")) + (goto-char (point-min)) + (while (search-forward "\r\n" nil t) + (replace-match "\n" t t))))) (defun mm-decode-body (charset &optional encoding type) "Decode the current article that has been encoded with ENCODING. diff --git a/lisp/mm-decode.el b/lisp/mm-decode.el index 56c9e80..d9b7489 100644 --- a/lisp/mm-decode.el +++ b/lisp/mm-decode.el @@ -65,6 +65,9 @@ ("image/xbm" mm-inline-image (and window-system (fboundp 'device-type) (eq (device-type) 'x))) + ("image/x-xbitmap" mm-inline-image + (and window-system (fboundp 'device-type) + (eq (device-type) 'x))) ("image/xpm" mm-inline-image (and window-system (featurep 'xpm))) ("image/x-pixmap" mm-inline-image @@ -236,7 +239,8 @@ external if displayed external." (if (eq user-method 'inline) (progn (forward-line 1) - (mm-display-inline handle)) + (mm-display-inline handle) + 'inline) (when (or user-method method (not no-default)) @@ -244,6 +248,7 @@ external if displayed external." (not method) (equal "text" (car (split-string type)))) (progn + (forward-line 1) (mm-insert-inline handle (mm-get-part handle)) 'inline) (mm-display-external @@ -558,6 +563,8 @@ This overrides entries in the mailcap file." (cond ((equal type "x-pixmap") "xpm") + ((equal type "x-xbitmap") + "xbm") (t type))) (or (mm-handle-cache handle) (mm-with-unibyte-buffer diff --git a/lisp/mm-encode.el b/lisp/mm-encode.el index ce742d1..af0111c 100644 --- a/lisp/mm-encode.el +++ b/lisp/mm-encode.el @@ -29,7 +29,9 @@ (defvar mm-content-transfer-encoding-defaults '(("text/.*" quoted-printable) + ("message/rfc822" quoted-printable) ("application/emacs-lisp" 8bit) + ("application/x-patch" 8bit) (".*" base64)) "Alist of regexps that match MIME types and their encodings.") diff --git a/lisp/mm-util.el b/lisp/mm-util.el index 13b5fdd..6da9c66 100644 --- a/lisp/mm-util.el +++ b/lisp/mm-util.el @@ -26,11 +26,26 @@ (defvar mm-running-xemacs (string-match "XEmacs" emacs-version)) +(defvar mm-running-ntemacs + (and (not mm-running-xemacs) + (string-match "nt" system-configuration))) + (defvar mm-binary-coding-system (if mm-running-xemacs 'binary 'no-conversion) "100% binary coding system.") +(defvar mm-text-coding-system + (cond + ((not (fboundp 'coding-system-p)) nil) + (mm-running-xemacs ;; XEmacs + (and (coding-system-p 'no-conversion) 'no-conversion)) + (mm-running-ntemacs ;; NTEmacs + (and (coding-system-p 'raw-text-dos) 'raw-text-dos)) + ((coding-system-p 'raw-text) 'raw-text) ;; Emacs + (t nil)) + "100% text coding system, for removing ^M.") + (defvar mm-default-coding-system nil "The default coding system to use.") diff --git a/lisp/mm-uu.el b/lisp/mm-uu.el index 30f9da4..0b54ecd 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.2.6 $ +;; $Revision: 1.1.2.7 $ ;; Keywords: news postscript uudecode binhex shar ;; This file is not part of GNU Emacs, but the same permissions @@ -137,7 +137,7 @@ "application/octet-stream")) mm-uu-decode-function nil (if (and file-name (not (equal file-name ""))) - (list "attachment" (cons 'filename file-name))))) + (list "inline" (cons 'filename file-name))))) ((eq type 'binhex) (mm-make-handle (mm-uu-copy-to-buffer start-char end-char) (list (or (and file-name @@ -147,7 +147,7 @@ "application/octet-stream")) mm-uu-binhex-decode-function nil (if (and file-name (not (equal file-name ""))) - (list "attachment" (cons 'filename file-name))))) + (list "inline" (cons 'filename file-name))))) ((eq type 'shar) (mm-make-handle (mm-uu-copy-to-buffer start-char end-char) '("application/x-shar")))) diff --git a/lisp/mm-view.el b/lisp/mm-view.el index 0380cf3..a4780bc 100644 --- a/lisp/mm-view.el +++ b/lisp/mm-view.el @@ -130,6 +130,13 @@ (require 'w3) (w3-prepare-buffer)) +(eval-and-compile + (autoload 'gnus-article-prepare-display "gnus-art")) + +(defun mm-view-message () + (gnus-article-prepare-display) + (fundamental-mode)) + (provide 'mm-view) ;; mm-view.el ends here diff --git a/lisp/mml.el b/lisp/mml.el index 7e27f6b..6a52d78 100644 --- a/lisp/mml.el +++ b/lisp/mml.el @@ -337,7 +337,8 @@ (unless (eq encoding '7bit) (insert (format "Content-Transfer-Encoding: %s\n" encoding))) (when (setq description (cdr (assq 'description cont))) - (insert "Content-Description: " description "\n")))) + (insert "Content-Description: " + (mail-encode-encoded-word-string description) "\n")))) (defun mml-parameter-string (cont types) (let ((string "") diff --git a/lisp/nnfolder.el b/lisp/nnfolder.el index 5d2562f..9160dd5 100644 --- a/lisp/nnfolder.el +++ b/lisp/nnfolder.el @@ -300,7 +300,10 @@ time saver for large mailboxes.") (set-buffer nnfolder-current-buffer) (while (and articles is-old) (goto-char (point-min)) - (when (nnfolder-goto-article (car articles)) + (when (and (nnfolder-goto-article (car articles)) + (search-forward (concat "\n" nnfolder-article-marker) + nil t)) + (forward-sexp) (if (setq is-old (nnmail-expired-article-p newsgroup diff --git a/lisp/nnmail.el b/lisp/nnmail.el index 335f44f..eec93cc 100644 --- a/lisp/nnmail.el +++ b/lisp/nnmail.el @@ -501,6 +501,9 @@ parameter. It should return nil, `warn' or `delete'." 'raw-text-dos 'binary) "Another coding system used in nnmail.") +(defvar nnmail-incoming-coding-system 'raw-text + "Coding system used in reading inbox") + (defun nnmail-find-file (file) "Insert FILE in server buffer safely." (set-buffer nntp-server-buffer) @@ -1007,7 +1010,8 @@ FUNC will be called with the buffer narrowed to each mail." ;; Insert the incoming file. (set-buffer (get-buffer-create " *nnmail incoming*")) (erase-buffer) - (nnheader-insert-file-contents incoming) + (let ((nnheader-file-coding-system nnmail-incoming-coding-system)) + (nnheader-insert-file-contents incoming)) (unless (zerop (buffer-size)) (goto-char (point-min)) (save-excursion (run-hooks 'nnmail-prepare-incoming-hook)) -- 1.7.10.4