From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Opening a pty without a process Date: Tue, 27 Nov 2007 10:36:57 -0500 Message-ID: References: <18182.41657.249969.116596@kahikatea.snap.net.nz> <18251.11333.382312.936571@kahikatea.snap.net.nz> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1196177859 1128 80.91.229.12 (27 Nov 2007 15:37:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 27 Nov 2007 15:37:39 +0000 (UTC) Cc: emacs-devel@gnu.org To: Nick Roberts Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 27 16:37:46 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Ix2VF-0005VY-Dr for ged-emacs-devel@m.gmane.org; Tue, 27 Nov 2007 16:37:37 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ix2V0-0003kL-12 for ged-emacs-devel@m.gmane.org; Tue, 27 Nov 2007 10:37:22 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ix2Uv-0003hW-84 for emacs-devel@gnu.org; Tue, 27 Nov 2007 10:37:17 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ix2Ut-0003f9-LB for emacs-devel@gnu.org; Tue, 27 Nov 2007 10:37:16 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ix2Ut-0003f2-EY for emacs-devel@gnu.org; Tue, 27 Nov 2007 10:37:15 -0500 Original-Received: from mercure.iro.umontreal.ca ([132.204.24.67]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Ix2Ut-0007uY-6a for emacs-devel@gnu.org; Tue, 27 Nov 2007 10:37:15 -0500 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 9DE9D2CF453; Tue, 27 Nov 2007 10:37:14 -0500 (EST) Original-Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 7A6A93FE1; Tue, 27 Nov 2007 10:36:57 -0500 (EST) Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 5E8296CAA3; Tue, 27 Nov 2007 10:36:57 -0500 (EST) In-Reply-To: <18251.11333.382312.936571@kahikatea.snap.net.nz> (Nick Roberts's message of "Tue, 27 Nov 2007 09:27:49 +1300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:84213 Archived-At: >> (open-pty-buffer buffer) -> "/dev/pts/1" How 'bout: (defun open-pty-buffer (buffer) (let* ((process-connection-type 'pty) (proc (start-process "foo" buffer "sh" "-c" "while sleep 3600; do :; done"))) (process-tty-name proc))) I guess it would be convenient indeed to be able to use nil for the program rather than a contraption like the one above. OTOH we could just use `hexl' by adding a flag to it (it's already abused in a similar way by `ielm'). BTW in your patch I do not understand where the create_pty code comes from. It seems to come from Emacs code, in which case it is code duplication and should be avoided. Stefan