From 22d724d286bb990174903087817eb5c5bef13762 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Sun, 4 Jun 2000 23:17:32 +0000 Subject: [PATCH] Sync with Gnus. --- lisp/ChangeLog | 20 ++++++++++++++++++++ lisp/gnus-art.el | 4 ++++ lisp/message.el | 6 +++--- lisp/mml.el | 29 +++++++++++++++++++---------- 4 files changed, 46 insertions(+), 13 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d3837a7..8d72fa0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,23 @@ +2000-06-04 15:05:16 Shenghuo ZHU + + * message.el (message-read-from-minibuffer): Typo. + +2000-06-03 13:36:46 Shenghuo ZHU + + * gnus-art.el (article-decode-charset): Override non-MIME forward + charset. + +2000-06-02 12:04:26 Shenghuo ZHU + + * mml.el (mml-quote-region): Correct the regexp. + * gnus-msg.el (gnus-summary-reply): mml-quote it. + +2000-06-02 11:57:15 Shenghuo ZHU + + * message.el (message-forward): Insert raw text. + * mml.el (mml-parse-1): Get raw text in unibyte mode. + (mml-generate-mime-1): Insert raw text in unibyte mode. + 2000-06-01 Florian Weimer * mm-bodies.el (mm-body-encoding): Always encoded if diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index b80b679..4fed579 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -1627,6 +1627,10 @@ If PROMPT (the prefix), prompt for a coding system to use." (forward-line 1) (save-restriction (narrow-to-region (point) (point-max)) + (if (and (eq mail-parse-charset 'gnus-decoded) + (eq (mm-body-7-or-8) '8bit)) + ;; The text code could have been decoded. + (setq charset mail-parse-charset)) (when (and (or (not ctl) (equal (car ctl) "text/plain")) (not format)) ;; article with format will decode later. diff --git a/lisp/message.el b/lisp/message.el index 8e9dbd9..98eeae0 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -5376,9 +5376,9 @@ regexp varstr." (if (fboundp 'mail-abbrevs-setup) (let ((mail-abbrev-mode-regexp "") (minibuffer-setup-hook 'mail-abbrevs-setup)) - (read-from-minibuffer prompt))) - (let ((minibuffer-setup-hook 'mail-abbrev-minibuffer-setup-hook)) - (read-string prompt))) + (read-from-minibuffer prompt)) + (let ((minibuffer-setup-hook 'mail-abbrev-minibuffer-setup-hook)) + (read-string prompt)))) (defvar message-save-buffer " *encoding") (defun message-save-drafts () diff --git a/lisp/mml.el b/lisp/mml.el index 5448fba..d4a04b6 100644 --- a/lisp/mml.el +++ b/lisp/mml.el @@ -107,7 +107,7 @@ The function is called with one parameter, which is the generated part.") (defun mml-parse-1 () "Parse the current buffer as an MML document." - (let (struct tag point contents charsets warn use-ascii no-markup-p) + (let (struct tag point contents charsets warn use-ascii no-markup-p raw) (while (and (not (eobp)) (not (looking-at "<#/multipart"))) (cond @@ -124,10 +124,15 @@ The function is called with one parameter, which is the generated part.") (setq tag (list 'part '(type . "text/plain")) no-markup-p t warn t)) - (setq point (point) - contents (mml-read-part (eq 'mml (car tag))) - charsets (mm-find-mime-charset-region point (point))) - (when (memq nil charsets) + (setq raw (cdr (assq 'raw tag)) + point (point) + contents (if raw + (mm-with-unibyte-current-buffer + (mml-read-part (eq 'mml (car tag)))) + (mml-read-part (eq 'mml (car tag)))) + charsets (if raw nil + (mm-find-mime-charset-region point (point)))) + (when (and (not raw) (memq nil charsets)) (if (or (memq 'unknown-encoding mml-confirmation-set) (y-or-n-p "Warning: You message contains characters with unknown encoding. Really send?")) @@ -137,7 +142,8 @@ The function is called with one parameter, which is the generated part.") (setq charsets (delq nil charsets)) (setq warn nil)) (error "Edit your message to remove those characters"))) - (if (or (eq 'mml (car tag)) + (if (or raw + (eq 'mml (car tag)) (< (length charsets) 2)) (if (or (not no-markup-p) (string-match "[^ \t\r\n]" contents)) @@ -290,9 +296,11 @@ If MML is non-nil, return the buffer up till the correspondent mml tag." (funcall mml-generate-mime-preprocess-function cont)) (cond ((or (eq (car cont) 'part) (eq (car cont) 'mml)) - (let (coded encoding charset filename type) + (let ((raw (cdr (assq 'raw cont))) + coded encoding charset filename type) (setq type (or (cdr (assq 'type cont)) "text/plain")) - (if (member (car (split-string type "/")) '("text" "message")) + (if (and (not raw) + (member (car (split-string type "/")) '("text" "message"))) (with-temp-buffer (cond ((cdr (assq 'buffer cont)) @@ -344,7 +352,8 @@ If MML is non-nil, return the buffer up till the correspondent mml tag." coded (buffer-string)))) (mml-insert-mime-headers cont type charset encoding) (insert "\n") - (insert coded))) + (mm-with-unibyte-current-buffer + (insert coded)))) ((eq (car cont) 'external) (insert "Content-Type: message/external-body") (let ((parameters (mml-parameter-string @@ -744,7 +753,7 @@ If MML is non-nil, return the buffer up till the correspondent mml tag." (goto-char (point-min)) ;; Quote parts. (while (re-search-forward - "<#/?!*\\(multipart\\|part\\|external\\|mml\\)" nil t) + "<#!*/?\\(multipart\\|part\\|external\\|mml\\)" nil t) ;; Insert ! after the #. (goto-char (+ (match-beginning 0) 2)) (insert "!"))))) -- 1.7.10.4