[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master fc7faa2: Don't rely on UTF-8 locale when talking to subord
From: |
Eli Zaretskii |
Subject: |
[elpa] master fc7faa2: Don't rely on UTF-8 locale when talking to subordinate Emacs |
Date: |
Wed, 06 Jan 2016 18:28:43 +0000 |
branch: master
commit fc7faa28a563521cc086f239d2e3aa4b726c6d51
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>
Don't rely on UTF-8 locale when talking to subordinate Emacs
* packages/async/async.el (async--receive-sexp)
(async-batch-invoke): Bind coding-system-for-write to utf-8-unix.
(async-start): Bind coding-system-for-read to utf-8-unix.
---
packages/async/async.el | 35 +++++++++++++++++++++--------------
1 files changed, 21 insertions(+), 14 deletions(-)
diff --git a/packages/async/async.el b/packages/async/async.el
index 20a2f17..2cb9488 100644
--- a/packages/async/async.el
+++ b/packages/async/async.el
@@ -121,7 +121,9 @@ as follows:
(defun async--receive-sexp (&optional stream)
(let ((sexp (decode-coding-string (base64-decode-string
- (read stream)) 'utf-8-unix)))
+ (read stream)) 'utf-8-unix))
+ ;; Parent expects UTF-8 encoded text.
+ (coding-system-for-write 'utf-8-unix))
(if async-debug
(message "Received sexp {{{%s}}}" (pp-to-string sexp)))
(setq sexp (read sexp))
@@ -147,18 +149,21 @@ as follows:
(defun async-batch-invoke ()
"Called from the child Emacs process' command-line."
- (setq async-in-child-emacs t
- debug-on-error async-debug)
- (if debug-on-error
- (prin1 (funcall
- (async--receive-sexp (unless async-send-over-pipe
- command-line-args-left))))
- (condition-case err
- (prin1 (funcall
- (async--receive-sexp (unless async-send-over-pipe
- command-line-args-left))))
- (error
- (prin1 (list 'async-signal err))))))
+ ;; Make sure 'message' and 'prin1' encode stuff in UTF-8, as parent
+ ;; process expects.
+ (let ((coding-system-for-write 'utf-8-unix))
+ (setq async-in-child-emacs t
+ debug-on-error async-debug)
+ (if debug-on-error
+ (prin1 (funcall
+ (async--receive-sexp (unless async-send-over-pipe
+ command-line-args-left))))
+ (condition-case err
+ (prin1 (funcall
+ (async--receive-sexp (unless async-send-over-pipe
+ command-line-args-left))))
+ (error
+ (prin1 (list 'async-signal err)))))))
(defun async-ready (future)
"Query a FUTURE to see if the ready is ready -- i.e., if no blocking
@@ -263,7 +268,9 @@ returned except that it yields no value (since the value is
passed to FINISH-FUNC). Call `async-get' on such a future always
returns nil. It can still be useful, however, as an argument to
`async-ready' or `async-wait'."
- (let ((sexp start-func))
+ (let ((sexp start-func)
+ ;; Subordinate Emacs will send text encoded in UTF-8.
+ (coding-system-for-read 'utf-8-unix))
(setq async--procvar
(async-start-process
"emacs" (file-truename
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] master fc7faa2: Don't rely on UTF-8 locale when talking to subordinate Emacs,
Eli Zaretskii <=