From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Backtrace printing in batch mode ignores all customizations Date: Wed, 15 Jan 2020 17:58:21 +0200 Message-ID: <83y2u84spu.fsf@gnu.org> References: <83h80y59l6.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="ciao:159.69.161.202"; logging-data="8083"; mail-complaints-to="usenet@ciao.gmane.io" Cc: pogonyshev@gmail.com, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jan 15 17:44:33 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1irlmS-0001wz-I9 for ged-emacs-devel@m.gmane-mx.org; Wed, 15 Jan 2020 17:44:32 +0100 Original-Received: from localhost ([::1]:57010 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1irlmR-0005T9-3H for ged-emacs-devel@m.gmane-mx.org; Wed, 15 Jan 2020 11:44:31 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58083) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1irl3b-0002Hd-LG for emacs-devel@gnu.org; Wed, 15 Jan 2020 10:58:12 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:38821) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1irl3b-0007tV-8Q; Wed, 15 Jan 2020 10:58:11 -0500 Original-Received: from [176.228.60.248] (port=1995 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1irl3X-0006Mc-Vr; Wed, 15 Jan 2020 10:58:09 -0500 In-reply-to: (message from Stefan Monnier on Tue, 14 Jan 2020 15:30:24 -0500) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:244276 Archived-At: > From: Stefan Monnier > Cc: pogonyshev@gmail.com, emacs-devel@gnu.org > Date: Tue, 14 Jan 2020 15:30:24 -0500 > > > Btw, I'd be much happier if the condition didn't rely on low-level > > implementation details such as the actual name of the initial > > terminal, nor on when exactly during startup that terminal gets > > deleted. I think it would be much cleaner to set a variable at the > > right place in startup.el (AFAIU, after we call frame-initialize), and > > test it in debug.el. I realize that this condition was copied from > > the code we already had in debug.el, but maybe on master we should use > > a cleaner solution. > > Setting a var wouldn't be right. Why not? > The test: > > (and (eq t (framep (selected-frame))) > (equal "initial_terminal" (terminal-name))) > > is fundamentally *right* I didn't say it was wrong, I said it wasn't clean enough, IMO. We know exactly where in the startup process the interactive frame becomes available: after the call to frame-initialize. Why wouldn't it be right to set a flag there which debug.el could test, instead of testing the above? > Maybe we can improve the code by introducing a function > > (defun terminal-dummy-p () > "Return non-nil if the current terminal is the special initial terminal. > The \"initial\" terminal is the dummy-terminal used when we don't have > a real terminal to use, such as is the case in batch mode, or while > running early-init.el, or while starting the emacs-server." > (and (eq t (framep (selected-frame))) > (equal "initial_terminal" (terminal-name))) > > and then use it there (and maybe we could then cleanup that function > so it doesn't need to rely on a special terminal name). Even with such a function, my question above still stands. But anyway, there's no need to wait with installing this on emacs-27 until we end discussing how to make the test cleaner. The cleanup should go to master in any case.