From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Steven Tamm Newsgroups: gmane.emacs.devel Subject: Re: Emacs 21.3.50.1 (CVS sources) MacOS X tex-mode bug Date: Fri, 21 Jan 2005 11:40:09 -0800 Message-ID: <4292BBEC-6BE4-11D9-84F9-000D93B67DC4@mac.com> References: <9CBC151C-6A4E-11D9-84F9-000D93B67DC4@mac.com> <86wtu7s3q5.fsf@panel.jk.homeunix.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1106337360 12549 80.91.229.6 (21 Jan 2005 19:56:00 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 21 Jan 2005 19:56:00 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 21 20:55:52 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Cs4sn-0004g2-00 for ; Fri, 21 Jan 2005 20:55:49 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Cs54p-0003Pe-Hz for ged-emacs-devel@m.gmane.org; Fri, 21 Jan 2005 15:08:15 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Cs4we-0000ZR-LY for emacs-devel@gnu.org; Fri, 21 Jan 2005 14:59:49 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Cs4wL-0000Oi-Ra for emacs-devel@gnu.org; Fri, 21 Jan 2005 14:59:30 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Cs4wL-0000MV-Mn for emacs-devel@gnu.org; Fri, 21 Jan 2005 14:59:29 -0500 Original-Received: from [17.250.248.88] (helo=smtpout.mac.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Cs4dk-0001Rr-Gh for emacs-devel@gnu.org; Fri, 21 Jan 2005 14:40:16 -0500 Original-Received: from mac.com (smtpin02-en2 [10.13.10.147]) by smtpout.mac.com (Xserve/MantshX 2.0) with ESMTP id j0LJeEcf004147 for ; Fri, 21 Jan 2005 11:40:14 -0800 (PST) Original-Received: from [10.0.1.201] (c-24-4-203-197.client.comcast.net [24.4.203.197]) (authenticated bits=0) by mac.com (Xserve/smtpin02/MantshX 4.0) with ESMTP id j0LJeBfD004812; Fri, 21 Jan 2005 11:40:12 -0800 (PST) In-Reply-To: <86wtu7s3q5.fsf@panel.jk.homeunix.org> Original-To: Nozomu Ando X-Mailer: Apple Mail (2.619) 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: main.gmane.org gmane.emacs.devel:32459 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:32459 Your understanding is correct. However I had seen data loss even with interactive processes, although the data was always useless. Perhaps it would be better to have process-connection-type default to nil with darwin 6, but allow the user to override it if they know what they are doing? Something like this. Index: src/process.c =================================================================== RCS file: /cvsroot/emacs/emacs/src/process.c,v retrieving revision 1.447 diff -u -d -b -w -r1.447 process.c --- src/process.c 27 Dec 2004 16:06:43 -0000 1.447 +++ src/process.c 21 Jan 2005 19:38:57 -0000 @@ -187,6 +187,7 @@ #include "syswait.h" extern void set_waiting_for_input P_ ((EMACS_TIME *)); +extern char *get_operating_system_release (); #ifndef USE_CRT_DLL extern int errno; @@ -6704,6 +6705,19 @@ Fprovide (intern ("make-network-process"), subfeatures); } #endif /* HAVE_SOCKETS */ + +#ifdef DARWIN + /* PTYs are broken on Darwin < 6, but are sometimes useful for interactive + processes. As such, we only change the default value. */ + if (initialized) + { + char *release = get_operating_system_release(); + if (!release || !release[0] || (release[0] < MIN_PTY_KERNEL_VERSION + && release[1] == '.')) { + Vprocess_connection_type = Qnil; + } + } +#endif } void Index: src/s/darwin.h =================================================================== RCS file: /cvsroot/emacs/emacs/src/s/darwin.h,v retrieving revision 1.19 diff -u -d -b -w -r1.19 darwin.h --- src/s/darwin.h 20 Jan 2005 18:13:48 -0000 1.19 +++ src/s/darwin.h 21 Jan 2005 19:38:59 -0000 @@ -37,6 +37,10 @@ #define BSD_SYSTEM /* #define VMS */ +#ifndef DARWIN +#define DARWIN 1 +#endif + /* MAC_OS is used to conditionally compile code common to both MAC_OS8 and MAC_OSX. */ #ifdef MAC_OSX @@ -103,25 +107,17 @@ /* * Define HAVE_PTYS if the system supports pty devices. + * Note: PTYs are broken on darwin <6. Use at your own risk. */ #define HAVE_PTYS - -/* - * PTYs only work correctly on Darwin 7 or higher. So make PTY_ITERATION - * Test the operating system release and only allow PTYs if it is greater - * than 7. +/** + * PTYs only work correctly on Darwin 7 or higher. So make the + * default for process-connection-type dependent on the kernel + * version. */ #define MIN_PTY_KERNEL_VERSION '7' -#define PTY_ITERATION \ - char *release = get_operating_system_release(); \ - if (!release || !release[0] || (release[0] < MIN_PTY_KERNEL_VERSION \ - && release[1] == '.')) \ - return -1; \ - for (c = FIRST_PTY_LETTER; c <= 'z'; c++) \ - for (i = 0; i < 16; i++) - /* * Define NONSYSTEM_DIR_LIBRARY to make Emacs emulate -Steven On Jan 20, 2005, at 10:20 PM, Nozomu Ando wrote: > > Steven Tamm writes: >> I changed mac-win.el to use ptys on darwin 7 and higher (i.e. OSX >> 10.3) based on this variable. > > If my understanding is correct, we cannot use ptys at all on darwin 6 > or below now? > > Ptys on darwin 6 have the problem of data loss at the end of the > stream, > but they are still useful for interactive subprocesses, such as M-x > shell. > > Moreover, we can fix the kernel of darwin 6 becuase its source is > available. > > Could you please re-consider the last change and make it user's > selectable > that emacs should use ptys or not by setting process-connection-type ? > --- > Nozomu Ando > > > _______________________________________________ > Emacs-devel mailing list > Emacs-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-devel