# HG changeset patch # User Richard M. Stallman # Date 899243019 0 # Node ID a453ed3fb89fbb6acfce4e214a280694168e5655 # Parent 175d00eed6c7d65131b74b49765ce7204cc0ce49 (comint-exec-1): Setup coding systems appropriately. diff -r 175d00eed6c7 -r a453ed3fb89f lisp/comint.el --- a/lisp/comint.el Tue Jun 30 17:15:32 1998 +0000 +++ b/lisp/comint.el Tue Jun 30 21:43:39 1998 +0000 @@ -681,8 +681,28 @@ (default-directory (if (file-accessible-directory-p default-directory) default-directory - (char-to-string directory-sep-char)))) - (apply 'start-process name buffer command switches))) + (char-to-string directory-sep-char))) + proc decoding encoding changed) + (setq proc (apply 'start-process name buffer command switches)) + (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 form 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)) + proc)) ;; Input history processing in a buffer ;; ===========================================================================