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: Mon, 17 Jan 2005 09:41:01 -0800 Message-ID: References: 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 1105983751 32065 80.91.229.6 (17 Jan 2005 17:42:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 17 Jan 2005 17:42:31 +0000 (UTC) Cc: Chip Coldwell , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 17 18:42:23 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 1CqatT-0003J8-00 for ; Mon, 17 Jan 2005 18:42:23 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Cqb5K-00056i-Dt for ged-emacs-devel@m.gmane.org; Mon, 17 Jan 2005 12:54:38 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Cqb54-00053M-5P for emacs-devel@gnu.org; Mon, 17 Jan 2005 12:54:22 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Cqb51-00051m-MH for emacs-devel@gnu.org; Mon, 17 Jan 2005 12:54:20 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Cqb51-00051I-DM for emacs-devel@gnu.org; Mon, 17 Jan 2005 12:54:19 -0500 Original-Received: from [17.250.248.85] (helo=smtpout.mac.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CqasD-0007l8-R9 for emacs-devel@gnu.org; Mon, 17 Jan 2005 12:41:06 -0500 Original-Received: from mac.com (smtpin07-en2 [10.13.10.152]) by smtpout.mac.com (Xserve/MantshX 2.0) with ESMTP id j0HHf46B019108; Mon, 17 Jan 2005 09:41:04 -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/smtpin07/MantshX 4.0) with ESMTP id j0HHf2es018630; Mon, 17 Jan 2005 09:41:03 -0800 (PST) In-Reply-To: Original-To: Stefan Monnier 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:32298 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:32298 I checked in this fix. It seemed like the right thing to do regardless. As for pty's, there were still some issues with the last few characters of a process being eaten. I can't seem reproduce it now as easily as before, so maybe it was actually solved. If there's a consensus, I can switch it back. Index: lisp/term/mac-win.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/term/mac-win.el,v retrieving revision 1.30 diff -u -d -b -w -r1.30 mac-win.el --- lisp/term/mac-win.el 30 Dec 2004 02:04:31 -0000 1.30 +++ lisp/term/mac-win.el 17 Jan 2005 17:40:12 -0000 @@ -1696,8 +1696,9 @@ ;; Tell Emacs to use pipes instead of pty's for processes because the ;; latter sometimes lose characters. Pty support is compiled in since -;; ange-ftp will not work without it. -(setq process-connection-type nil) +;; ange-ftp will not work without it. Fixed with darwin 7 (OS X 10.3). +(setq process-connection-type + (not (string-match "-darwin[0-6]\\." system-configuration))) ;; Assume that fonts are always scalable on the Mac. This sometimes ;; results in characters with jagged edges. However, without it, -Steven On Jan 17, 2005, at 8:08 AM, Stefan Monnier wrote: >> The function creates a shell using "make-comint", then waits for the >> shell to start in the loop at the bottom. Presumably, when the shell >> has started, it will issue a prompt and the (buffer-size) procedure >> will return non-zero and break out of the loop. The problem is that >> it never does. > >> I am informed by Andreas Schwab that ptys are broken on Mac OS X, and >> therefore process-connection-type is set to nil so instead of >> allocating >> a pseudo-terminal to communicate with the sub-process emacs uses a >> pipe. >> The shell discovers that its not connected to a terminal and runs as >> non-interactive, suppressing the prompts and causing the infinite loop >> I describe above. > > AFAIK the "broken tty" issue was solved a while back (somewhere around > 10.3) > and I thought we had reverted process-connection-type's default to t. > But indeed I see in lisp/term/mac-win.el that we still set > process-connection-type to nil. Shouldn't we remove it, or at least > make it > depend on the OS's version? > >> --- emacs/lisp/textmodes/tex-mode.el.~1.153.~ Sat Dec 11 17:00:38 >> 2004 >> +++ emacs/lisp/textmodes/tex-mode.el Sun Jan 16 13:59:50 2005 >> @@ -1495,7 +1495,8 @@ >> (make-comint >> "tex-shell" >> (or tex-shell-file-name (getenv "ESHELL") shell-file-name) >> - nil) >> + nil >> + "-i") >> (let ((proc (get-process "tex-shell"))) >> (set-process-sentinel proc 'tex-shell-sentinel) >> (set-process-query-on-exit-flag proc nil) > >> This adds the "-i" switch to the command line that exec's the shell, >> causing >> it to run interactively. > >> I have tested this on Mac OS X and it did solve the problem. A very >> similar >> "-i" switch appears in lisp/shell.el ("M-x shell"). > > Indeed, shell uses the same trick. So I guess it's OK to do it in > tex-shell > as well. If anybody wants to install that patch, please do it for me. > > > Stefan > > > _______________________________________________ > Emacs-devel mailing list > Emacs-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-devel