diff options
| author | Kenichi Handa | 2000-06-10 02:17:40 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2000-06-10 02:17:40 +0000 |
| commit | b839fdcc45b28f490171528b9634a205ef0c9366 (patch) | |
| tree | 18cacb833c1f44566931c12723feb469ffef3bc2 | |
| parent | 8d969bf6151099d06cbf8065abe7a68443d66a43 (diff) | |
| download | emacs-b839fdcc45b28f490171528b9634a205ef0c9366.tar.gz emacs-b839fdcc45b28f490171528b9634a205ef0c9366.zip | |
(set-buffer-file-coding-system): If one of undecided-XXX is specified,
change only EOL conversion.
| -rw-r--r-- | lisp/international/mule.el | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/lisp/international/mule.el b/lisp/international/mule.el index bd9e75220e6..92c29fc78f1 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el | |||
| @@ -801,8 +801,13 @@ use \\[list-coding-systems]. | |||
| 801 | If the buffer's previous file coding-system value specifies end-of-line | 801 | If the buffer's previous file coding-system value specifies end-of-line |
| 802 | conversion, and CODING-SYSTEM does not specify one, CODING-SYSTEM is | 802 | conversion, and CODING-SYSTEM does not specify one, CODING-SYSTEM is |
| 803 | merged with the already-specified end-of-line conversion. | 803 | merged with the already-specified end-of-line conversion. |
| 804 | However, if the optional prefix argument FORCE is non-nil, | 804 | |
| 805 | then CODING-SYSTEM is used exactly as specified. | 805 | If the buffer's previous file coding-system value specifies text |
| 806 | conversion, and CODING-SYSTEM does not specify one, CODING-SYSTEM is | ||
| 807 | merged with the already-specified text conversion. | ||
| 808 | |||
| 809 | However, if the optional prefix argument FORCE is non-nil, then | ||
| 810 | CODING-SYSTEM is used exactly as specified. | ||
| 806 | 811 | ||
| 807 | This marks the buffer modified so that the succeeding \\[save-buffer] | 812 | This marks the buffer modified so that the succeeding \\[save-buffer] |
| 808 | surely saves the buffer with CODING-SYSTEM. From a program, if you | 813 | surely saves the buffer with CODING-SYSTEM. From a program, if you |
| @@ -810,11 +815,15 @@ don't want to mark the buffer modified, just set the variable | |||
| 810 | `buffer-file-coding-system' directly." | 815 | `buffer-file-coding-system' directly." |
| 811 | (interactive "zCoding system for visited file (default, nil): \nP") | 816 | (interactive "zCoding system for visited file (default, nil): \nP") |
| 812 | (check-coding-system coding-system) | 817 | (check-coding-system coding-system) |
| 813 | (if (null force) | 818 | (if (and buffer-file-coding-system (null force)) |
| 814 | (let ((x (coding-system-eol-type buffer-file-coding-system)) | 819 | (let ((x (coding-system-eol-type buffer-file-coding-system)) |
| 815 | (y (coding-system-eol-type coding-system))) | 820 | (y (coding-system-eol-type coding-system))) |
| 816 | (if (and (numberp x) (>= x 0) (<= x 2) (vectorp y)) | 821 | (if (and (numberp x) (>= x 0) (<= x 2) (vectorp y)) |
| 817 | (setq coding-system (aref y x))))) | 822 | (setq coding-system (aref y x)) |
| 823 | (if (and (eq (coding-system-base coding-system) 'undecided) | ||
| 824 | (numberp y)) | ||
| 825 | (setq coding-system (coding-system-change-eol-conversion | ||
| 826 | buffer-file-coding-system y)))))) | ||
| 818 | (setq buffer-file-coding-system coding-system) | 827 | (setq buffer-file-coding-system coding-system) |
| 819 | (set-buffer-modified-p t) | 828 | (set-buffer-modified-p t) |
| 820 | (force-mode-line-update)) | 829 | (force-mode-line-update)) |