From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [PATCH 3/3] Inherit process output coding system to stderr process. Date: Wed, 04 Apr 2018 16:39:55 +0300 Message-ID: <83370b3xas.fsf@gnu.org> References: <20180404120218.257212-1-phst@google.com> <20180404120218.257212-3-phst@google.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1522849113 21429 195.159.176.226 (4 Apr 2018 13:38:33 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 4 Apr 2018 13:38:33 +0000 (UTC) Cc: phst@google.com, emacs-devel@gnu.org To: Philipp Stephani Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 04 15:38:29 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f3icP-0005Tm-DV for ged-emacs-devel@m.gmane.org; Wed, 04 Apr 2018 15:38:29 +0200 Original-Received: from localhost ([::1]:59215 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3ieT-0005gP-0a for ged-emacs-devel@m.gmane.org; Wed, 04 Apr 2018 09:40:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39331) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3idk-000583-4c for emacs-devel@gnu.org; Wed, 04 Apr 2018 09:39:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f3idi-0002ky-4E for emacs-devel@gnu.org; Wed, 04 Apr 2018 09:39:52 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40308) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3idd-0002jg-AF; Wed, 04 Apr 2018 09:39:45 -0400 Original-Received: from [176.228.60.248] (port=4840 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1f3idc-0003x5-Mb; Wed, 04 Apr 2018 09:39:45 -0400 In-reply-to: <20180404120218.257212-3-phst@google.com> (message from Philipp Stephani on Wed, 4 Apr 2018 14:02:18 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:224319 Archived-At: > From: Philipp Stephani > Date: Wed, 4 Apr 2018 14:02:18 +0200 > Cc: Philipp Stephani > > * src/process.c (Fmake_process): Inherit output coding system to > newly-created pipe process. I'm sorry, I don't understand the need for this "inheriting". If the problem is that make-process and make-pipe-process use different logic to decide on the default coding-systems, then I think we should make them use the same logic, and then there will be no need for "inheriting". Or is there something else I'm missing? > + (let ((process (make-process > + :name "stderr-coding" > + :command (list shell-file-name shell-command-switch > + (concat "echo -e '\\xC3\\xA4\\r'; " > + "echo -e '\\xC3\\xB6\\r' >&2")) This shell command is non-portable. I think even "echo -e" is not portable enough, let alone with hex escapes and the trailing \r. Can't we use Emacs instead? There's also the ";" issue again. > + (should (equal (buffer-string) "\u00C3\u00B6\n")))) > + (should (equal (buffer-string) "\u00C3\u00A4\n"))))) Why not use literal characters here? It will make the source more readable, IMO.