diff options
| author | Kenichi Handa | 1997-08-28 04:51:02 +0000 |
|---|---|---|
| committer | Kenichi Handa | 1997-08-28 04:51:02 +0000 |
| commit | 1613b43af72d56ffffc939f032e7af5e2505f517 (patch) | |
| tree | d40baad7af5d610b02289a1a1a07bcd2e783752b | |
| parent | e86f8de2fe0f78a85d81a904b482c15420270c65 (diff) | |
| download | emacs-1613b43af72d56ffffc939f032e7af5e2505f517.tar.gz emacs-1613b43af72d56ffffc939f032e7af5e2505f517.zip | |
(nnmail-active-file-coding-system): New variable.
(nnmail-insert-xref): Encode pathname for Emacs 20.
(nnmail-write-region, nnmh-retrieve-headers, nnmh-request-article,
nnmh-request-group, nnmh-possibly-change-directory): Protect from
conversion by `pathname-coding-system' for XEmacs/mule.
(nnmail-pathname-coding-system): New variable.
(nnmail-group-pathname): Encode pathname for Emacs 20.
nnmail-file-coding-system): New variable.
(nnmail-find-file): Bind `coding-system-for-read' with
`nnmail-file-coding-system' for Emacs/mule and XEmacs/mule.
(nnmail-write-region): Bind `coding-system-for-write' with
`nnmail-file-coding-system' for Emacs/mule and XEmacs/mule.
| -rw-r--r-- | lisp/gnus/nnmail.el | 53 |
1 files changed, 45 insertions, 8 deletions
diff --git a/lisp/gnus/nnmail.el b/lisp/gnus/nnmail.el index 94ef57b96f4..9c49843474d 100644 --- a/lisp/gnus/nnmail.el +++ b/lisp/gnus/nnmail.el | |||
| @@ -470,6 +470,10 @@ parameter. It should return nil, `warn' or `delete'." | |||
| 470 | (defun nnmail-request-post (&optional server) | 470 | (defun nnmail-request-post (&optional server) |
| 471 | (mail-send-and-exit nil)) | 471 | (mail-send-and-exit nil)) |
| 472 | 472 | ||
| 473 | ;; 1997/5/4 by MORIOKA Tomohiko <morioka@jaist.ac.jp> | ||
| 474 | (defvar nnmail-file-coding-system nil | ||
| 475 | "Coding system used in nnmail.") | ||
| 476 | |||
| 473 | (defun nnmail-find-file (file) | 477 | (defun nnmail-find-file (file) |
| 474 | "Insert FILE in server buffer safely." | 478 | "Insert FILE in server buffer safely." |
| 475 | (set-buffer nntp-server-buffer) | 479 | (set-buffer nntp-server-buffer) |
| @@ -477,9 +481,20 @@ parameter. It should return nil, `warn' or `delete'." | |||
| 477 | (let ((format-alist nil) | 481 | (let ((format-alist nil) |
| 478 | (after-insert-file-functions nil)) | 482 | (after-insert-file-functions nil)) |
| 479 | (condition-case () | 483 | (condition-case () |
| 480 | (progn (insert-file-contents file) t) | 484 | ;; 1997/5/4 by MORIOKA Tomohiko <morioka@jaist.ac.jp> |
| 485 | (let ((coding-system-for-read nnmail-file-coding-system) | ||
| 486 | ;; 1997/8/12 by MORIOKA Tomohiko | ||
| 487 | ;; for XEmacs/mule. | ||
| 488 | (pathname-coding-system 'binary)) | ||
| 489 | (insert-file-contents file) | ||
| 490 | t) | ||
| 481 | (file-error nil)))) | 491 | (file-error nil)))) |
| 482 | 492 | ||
| 493 | ;; 1997/8/10 by MORIOKA Tomohiko | ||
| 494 | (defvar nnmail-pathname-coding-system | ||
| 495 | 'iso-8859-1 | ||
| 496 | "*Coding system for pathname.") | ||
| 497 | |||
| 483 | (defun nnmail-group-pathname (group dir &optional file) | 498 | (defun nnmail-group-pathname (group dir &optional file) |
| 484 | "Make pathname for GROUP." | 499 | "Make pathname for GROUP." |
| 485 | (concat | 500 | (concat |
| @@ -489,7 +504,13 @@ parameter. It should return nil, `warn' or `delete'." | |||
| 489 | (file-directory-p (concat dir group))) | 504 | (file-directory-p (concat dir group))) |
| 490 | (concat dir group "/") | 505 | (concat dir group "/") |
| 491 | ;; If not, we translate dots into slashes. | 506 | ;; If not, we translate dots into slashes. |
| 492 | (concat dir (nnheader-replace-chars-in-string group ?. ?/) "/"))) | 507 | (concat dir |
| 508 | ;; 1997/8/10 by MORIOKA Tomohiko | ||
| 509 | ;; encode file name for Emacs 20. | ||
| 510 | (encode-coding-string | ||
| 511 | (nnheader-replace-chars-in-string group ?. ?/) | ||
| 512 | nnmail-pathname-coding-system) | ||
| 513 | "/"))) | ||
| 493 | (or file ""))) | 514 | (or file ""))) |
| 494 | 515 | ||
| 495 | (defun nnmail-date-to-time (date) | 516 | (defun nnmail-date-to-time (date) |
| @@ -668,11 +689,17 @@ nn*-request-list should have been called before calling this function." | |||
| 668 | group-assoc))) | 689 | group-assoc))) |
| 669 | group-assoc)) | 690 | group-assoc)) |
| 670 | 691 | ||
| 692 | ;; 1997/8/12 by MORIOKA Tomohiko | ||
| 693 | (defvar nnmail-active-file-coding-system | ||
| 694 | 'iso-8859-1 | ||
| 695 | "*Coding system for active file.") | ||
| 696 | |||
| 671 | (defun nnmail-save-active (group-assoc file-name) | 697 | (defun nnmail-save-active (group-assoc file-name) |
| 672 | "Save GROUP-ASSOC in ACTIVE-FILE." | 698 | "Save GROUP-ASSOC in ACTIVE-FILE." |
| 673 | (when file-name | 699 | (let ((coding-system-for-write nnmail-active-file-coding-system)) |
| 674 | (nnheader-temp-write file-name | 700 | (when file-name |
| 675 | (nnmail-generate-active group-assoc)))) | 701 | (nnheader-temp-write file-name |
| 702 | (nnmail-generate-active group-assoc))))) | ||
| 676 | 703 | ||
| 677 | (defun nnmail-generate-active (alist) | 704 | (defun nnmail-generate-active (alist) |
| 678 | "Generate an active file from group-alist ALIST." | 705 | "Generate an active file from group-alist ALIST." |
| @@ -1112,7 +1139,12 @@ Return the number of characters in the body." | |||
| 1112 | (progn (forward-line 1) (point)))) | 1139 | (progn (forward-line 1) (point)))) |
| 1113 | (insert (format "Xref: %s" (system-name))) | 1140 | (insert (format "Xref: %s" (system-name))) |
| 1114 | (while group-alist | 1141 | (while group-alist |
| 1115 | (insert (format " %s:%d" (caar group-alist) (cdar group-alist))) | 1142 | ;; 1997/8/10 by MORIOKA Tomohiko |
| 1143 | ;; encode file name for Emacs 20. | ||
| 1144 | (insert (format " %s:%d" | ||
| 1145 | (encode-coding-string (caar group-alist) | ||
| 1146 | nnmail-pathname-coding-system) | ||
| 1147 | (cdar group-alist))) | ||
| 1116 | (setq group-alist (cdr group-alist))) | 1148 | (setq group-alist (cdr group-alist))) |
| 1117 | (insert "\n")))) | 1149 | (insert "\n")))) |
| 1118 | 1150 | ||
| @@ -1603,8 +1635,13 @@ If ARGS, PROMPT is used as an argument to `format'." | |||
| 1603 | 1635 | ||
| 1604 | (defun nnmail-write-region (start end filename &optional append visit lockname) | 1636 | (defun nnmail-write-region (start end filename &optional append visit lockname) |
| 1605 | "Do a `write-region', and then set the file modes." | 1637 | "Do a `write-region', and then set the file modes." |
| 1606 | (write-region start end filename append visit lockname) | 1638 | ;; 1997/5/4 by MORIOKA Tomohiko <morioka@jaist.ac.jp> |
| 1607 | (set-file-modes filename nnmail-default-file-modes)) | 1639 | (let ((coding-system-for-write nnmail-file-coding-system) |
| 1640 | ;; 1997/8/12 by MORIOKA Tomohiko | ||
| 1641 | ;; for XEmacs/mule. | ||
| 1642 | (pathname-coding-system 'binary)) | ||
| 1643 | (write-region start end filename append visit lockname) | ||
| 1644 | (set-file-modes filename nnmail-default-file-modes))) | ||
| 1608 | 1645 | ||
| 1609 | ;;; | 1646 | ;;; |
| 1610 | ;;; Status functions | 1647 | ;;; Status functions |