aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1998-06-30 21:43:39 +0000
committerRichard M. Stallman1998-06-30 21:43:39 +0000
commit33ba5485ee492cc17c037e7ff97eccd305f57cb0 (patch)
tree941b4922b1dccffa2b22458121926e3480be177d
parent85f7387f95f6e903168c4b38a908744b136ed420 (diff)
downloademacs-33ba5485ee492cc17c037e7ff97eccd305f57cb0.tar.gz
emacs-33ba5485ee492cc17c037e7ff97eccd305f57cb0.zip
(comint-exec-1): Setup coding systems appropriately.
-rw-r--r--lisp/comint.el24
1 files changed, 22 insertions, 2 deletions
diff --git a/lisp/comint.el b/lisp/comint.el
index 01022a33c00..880866114e6 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -681,8 +681,28 @@ buffer. The hook `comint-exec-hook' is run after each exec."
681 (default-directory 681 (default-directory
682 (if (file-accessible-directory-p default-directory) 682 (if (file-accessible-directory-p default-directory)
683 default-directory 683 default-directory
684 (char-to-string directory-sep-char)))) 684 (char-to-string directory-sep-char)))
685 (apply 'start-process name buffer command switches))) 685 proc decoding encoding changed)
686 (setq proc (apply 'start-process name buffer command switches))
687 (let ((coding-systems (process-coding-system proc)))
688 (setq decoding (car coding-systems)
689 encoding (cdr coding-systems)))
690 ;; If start-process decided to use some coding system for decoding
691 ;; data sent form the process and the coding system doesn't
692 ;; specify EOL conversion, we had better convert CRLF to LF.
693 (if (vectorp (coding-system-eol-type decoding))
694 (setq decoding (coding-system-change-eol-conversion decoding 'dos)
695 changed t))
696 ;; Even if start-process left the coding system for encoding data
697 ;; sent from the process undecided, we had better use the same one
698 ;; as what we use for decoding. But, we should suppress EOL
699 ;; conversion.
700 (if (and decoding (not encoding))
701 (setq encoding (coding-system-change-eol-conversion decoding 'unix)
702 changed t))
703 (if changed
704 (set-process-coding-system proc decoding encoding))
705 proc))
686 706
687;; Input history processing in a buffer 707;; Input history processing in a buffer
688;; =========================================================================== 708;; ===========================================================================