Mercurial > emacs
comparison lisp/international/mule-cmds.el @ 44425:86eccd269d36
(set-default-coding-systems, reset-language-environment): Preserve
eols on default-process-coding-system.
(coding-system-change-text-conversion): Fix case where CODING is nil.
author | Jason Rumney <jasonr@gnu.org> |
---|---|
date | Sun, 07 Apr 2002 18:50:20 +0000 |
parents | abf6fc89e7d7 |
children | db660532bd23 |
comparison
equal
deleted
inserted
replaced
44424:f7fa35f7bba2 | 44425:86eccd269d36 |
---|---|
209 "Return a coding system which differs from CODING-SYSTEM in text conversion. | 209 "Return a coding system which differs from CODING-SYSTEM in text conversion. |
210 The returned coding system converts text by CODING | 210 The returned coding system converts text by CODING |
211 but end-of-line as the same way as CODING-SYSTEM. | 211 but end-of-line as the same way as CODING-SYSTEM. |
212 If CODING is nil, the returned coding system detects | 212 If CODING is nil, the returned coding system detects |
213 how text is formatted automatically while decoding." | 213 how text is formatted automatically while decoding." |
214 (if (not coding) | 214 (let ((eol-type (coding-system-eol-type coding-system))) |
215 (coding-system-base coding-system) | 215 (coding-system-change-eol-conversion |
216 (let ((eol-type (coding-system-eol-type coding-system))) | 216 (if coding coding 'undecided) |
217 (coding-system-change-eol-conversion | 217 (if (numberp eol-type) (aref [unix dos mac] eol-type))))) |
218 coding | |
219 (if (numberp eol-type) (aref [unix dos mac] eol-type)))))) | |
220 | 218 |
221 (defun toggle-enable-multibyte-characters (&optional arg) | 219 (defun toggle-enable-multibyte-characters (&optional arg) |
222 "Change whether this buffer uses multibyte characters. | 220 "Change whether this buffer uses multibyte characters. |
223 With arg, use multibyte characters if the arg is positive. | 221 With arg, use multibyte characters if the arg is positive. |
224 | 222 |
309 ;; If coding-system is nil, honor that on MS-DOS as well, so | 307 ;; If coding-system is nil, honor that on MS-DOS as well, so |
310 ;; that they could reset the terminal coding system. | 308 ;; that they could reset the terminal coding system. |
311 (unless (and (eq window-system 'pc) coding-system) | 309 (unless (and (eq window-system 'pc) coding-system) |
312 (setq default-terminal-coding-system coding-system)) | 310 (setq default-terminal-coding-system coding-system)) |
313 (setq default-keyboard-coding-system coding-system) | 311 (setq default-keyboard-coding-system coding-system) |
314 (setq default-process-coding-system (cons coding-system coding-system))) | 312 ;; Preserve eol-type from existing default-process-coding-systems. |
313 ;; On non-unix-like systems in particular, these may have been set | |
314 ;; carefully by the user, or by the startup code, to deal with the | |
315 ;; users shell appropriately, so should not be altered by changing | |
316 ;; language environment. | |
317 (let ((output-coding | |
318 (coding-system-change-text-conversion | |
319 (car default-process-coding-system) coding-system)) | |
320 (input-coding | |
321 (coding-system-change-text-conversion | |
322 (cdr default-process-coding-system) coding-system))) | |
323 (setq default-process-coding-system | |
324 (cons output-coding input-coding)))) | |
315 | 325 |
316 (defalias 'update-iso-coding-systems 'update-coding-systems-internal) | 326 (defalias 'update-iso-coding-systems 'update-coding-systems-internal) |
317 (make-obsolete 'update-iso-coding-systems 'update-coding-systems-internal "20.3") | 327 (make-obsolete 'update-iso-coding-systems 'update-coding-systems-internal "20.3") |
318 | 328 |
319 (defun prefer-coding-system (coding-system) | 329 (defun prefer-coding-system (coding-system) |
1397 | 1407 |
1398 (update-coding-systems-internal) | 1408 (update-coding-systems-internal) |
1399 | 1409 |
1400 (set-default-coding-systems nil) | 1410 (set-default-coding-systems nil) |
1401 (setq default-sendmail-coding-system 'iso-latin-1) | 1411 (setq default-sendmail-coding-system 'iso-latin-1) |
1402 (setq default-process-coding-system '(undecided . iso-latin-1)) | 1412 ;; Preserve eol-type from existing default-process-coding-systems. |
1413 ;; On non-unix-like systems in particular, these may have been set | |
1414 ;; carefully by the user, or by the startup code, to deal with the | |
1415 ;; users shell appropriately, so should not be altered by changing | |
1416 ;; language environment. | |
1417 (let ((output-coding | |
1418 (coding-system-change-text-conversion | |
1419 (car default-process-coding-system) 'undecided)) | |
1420 (input-coding | |
1421 (coding-system-change-text-conversion | |
1422 (cdr default-process-coding-system) 'iso-latin-1))) | |
1423 (setq default-process-coding-system | |
1424 (cons output-coding input-coding))) | |
1403 | 1425 |
1404 ;; Don't alter the terminal and keyboard coding systems here. | 1426 ;; Don't alter the terminal and keyboard coding systems here. |
1405 ;; The terminal still supports the same coding system | 1427 ;; The terminal still supports the same coding system |
1406 ;; that it supported a minute ago. | 1428 ;; that it supported a minute ago. |
1407 ;; (set-terminal-coding-system-internal nil) | 1429 ;; (set-terminal-coding-system-internal nil) |