From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#12908: 24.3.50; file `emacs_backtrace.txt'? Date: Sat, 17 Nov 2012 13:25:17 -0800 Organization: UCLA Computer Science Department Message-ID: <50A800BD.2@cs.ucla.edu> References: <4B9EFDFEE27E43DBB6331605DD7C2842@us.oracle.com> <50A7DB2C.7050501@cs.ucla.edu> <8339082gig.fsf@gnu.org> <50A7E5AB.3040006@cs.ucla.edu> <83zk2g10ew.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1353187579 25771 80.91.229.3 (17 Nov 2012 21:26:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 17 Nov 2012 21:26:19 +0000 (UTC) Cc: 12908@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Nov 17 22:26:29 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TZpuE-0004jk-Lj for geb-bug-gnu-emacs@m.gmane.org; Sat, 17 Nov 2012 22:26:26 +0100 Original-Received: from localhost ([::1]:56530 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TZpu4-0001Vb-Hp for geb-bug-gnu-emacs@m.gmane.org; Sat, 17 Nov 2012 16:26:16 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:52368) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TZpu0-0001Tm-Fk for bug-gnu-emacs@gnu.org; Sat, 17 Nov 2012 16:26:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TZptx-0007pb-Cm for bug-gnu-emacs@gnu.org; Sat, 17 Nov 2012 16:26:12 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41184) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TZptx-0007pX-9w for bug-gnu-emacs@gnu.org; Sat, 17 Nov 2012 16:26:09 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TZpun-0004aL-Ls for bug-gnu-emacs@gnu.org; Sat, 17 Nov 2012 16:27:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 17 Nov 2012 21:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12908 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 12908-submit@debbugs.gnu.org id=B12908.135318757817577 (code B ref 12908); Sat, 17 Nov 2012 21:27:01 +0000 Original-Received: (at 12908) by debbugs.gnu.org; 17 Nov 2012 21:26:18 +0000 Original-Received: from localhost ([127.0.0.1]:51435 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TZpu3-0004ZN-Ep for submit@debbugs.gnu.org; Sat, 17 Nov 2012 16:26:17 -0500 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:56633) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TZptz-0004ZB-1J for 12908@debbugs.gnu.org; Sat, 17 Nov 2012 16:26:13 -0500 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 2191AA60017; Sat, 17 Nov 2012 13:25:16 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id reajfedXQeYR; Sat, 17 Nov 2012 13:25:15 -0800 (PST) Original-Received: from [192.168.1.3] (pool-71-189-154-249.lsanca.fios.verizon.net [71.189.154.249]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id B6FA5A60001; Sat, 17 Nov 2012 13:25:15 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux i686; rv:16.0) Gecko/20121028 Thunderbird/16.0.2 In-Reply-To: <83zk2g10ew.fsf@gnu.org> X-Spam-Score: -1.6 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-Spam-Score: -1.6 (-) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:67083 Archived-At: On 11/17/2012 11:42 AM, Eli Zaretskii wrote: > Unless we are going to ask each Emacs user to change the default so > that the file ends up in .emacs.d, we still have a discrepancy vs what > Stefan asked to do. I must have missed that request; all I see from him in Bug#12908 is a comment about how to deal with the file names under the assumption that Emacs itself redirects stderr to a file whose name Emacs chooses. That assumption is currently true on Microsoft Windows for backtraces, but it's not true for GNU and Unix where we don't have the problem. >> Perhaps it would be better for Emacs, on Microsoft Windows, to >> redirect stderr to a file, so that the information does not get >> lost. > > It's not easy to do that Can Emacs use freopen? For example, the following code would do the job on a POSIX platform: if stderr is closed, it redirects it to emacs-stderr.txt in the current directory, if possible. Would this sort of thing work on Microsoft platform? === modified file 'src/emacs.c' --- src/emacs.c 2012-11-08 19:12:23 +0000 +++ src/emacs.c 2012-11-17 21:23:46 +0000 @@ -748,6 +748,11 @@ main (int argc, char **argv) unexec_init_emacs_zone (); #endif +#ifdef DOS_NT + if (dup2 (STDERR_FILENO, STDERR_FILENO) < 0) + ignore_value (freopen ("emacs-stderr.txt", "a", stderr)); +#endif + atexit (close_output_streams); sort_args (argc, argv);