[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Decoding coding system of processes
From: |
Kenichi Handa |
Subject: |
Re: Decoding coding system of processes |
Date: |
Fri, 22 Jul 2005 10:31:35 +0900 |
User-agent: |
SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/22.0.50 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI) |
In article <address@hidden>, Michael Albinus <address@hidden> writes:
> I have started "emacs -q -no-site-file". Then I've performed "M-x shell"
> and "M-: (process-coding-system (get-buffer-process (current-buffer)))"
> afterwards in the shell buffer. Surprisingly, the result is
> "(iso-latin-1-dos . iso-latin-1)".
> The setting of a dos decoding system is nasty. For example, it
> instructs to Tramp convert eol characters of transferred files, as
> reported recently in emacs-pretest-bug. Where does it come from? Is it
> really the correct coding system one has to expect?
That settings comes from this code in comint-exec-1 (lisp/comint.el):
(let ((coding-systems (process-coding-system proc)))
(setq decoding (car coding-systems)
encoding (cdr coding-systems)))
;; If start-process decided to use some coding system for decoding
;; data sent from the process and the coding system doesn't
;; specify EOL conversion, we had better convert CRLF to LF.
(if (vectorp (coding-system-eol-type decoding))
(setq decoding (coding-system-change-eol-conversion decoding 'dos)
changed t))
;; Even if start-process left the coding system for encoding data
;; sent from the process undecided, we had better use the same one
;; as what we use for decoding. But, we should suppress EOL
;; conversion.
(if (and decoding (not encoding))
(setq encoding (coding-system-change-eol-conversion decoding 'unix)
changed t))
(if changed
(set-process-coding-system proc decoding encoding))
But, I don't know the rationale of it.
> instructs to Tramp convert eol characters of transferred files, as
If Tramp uses comint for transferring files, it should
anyway set process coding system to `no-conversion' (at
least while transferring files).
---
Kenichi Handa
address@hidden