diff options
| author | ShengHuo ZHU | 2001-12-05 19:27:45 +0000 |
|---|---|---|
| committer | ShengHuo ZHU | 2001-12-05 19:27:45 +0000 |
| commit | 4e72858007331f2e5866907e20a236afe49174ce (patch) | |
| tree | c8c9f62118bcb795f07434f4aa817e25698b31fa | |
| parent | a17c90638b08f5d3f2c4167ff7c93aa72f10e84d (diff) | |
| download | emacs-4e72858007331f2e5866907e20a236afe49174ce.tar.gz emacs-4e72858007331f2e5866907e20a236afe49174ce.zip | |
2001-12-05 ShengHuo ZHU <zsh@cs.rochester.edu>
* mm-view.el: Partially sync with the Gnus CVS.
* gnus-sum.el (gnus-summary-save-article): Nix
gnus-display-mime-function and gnus-article-prepare-hook.
| -rw-r--r-- | lisp/gnus/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/gnus/gnus-sum.el | 4 | ||||
| -rw-r--r-- | lisp/gnus/mm-view.el | 70 |
3 files changed, 54 insertions, 26 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 5ce04c5c18f..bd1d3a8bf5b 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2001-12-05 ShengHuo ZHU <zsh@cs.rochester.edu> | ||
| 2 | |||
| 3 | * mm-view.el: Partially sync with the Gnus CVS. | ||
| 4 | * gnus-sum.el (gnus-summary-save-article): Nix | ||
| 5 | gnus-display-mime-function and gnus-article-prepare-hook. | ||
| 6 | |||
| 1 | 2001-12-01 ShengHuo ZHU <zsh@cs.rochester.edu> | 7 | 2001-12-01 ShengHuo ZHU <zsh@cs.rochester.edu> |
| 2 | 8 | ||
| 3 | * message.el (message-mail): Add send-actions. | 9 | * message.el (message-mail): Add send-actions. |
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 86e7d31b713..caee55d4785 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el | |||
| @@ -9148,7 +9148,9 @@ The variable `gnus-default-article-saver' specifies the saver function." | |||
| 9148 | (gnus-message 1 "Article %d is unsaveable" article)) | 9148 | (gnus-message 1 "Article %d is unsaveable" article)) |
| 9149 | ;; This is a real article. | 9149 | ;; This is a real article. |
| 9150 | (save-window-excursion | 9150 | (save-window-excursion |
| 9151 | (gnus-summary-select-article t nil nil article)) | 9151 | (let ((gnus-display-mime-function nil) |
| 9152 | (gnus-article-prepare-hook nil)) | ||
| 9153 | (gnus-summary-select-article t nil nil article))) | ||
| 9152 | (save-excursion | 9154 | (save-excursion |
| 9153 | (set-buffer save-buffer) | 9155 | (set-buffer save-buffer) |
| 9154 | (erase-buffer) | 9156 | (erase-buffer) |
diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el index 89b0e5e458c..2fa24a72855 100644 --- a/lisp/gnus/mm-view.el +++ b/lisp/gnus/mm-view.el | |||
| @@ -50,10 +50,11 @@ | |||
| 50 | `(lambda () (remove-images ,b (1+ ,b)))))) | 50 | `(lambda () (remove-images ,b (1+ ,b)))))) |
| 51 | 51 | ||
| 52 | (defun mm-inline-image-xemacs (handle) | 52 | (defun mm-inline-image-xemacs (handle) |
| 53 | (insert "\n") | ||
| 54 | (forward-char -1) | ||
| 53 | (let ((b (point)) | 55 | (let ((b (point)) |
| 54 | (annot (make-annotation (mm-get-image handle) nil 'text)) | 56 | (annot (make-annotation (mm-get-image handle) nil 'text)) |
| 55 | buffer-read-only) | 57 | buffer-read-only) |
| 56 | (insert "\n") | ||
| 57 | (mm-handle-set-undisplayer | 58 | (mm-handle-set-undisplayer |
| 58 | handle | 59 | handle |
| 59 | `(lambda () | 60 | `(lambda () |
| @@ -104,11 +105,14 @@ | |||
| 104 | (and (boundp 'w3-meta-charset-content-type-regexp) | 105 | (and (boundp 'w3-meta-charset-content-type-regexp) |
| 105 | (re-search-forward | 106 | (re-search-forward |
| 106 | w3-meta-charset-content-type-regexp nil t))) | 107 | w3-meta-charset-content-type-regexp nil t))) |
| 107 | (setq charset (or (w3-coding-system-for-mime-charset | 108 | (setq charset |
| 108 | (buffer-substring-no-properties | 109 | (or (let ((bsubstr (buffer-substring-no-properties |
| 109 | (match-beginning 2) | 110 | (match-beginning 2) |
| 110 | (match-end 2))) | 111 | (match-end 2)))) |
| 111 | charset))) | 112 | (if (fboundp 'w3-coding-system-for-mime-charset) |
| 113 | (w3-coding-system-for-mime-charset bsubstr) | ||
| 114 | (mm-charset-to-coding-system bsubstr))) | ||
| 115 | charset))) | ||
| 112 | (delete-region (point-min) (point-max)) | 116 | (delete-region (point-min) (point-max)) |
| 113 | (insert (mm-decode-string text charset)) | 117 | (insert (mm-decode-string text charset)) |
| 114 | (save-window-excursion | 118 | (save-window-excursion |
| @@ -120,7 +124,21 @@ | |||
| 120 | (url-standalone-mode t)) | 124 | (url-standalone-mode t)) |
| 121 | (condition-case var | 125 | (condition-case var |
| 122 | (w3-region (point-min) (point-max)) | 126 | (w3-region (point-min) (point-max)) |
| 123 | (error))))) | 127 | (error |
| 128 | (delete-region (point-min) (point-max)) | ||
| 129 | (let ((b (point)) | ||
| 130 | (charset (mail-content-type-get | ||
| 131 | (mm-handle-type handle) 'charset))) | ||
| 132 | (if (or (eq charset 'gnus-decoded) | ||
| 133 | (eq mail-parse-charset 'gnus-decoded)) | ||
| 134 | (save-restriction | ||
| 135 | (narrow-to-region (point) (point)) | ||
| 136 | (mm-insert-part handle) | ||
| 137 | (goto-char (point-max))) | ||
| 138 | (insert (mm-decode-string (mm-get-part handle) | ||
| 139 | charset)))) | ||
| 140 | (message | ||
| 141 | "Error while rendering html; showing as text/plain")))))) | ||
| 124 | (mm-handle-set-undisplayer | 142 | (mm-handle-set-undisplayer |
| 125 | handle | 143 | handle |
| 126 | `(lambda () | 144 | `(lambda () |
| @@ -133,33 +151,28 @@ | |||
| 133 | '(background background-pixmap foreground))) | 151 | '(background background-pixmap foreground))) |
| 134 | (delete-region ,(point-min-marker) | 152 | (delete-region ,(point-min-marker) |
| 135 | ,(point-max-marker))))))))) | 153 | ,(point-max-marker))))))))) |
| 136 | ((or (equal type "enriched") | ||
| 137 | (equal type "richtext")) | ||
| 138 | (save-excursion | ||
| 139 | (mm-with-unibyte-buffer | ||
| 140 | (mm-insert-part handle) | ||
| 141 | (save-window-excursion | ||
| 142 | (enriched-decode (point-min) (point-max)) | ||
| 143 | (setq text (buffer-string))))) | ||
| 144 | (mm-insert-inline handle text)) | ||
| 145 | ((equal type "x-vcard") | 154 | ((equal type "x-vcard") |
| 146 | (mm-insert-inline | 155 | (mm-insert-inline |
| 147 | handle | 156 | handle |
| 148 | (concat "\n-- \n" | 157 | (concat "\n-- \n" |
| 149 | (if (fboundp 'vcard-pretty-print) | 158 | (ignore-errors |
| 150 | (vcard-pretty-print (mm-get-part handle)) | 159 | (if (fboundp 'vcard-pretty-print) |
| 151 | (vcard-format-string | 160 | (vcard-pretty-print (mm-get-part handle)) |
| 152 | (vcard-parse-string (mm-get-part handle) | 161 | (vcard-format-string |
| 153 | 'vcard-standard-filter)))))) | 162 | (vcard-parse-string (mm-get-part handle) |
| 163 | 'vcard-standard-filter))))))) | ||
| 154 | (t | 164 | (t |
| 155 | (let ((b (point)) | 165 | (let ((b (point)) |
| 156 | (charset (mail-content-type-get | 166 | (charset (mail-content-type-get |
| 157 | (mm-handle-type handle) 'charset))) | 167 | (mm-handle-type handle) 'charset))) |
| 158 | (if (or (eq charset 'gnus-decoded) | 168 | (if (or (eq charset 'gnus-decoded) |
| 159 | ;; This is probably not entirely correct, but | 169 | ;; This is probably not entirely correct, but |
| 160 | ;; makes rfc822 parts with embedded multiparts work. | 170 | ;; makes rfc822 parts with embedded multiparts work. |
| 161 | (eq mail-parse-charset 'gnus-decoded)) | 171 | (eq mail-parse-charset 'gnus-decoded)) |
| 162 | (mm-insert-part handle) | 172 | (save-restriction |
| 173 | (narrow-to-region (point) (point)) | ||
| 174 | (mm-insert-part handle) | ||
| 175 | (goto-char (point-max))) | ||
| 163 | (insert (mm-decode-string (mm-get-part handle) charset))) | 176 | (insert (mm-decode-string (mm-get-part handle) charset))) |
| 164 | (when (and (equal type "plain") | 177 | (when (and (equal type "plain") |
| 165 | (equal (cdr (assoc 'format (mm-handle-type handle))) | 178 | (equal (cdr (assoc 'format (mm-handle-type handle))) |
| @@ -172,6 +185,9 @@ | |||
| 172 | (save-restriction | 185 | (save-restriction |
| 173 | (narrow-to-region b (point)) | 186 | (narrow-to-region b (point)) |
| 174 | (set-text-properties (point-min) (point-max) nil) | 187 | (set-text-properties (point-min) (point-max) nil) |
| 188 | (when (or (equal type "enriched") | ||
| 189 | (equal type "richtext")) | ||
| 190 | (enriched-decode (point-min) (point-max))) | ||
| 175 | (mm-handle-set-undisplayer | 191 | (mm-handle-set-undisplayer |
| 176 | handle | 192 | handle |
| 177 | `(lambda () | 193 | `(lambda () |
| @@ -219,6 +235,7 @@ | |||
| 219 | 235 | ||
| 220 | (defun mm-inline-message (handle) | 236 | (defun mm-inline-message (handle) |
| 221 | (let ((b (point)) | 237 | (let ((b (point)) |
| 238 | (bolp (bolp)) | ||
| 222 | (charset (mail-content-type-get | 239 | (charset (mail-content-type-get |
| 223 | (mm-handle-type handle) 'charset)) | 240 | (mm-handle-type handle) 'charset)) |
| 224 | gnus-displaying-mime handles) | 241 | gnus-displaying-mime handles) |
| @@ -232,13 +249,16 @@ | |||
| 232 | (narrow-to-region b b) | 249 | (narrow-to-region b b) |
| 233 | (mm-insert-part handle) | 250 | (mm-insert-part handle) |
| 234 | (let (gnus-article-mime-handles | 251 | (let (gnus-article-mime-handles |
| 235 | ;; disable prepare hook | 252 | ;; disable prepare hook |
| 236 | gnus-article-prepare-hook | 253 | gnus-article-prepare-hook |
| 237 | (gnus-newsgroup-charset | 254 | (gnus-newsgroup-charset |
| 238 | (or charset gnus-newsgroup-charset))) | 255 | (or charset gnus-newsgroup-charset))) |
| 239 | (run-hooks 'gnus-article-decode-hook) | 256 | (run-hooks 'gnus-article-decode-hook) |
| 240 | (gnus-article-prepare-display) | 257 | (gnus-article-prepare-display) |
| 241 | (setq handles gnus-article-mime-handles)) | 258 | (setq handles gnus-article-mime-handles)) |
| 259 | (goto-char (point-min)) | ||
| 260 | (unless bolp | ||
| 261 | (insert "\n")) | ||
| 242 | (goto-char (point-max)) | 262 | (goto-char (point-max)) |
| 243 | (unless (bolp) | 263 | (unless (bolp) |
| 244 | (insert "\n")) | 264 | (insert "\n")) |