aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Rumney2002-04-07 18:51:29 +0000
committerJason Rumney2002-04-07 18:51:29 +0000
commit1d77e15a284d9d023b8c2743dedebad1e5e5d162 (patch)
treeb16866b3a7fbc267d9a44950e14329c8ae4101a6
parentcf6f437fc9db506fa68bc49f301b69ce6035d894 (diff)
downloademacs-1d77e15a284d9d023b8c2743dedebad1e5e5d162.tar.gz
emacs-1d77e15a284d9d023b8c2743dedebad1e5e5d162.zip
(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.
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/international/mule-cmds.el38
2 files changed, 38 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e32dd2a4c8a..642e63ec783 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
12002-04-07 Jason Rumney <jasonr@gnu.org>
2
3 * international/mule-cmds.el (set-default-coding-systems)
4 (reset-language-environment): Preserve eols on
5 default-process-coding-system.
6 (coding-system-change-text-conversion): Fix case where CODING is
7 nil.
8
12002-04-07 Pavel Jan,Bm(Bk <Pavel@Janik.cz> 92002-04-07 Pavel Jan,Bm(Bk <Pavel@Janik.cz>
2 10
3 * subr.el (play-sound): Move here from simple.el. 11 * subr.el (play-sound): Move here from simple.el.
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 7e2b1a43db8..8e92f94707d 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -211,12 +211,10 @@ The returned coding system converts text by CODING
211but end-of-line as the same way as CODING-SYSTEM. 211but end-of-line as the same way as CODING-SYSTEM.
212If CODING is nil, the returned coding system detects 212If CODING is nil, the returned coding system detects
213how text is formatted automatically while decoding." 213how 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.
@@ -311,7 +309,19 @@ This also sets the following values:
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")
@@ -1399,7 +1409,19 @@ The default status is as follows:
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