From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Chip Coldwell Newsgroups: gmane.emacs.bugs Subject: Re: Emacs 21.3.50.1 (CVS sources) tex-mode bug Date: Sun, 16 Jan 2005 14:51:06 -0500 (EST) Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Trace: sea.gmane.org 1105905239 6679 80.91.229.6 (16 Jan 2005 19:53:59 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 16 Jan 2005 19:53:59 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jan 16 20:53:51 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 1CqGT9-0008Fe-00 for ; Sun, 16 Jan 2005 20:53:51 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CqGex-0008Q3-OQ for geb-bug-gnu-emacs@m.gmane.org; Sun, 16 Jan 2005 15:06:03 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1CqGev-0008Ow-9V for bug-gnu-emacs@gnu.org; Sun, 16 Jan 2005 15:06:01 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1CqGeq-0008N0-SC for bug-gnu-emacs@gnu.org; Sun, 16 Jan 2005 15:05:57 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CqGeq-0008MF-M2 for bug-gnu-emacs@gnu.org; Sun, 16 Jan 2005 15:05:56 -0500 Original-Received: from [128.103.101.20] (helo=physics.harvard.edu) by monty-python.gnu.org with esmtp (TLSv1:RC4-SHA:128) (Exim 4.34) id 1CqGQY-0003lA-Rg for bug-gnu-emacs@gnu.org; Sun, 16 Jan 2005 14:51:10 -0500 Original-Received: from frank.harvard.edu ([140.247.122.99]) by physics.harvard.edu with asmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1CqGQY-0001HY-Ii for bug-gnu-emacs@gnu.org; Sun, 16 Jan 2005 14:51:10 -0500 Original-To: bug-gnu-emacs@gnu.org In-Reply-To: X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:10458 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:10458 I discovered that the sub shell will prompt correctly if invoked as an interactive shell. I wonder if Apple has been tinkering with how bash(1) behaves (or perhaps someone at FSF?). I suppose it is arguably the right thing to do (i.e. not to prompt if not interactive). Here's a tiny patch that fixes my problem (although it could create problems for others): --- 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) Chip -- Charles M. "Chip" Coldwell "Turn on, log in, tune out" On Sun, 16 Jan 2005, Chip Coldwell wrote: > > I realize that I should expect problems if I choose to live on the > bleeding edge, but I figure I might as well report this problem just > in case the developers aren't already aware of it. > > The problem is with Emacs 21.3.50.1 that I checked out from CVS > sources and compiled using the emacs/mac/make-package shell script on > the Macintosh OS X (10.3.7). If I am editing in tex-mode and I run > the function 'tex-file' (by default bound to C-c C-f) emacs goes into > an infinite loop. The loop is in the function tex-mode.el:tex-start-shell > > (defun tex-start-shell () > (with-current-buffer > (make-comint > "tex-shell" > (or tex-shell-file-name (getenv "ESHELL") shell-file-name) > nil) > (let ((proc (get-process "tex-shell"))) > (set-process-sentinel proc 'tex-shell-sentinel) > (set-process-query-on-exit-flag proc nil) > (tex-shell) > (while (zerop (buffer-size)) > (sleep-for 1))))) > > 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 tried the following trivial program > > (setq subshell (make-comint "subshell" "/bin/bash")) > (switch-to-buffer subshell) > > And it does indeed create a subshell in a buffer, but the shell never > issues a prompt string. Setting the PS1 environment variable has no > effect in this buffer, for reasons I haven't figured out yet. > > Chip > >