From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Device 0 is not a termcap terminal device Date: Wed, 2 Sep 2009 09:43:16 +0000 Message-ID: <20090902094316.GA2550@muc.de> References: <20081003100758.GA1762@muc.de> <200810031625.m93GPZKn023230@mothra.ics.uci.edu> <20090901200826.GA2657@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1251884503 13712 80.91.229.12 (2 Sep 2009 09:41:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 2 Sep 2009 09:41:43 +0000 (UTC) Cc: csant , emacs-devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 02 11:41:36 2009 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 1MimLP-00085s-1i for ged-emacs-devel@m.gmane.org; Wed, 02 Sep 2009 11:41:35 +0200 Original-Received: from localhost ([127.0.0.1]:42302 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MimLN-0001VW-IM for ged-emacs-devel@m.gmane.org; Wed, 02 Sep 2009 05:41:33 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MimK5-0000gd-M3 for emacs-devel@gnu.org; Wed, 02 Sep 2009 05:40:13 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MimK0-0000dL-Jo for emacs-devel@gnu.org; Wed, 02 Sep 2009 05:40:12 -0400 Original-Received: from [199.232.76.173] (port=35217 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MimK0-0000d4-65 for emacs-devel@gnu.org; Wed, 02 Sep 2009 05:40:08 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:2917 helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MimJz-0000dw-LQ for emacs-devel@gnu.org; Wed, 02 Sep 2009 05:40:08 -0400 Original-Received: (qmail 62686 invoked by uid 3782); 2 Sep 2009 09:40:05 -0000 Original-Received: from acm.muc.de (pD9E23BB7.dip.t-dialin.net [217.226.59.183]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Wed, 02 Sep 2009 11:40:04 +0200 Original-Received: (qmail 13279 invoked by uid 1000); 2 Sep 2009 09:43:16 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.6-4.9 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:114982 Archived-At: Hi, Stefan! On Tue, Sep 01, 2009 at 07:20:01PM -0400, Stefan Monnier wrote: > > A little less that a year ago, I supplied a "me too" to this bug in which > > batch programs would crash with the error message > > Device 0 is not a termcap terminal device > > I have now tracked this bug down: `send-string-to-terminal' crashes in > > -batch. To see this, compare the following: > Does the patch below help? Yes, wonderfully! Thank you very much! Would you like me to make a proper patch (including changing the doc string and the elisp page) out of this? > > The documentation of the function in the Elisp manual for Emacs 22 > > just said that the string is sent to "the terminal", which presumably > > means stdout. > There's a subtle difference between the two, but yes, they used to be > pretty much the same. With multi-tty, the difference is made more > significant. > > In Emacs 23's Elisp, it says the string goes to "the selected frame's > > terminal", which is clearly undefined in batch mode. > Actually, it is well defined: when Emacs starts it starts with a special > frame on a special terminal (a dumb terminal), later on, this terminal > is usually deleted and replaced with an X11 or tty terminal, except in > batch mode and in daemon mode. Look for the `terminal-frame' variable > and its uses in startup.el and frame.el to see it in action. > > This change wasn't in the "incompatible changes" section of NEWS, so it > > would appear to be a bug. > send-string-to-terminal is rarely used, and even more so in batch mode > (where you could argue that it worked by accident). That's why nobody > noticed the problem (and neither decided to fix it nor to document it). Well, whether it worked by accident or design in batch mode, it's useful. :-) Funny thing is: running 000test.el has flagged up some CC Mode bugs which weren't bugs in Emacs 22. More work. :-( Thanks again! > Stefan -- Alan Mackenzie (Nuremberg, Germany).