From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.emacs.devel Subject: Re: async.el: A simple asynchronous framework for Emacs Date: Fri, 22 Jun 2012 22:07:02 +0200 Message-ID: <87vcij6rh5.fsf@gnuvola.org> References: <87d34tn2ja.fsf@gnuvola.org> <8762ak7qit.fsf@gnuvola.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1340395618 14959 80.91.229.3 (22 Jun 2012 20:06:58 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 22 Jun 2012 20:06:58 +0000 (UTC) Cc: emacs-devel@gnu.org To: Le Wang Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 22 22:06:58 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SiA89-0000z6-8D for ged-emacs-devel@m.gmane.org; Fri, 22 Jun 2012 22:06:57 +0200 Original-Received: from localhost ([::1]:60877 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SiA89-0002YY-5C for ged-emacs-devel@m.gmane.org; Fri, 22 Jun 2012 16:06:57 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:41583) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SiA86-0002Y6-BS for emacs-devel@gnu.org; Fri, 22 Jun 2012 16:06:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SiA84-00075b-0l for emacs-devel@gnu.org; Fri, 22 Jun 2012 16:06:53 -0400 Original-Received: from smtp208.alice.it ([82.57.200.104]:41278) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SiA83-00074u-NE for emacs-devel@gnu.org; Fri, 22 Jun 2012 16:06:51 -0400 Original-Received: from ambire (188.10.72.46) by smtp208.alice.it (8.6.023.02) id 4FE1E6F6004EBBD8; Fri, 22 Jun 2012 22:06:49 +0200 Original-Received: from ttn by ambire with local (Exim 4.72) (envelope-from ) id 1SiA8F-00019q-AN; Fri, 22 Jun 2012 22:07:03 +0200 In-Reply-To: (Le Wang's message of "Sat, 23 Jun 2012 00:01:47 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 82.57.200.104 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:151090 Archived-At: () Le Wang () Sat, 23 Jun 2012 00:01:47 +0800 This is off-topic, but what a wonderful tip! I see in (info "(elisp) Asynchronous Processes") the introductory blurb: Here we describe how to create an asynchronous process. and then, below, for =E2=80=98process-connection-type=E2=80=99, the paragra= ph: PTYs are usually preferable for processes visible to the user, as in Shell mode, because they allow job control (`C-c', `C-z', etc.) to work between the process and its children, whereas pipes do not. For subprocesses used for internal purposes by programs, it is often better to use a pipe, because they are more efficient. In addition, the total number of PTYs is limited on many systems and it is good not to waste them. Probably this could be moved into the intro blurb to aid its discovery, and furthermore modified to mention correctness as well (and not only efficiency) for large (for a PTY) messages. Another idea is to move the (one) variable doc before the function docs, but that would be a jolt in the style. For example: Here we describe how to create an asynchronous process, including a variable that controls whether PTYs or pipes should be used at the time of the actual subprocess creation. PTYs are usually preferable for processes visible to the user, as in Shell mode, because they allow job control (`C-c', `C-z', etc.) to work between the process and its children, whereas pipes do not. For subprocesses used for internal purposes by programs, it is often better to use a pipe, because they are more efficient, and immune to stray character injections that PTYs use for large (ca. 500 byte) messages. In addition, the total number of PTYs is limited on many systems and it is good not to waste them. Not so svelte (needs work), but maybe Someone will be inspired...