diff options
| author | Eli Zaretskii | 2015-06-01 18:17:28 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2015-06-01 18:17:28 +0300 |
| commit | 40b33be830310726048dddaee3fdfba5c8a3480f (patch) | |
| tree | d21aea2142da37cfabfc88c99af36a3d526e0fe3 | |
| parent | d0848f8ddee353c99409caf1dd25e003c8b5af98 (diff) | |
| download | emacs-40b33be830310726048dddaee3fdfba5c8a3480f.tar.gz emacs-40b33be830310726048dddaee3fdfba5c8a3480f.zip | |
MS-Windows followup for batch stdout/stderr output changes
* lisp/international/mule-cmds.el (set-locale-environment): In
batch mode, use console codepages for keyboard and terminal
encoding. (Bug#20545)
| -rw-r--r-- | lisp/international/mule-cmds.el | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index c8cd76f5eb1..474806d204e 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el | |||
| @@ -2688,14 +2688,22 @@ See also `locale-charset-language-names', `locale-language-names', | |||
| 2688 | 2688 | ||
| 2689 | ;; On Windows, override locale-coding-system, | 2689 | ;; On Windows, override locale-coding-system, |
| 2690 | ;; default-file-name-coding-system, keyboard-coding-system, | 2690 | ;; default-file-name-coding-system, keyboard-coding-system, |
| 2691 | ;; terminal-coding-system with system codepage. | 2691 | ;; terminal-coding-system with the ANSI or console codepage. |
| 2692 | (when (and (eq system-type 'windows-nt) | 2692 | (when (and (eq system-type 'windows-nt) |
| 2693 | (boundp 'w32-ansi-code-page)) | 2693 | (boundp 'w32-ansi-code-page)) |
| 2694 | (let ((code-page-coding (intern (format "cp%d" w32-ansi-code-page)))) | 2694 | (let* ((code-page-coding |
| 2695 | (intern (format "cp%d" (if noninteractive | ||
| 2696 | (w32-get-console-codepage) | ||
| 2697 | w32-ansi-code-page)))) | ||
| 2698 | (output-coding | ||
| 2699 | (if noninteractive | ||
| 2700 | (intern (format "cp%d" (w32-get-console-output-codepage))) | ||
| 2701 | code-page-coding))) | ||
| 2695 | (when (coding-system-p code-page-coding) | 2702 | (when (coding-system-p code-page-coding) |
| 2703 | (or output-coding (setq output-coding code-page-coding)) | ||
| 2696 | (unless frame (setq locale-coding-system code-page-coding)) | 2704 | (unless frame (setq locale-coding-system code-page-coding)) |
| 2697 | (set-keyboard-coding-system code-page-coding frame) | 2705 | (set-keyboard-coding-system code-page-coding frame) |
| 2698 | (set-terminal-coding-system code-page-coding frame) | 2706 | (set-terminal-coding-system output-coding frame) |
| 2699 | (setq default-file-name-coding-system code-page-coding)))) | 2707 | (setq default-file-name-coding-system code-page-coding)))) |
| 2700 | 2708 | ||
| 2701 | (when (eq system-type 'darwin) | 2709 | (when (eq system-type 'darwin) |