diff options
| author | ShengHuo ZHU | 2001-11-06 04:29:38 +0000 |
|---|---|---|
| committer | ShengHuo ZHU | 2001-11-06 04:29:38 +0000 |
| commit | f4bb9409885a2b0b26dbaa77059d8628920530ff (patch) | |
| tree | 76c4a524e4ffbd7befd53064134a80e4f091c954 | |
| parent | 76fd45b3525469ba023ea3dff2724e36d3e5a8ce (diff) | |
| download | emacs-f4bb9409885a2b0b26dbaa77059d8628920530ff.tar.gz emacs-f4bb9409885a2b0b26dbaa77059d8628920530ff.zip | |
ident.
| -rw-r--r-- | lisp/gnus/mml.el | 114 |
1 files changed, 57 insertions, 57 deletions
diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el index 0bfe652c0c1..b3061239e6d 100644 --- a/lisp/gnus/mml.el +++ b/lisp/gnus/mml.el | |||
| @@ -133,7 +133,7 @@ The function is called with one parameter, which is the generated part.") | |||
| 133 | (when (and (not raw) (memq nil charsets)) | 133 | (when (and (not raw) (memq nil charsets)) |
| 134 | (if (or (memq 'unknown-encoding mml-confirmation-set) | 134 | (if (or (memq 'unknown-encoding mml-confirmation-set) |
| 135 | (prog1 (y-or-n-p | 135 | (prog1 (y-or-n-p |
| 136 | "\ | 136 | "\ |
| 137 | Message contains characters with unknown encoding. Really send?") | 137 | Message contains characters with unknown encoding. Really send?") |
| 138 | (set (make-local-variable 'mml-confirmation-set) | 138 | (set (make-local-variable 'mml-confirmation-set) |
| 139 | (push 'unknown-encoding mml-confirmation-set)))) | 139 | (push 'unknown-encoding mml-confirmation-set)))) |
| @@ -252,7 +252,7 @@ A message part needs to be split into %d charset parts. Really send? " | |||
| 252 | "Return the buffer up till the next part, multipart or closing part or multipart. | 252 | "Return the buffer up till the next part, multipart or closing part or multipart. |
| 253 | If MML is non-nil, return the buffer up till the correspondent mml tag." | 253 | If MML is non-nil, return the buffer up till the correspondent mml tag." |
| 254 | (let ((beg (point)) (count 1)) | 254 | (let ((beg (point)) (count 1)) |
| 255 | ;; If the tag ended at the end of the line, we go to the next line. | 255 | ;; If the tag ended at the end of the line, we go to the next line. |
| 256 | (when (looking-at "[ \t]*\n") | 256 | (when (looking-at "[ \t]*\n") |
| 257 | (forward-line 1)) | 257 | (forward-line 1)) |
| 258 | (if mml | 258 | (if mml |
| @@ -306,46 +306,46 @@ If MML is non-nil, return the buffer up till the correspondent mml tag." | |||
| 306 | (if (and (not raw) | 306 | (if (and (not raw) |
| 307 | (member (car (split-string type "/")) '("text" "message"))) | 307 | (member (car (split-string type "/")) '("text" "message"))) |
| 308 | (progn | 308 | (progn |
| 309 | (with-temp-buffer | 309 | (with-temp-buffer |
| 310 | (cond | 310 | (cond |
| 311 | ((cdr (assq 'buffer cont)) | 311 | ((cdr (assq 'buffer cont)) |
| 312 | (insert-buffer-substring (cdr (assq 'buffer cont)))) | 312 | (insert-buffer-substring (cdr (assq 'buffer cont)))) |
| 313 | ((and (setq filename (cdr (assq 'filename cont))) | 313 | ((and (setq filename (cdr (assq 'filename cont))) |
| 314 | (not (equal (cdr (assq 'nofile cont)) "yes"))) | 314 | (not (equal (cdr (assq 'nofile cont)) "yes"))) |
| 315 | (mm-insert-file-contents filename)) | 315 | (mm-insert-file-contents filename)) |
| 316 | ((eq 'mml (car cont)) | 316 | ((eq 'mml (car cont)) |
| 317 | (insert (cdr (assq 'contents cont)))) | 317 | (insert (cdr (assq 'contents cont)))) |
| 318 | (t | 318 | (t |
| 319 | (save-restriction | 319 | (save-restriction |
| 320 | (narrow-to-region (point) (point)) | 320 | (narrow-to-region (point) (point)) |
| 321 | (insert (cdr (assq 'contents cont))) | 321 | (insert (cdr (assq 'contents cont))) |
| 322 | ;; Remove quotes from quoted tags. | 322 | ;; Remove quotes from quoted tags. |
| 323 | (goto-char (point-min)) | 323 | (goto-char (point-min)) |
| 324 | (while (re-search-forward | 324 | (while (re-search-forward |
| 325 | "<#!+/?\\(part\\|multipart\\|external\\|mml\\)" nil t) | 325 | "<#!+/?\\(part\\|multipart\\|external\\|mml\\)" nil t) |
| 326 | (delete-region (+ (match-beginning 0) 2) | 326 | (delete-region (+ (match-beginning 0) 2) |
| 327 | (+ (match-beginning 0) 3)))))) | 327 | (+ (match-beginning 0) 3)))))) |
| 328 | (cond | 328 | (cond |
| 329 | ((eq (car cont) 'mml) | 329 | ((eq (car cont) 'mml) |
| 330 | (let ((mml-boundary (funcall mml-boundary-function | 330 | (let ((mml-boundary (funcall mml-boundary-function |
| 331 | (incf mml-multipart-number))) | 331 | (incf mml-multipart-number))) |
| 332 | (mml-generate-default-type "text/plain")) | 332 | (mml-generate-default-type "text/plain")) |
| 333 | (mml-to-mime)) | 333 | (mml-to-mime)) |
| 334 | (let ((mm-7bit-chars (concat mm-7bit-chars "\x1b"))) | 334 | (let ((mm-7bit-chars (concat mm-7bit-chars "\x1b"))) |
| 335 | ;; ignore 0x1b, it is part of iso-2022-jp | 335 | ;; ignore 0x1b, it is part of iso-2022-jp |
| 336 | (setq encoding (mm-body-7-or-8)))) | 336 | (setq encoding (mm-body-7-or-8)))) |
| 337 | ((string= (car (split-string type "/")) "message") | 337 | ((string= (car (split-string type "/")) "message") |
| 338 | (let ((mm-7bit-chars (concat mm-7bit-chars "\x1b"))) | 338 | (let ((mm-7bit-chars (concat mm-7bit-chars "\x1b"))) |
| 339 | ;; ignore 0x1b, it is part of iso-2022-jp | 339 | ;; ignore 0x1b, it is part of iso-2022-jp |
| 340 | (setq encoding (mm-body-7-or-8)))) | 340 | (setq encoding (mm-body-7-or-8)))) |
| 341 | (t | 341 | (t |
| 342 | (setq charset (mm-encode-body)) | 342 | (setq charset (mm-encode-body)) |
| 343 | (setq encoding (mm-body-encoding | 343 | (setq encoding (mm-body-encoding |
| 344 | charset (cdr (assq 'encoding cont)))))) | 344 | charset (cdr (assq 'encoding cont)))))) |
| 345 | (setq coded (buffer-string))) | 345 | (setq coded (buffer-string))) |
| 346 | (mml-insert-mime-headers cont type charset encoding) | 346 | (mml-insert-mime-headers cont type charset encoding) |
| 347 | (insert "\n") | 347 | (insert "\n") |
| 348 | (insert coded)) | 348 | (insert coded)) |
| 349 | (mm-with-unibyte-buffer | 349 | (mm-with-unibyte-buffer |
| 350 | (cond | 350 | (cond |
| 351 | ((cdr (assq 'buffer cont)) | 351 | ((cdr (assq 'buffer cont)) |
| @@ -383,7 +383,7 @@ If MML is non-nil, return the buffer up till the correspondent mml tag." | |||
| 383 | (concat "access-type=" | 383 | (concat "access-type=" |
| 384 | (if (member (nth 0 name) '("ftp@" "anonymous@")) | 384 | (if (member (nth 0 name) '("ftp@" "anonymous@")) |
| 385 | "anon-ftp" | 385 | "anon-ftp" |
| 386 | "ftp"))))) | 386 | "ftp"))))) |
| 387 | (when parameters | 387 | (when parameters |
| 388 | (mml-insert-parameter-string | 388 | (mml-insert-parameter-string |
| 389 | cont '(expiration size permission)))) | 389 | cont '(expiration size permission)))) |
| @@ -656,19 +656,19 @@ If MML is non-nil, return the buffer up till the correspondent mml tag." | |||
| 656 | main)) | 656 | main)) |
| 657 | 657 | ||
| 658 | (easy-menu-define | 658 | (easy-menu-define |
| 659 | mml-menu mml-mode-map "" | 659 | mml-menu mml-mode-map "" |
| 660 | '("MML" | 660 | '("MML" |
| 661 | ("Attach" | 661 | ("Attach" |
| 662 | ["File" mml-attach-file t] | 662 | ["File" mml-attach-file t] |
| 663 | ["Buffer" mml-attach-buffer t] | 663 | ["Buffer" mml-attach-buffer t] |
| 664 | ["External" mml-attach-external t]) | 664 | ["External" mml-attach-external t]) |
| 665 | ("Insert" | 665 | ("Insert" |
| 666 | ["Multipart" mml-insert-multipart t] | 666 | ["Multipart" mml-insert-multipart t] |
| 667 | ["Part" mml-insert-part t]) | 667 | ["Part" mml-insert-part t]) |
| 668 | ;;["Narrow" mml-narrow-to-part t] | 668 | ;;["Narrow" mml-narrow-to-part t] |
| 669 | ["Quote" mml-quote-region t] | 669 | ["Quote" mml-quote-region t] |
| 670 | ["Validate" mml-validate t] | 670 | ["Validate" mml-validate t] |
| 671 | ["Preview" mml-preview t])) | 671 | ["Preview" mml-preview t])) |
| 672 | 672 | ||
| 673 | (defvar mml-mode nil | 673 | (defvar mml-mode nil |
| 674 | "Minor mode for editing MML.") | 674 | "Minor mode for editing MML.") |
| @@ -697,7 +697,7 @@ If MML is non-nil, return the buffer up till the correspondent mml tag." | |||
| 697 | 697 | ||
| 698 | (defun mml-minibuffer-read-file (prompt) | 698 | (defun mml-minibuffer-read-file (prompt) |
| 699 | (let ((file (read-file-name prompt nil nil t))) | 699 | (let ((file (read-file-name prompt nil nil t))) |
| 700 | ;; Prevent some common errors. This is inspired by similar code in | 700 | ;; Prevent some common errors. This is inspired by similar code in |
| 701 | ;; VM. | 701 | ;; VM. |
| 702 | (when (file-directory-p file) | 702 | (when (file-directory-p file) |
| 703 | (error "%s is a directory, cannot attach" file)) | 703 | (error "%s is a directory, cannot attach" file)) |