diff options
| -rw-r--r-- | lisp/international/mule.el | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/lisp/international/mule.el b/lisp/international/mule.el index e968ad0873f..1c0d6ac5fa2 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el | |||
| @@ -816,14 +816,19 @@ don't want to mark the buffer modified, just set the variable | |||
| 816 | (interactive "zCoding system for visited file (default, nil): \nP") | 816 | (interactive "zCoding system for visited file (default, nil): \nP") |
| 817 | (check-coding-system coding-system) | 817 | (check-coding-system coding-system) |
| 818 | (if (and coding-system buffer-file-coding-system (null force)) | 818 | (if (and coding-system buffer-file-coding-system (null force)) |
| 819 | (let ((x (coding-system-eol-type buffer-file-coding-system)) | 819 | (let ((base (coding-system-base buffer-file-coding-system)) |
| 820 | (y (coding-system-eol-type coding-system))) | 820 | (eol (coding-system-eol-type buffer-file-coding-system))) |
| 821 | (if (and (numberp x) (>= x 0) (<= x 2) (vectorp y)) | 821 | ;; If CODING-SYSTEM doesn't specify text conversion, merge |
| 822 | (setq coding-system (aref y x)) | 822 | ;; with that of buffer-file-coding-system. |
| 823 | (if (and (eq (coding-system-base coding-system) 'undecided) | 823 | (if (eq (coding-system-base coding-system) 'undecided) |
| 824 | (numberp y)) | 824 | (setq coding-system (coding-system-change-text-conversion |
| 825 | (setq coding-system (coding-system-change-eol-conversion | 825 | coding-system base))) |
| 826 | buffer-file-coding-system y)))))) | 826 | ;; If CODING-SYSTEM doesn't specify eol conversion, merge with |
| 827 | ;; that of buffer-file-coding-system. | ||
| 828 | (if (and (vectorp (coding-system-eol-type coding-system)) | ||
| 829 | (numberp eol) (>= eol 0) (<= eol 2)) | ||
| 830 | (setq coding-system (coding-system-change-eol-conversion | ||
| 831 | coding-system eol))))) | ||
| 827 | (setq buffer-file-coding-system coding-system) | 832 | (setq buffer-file-coding-system coding-system) |
| 828 | (set-buffer-modified-p t) | 833 | (set-buffer-modified-p t) |
| 829 | (force-mode-line-update)) | 834 | (force-mode-line-update)) |