From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Live System User Newsgroups: gmane.emacs.bugs Subject: bug#24616: 26.0.50; No backtrace when emacsclient --eval fails Date: Sun, 23 Oct 2016 20:51:19 -0400 Message-ID: <8737jmlgc8.fsf@aol.com> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1477270418 5497 195.159.176.226 (24 Oct 2016 00:53:38 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 24 Oct 2016 00:53:38 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: 24616@debbugs.gnu.org, clement.pit@gmail.com To: npostavs@users.sourceforge.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Oct 24 02:53:33 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1byTVo-0006qS-Gh for geb-bug-gnu-emacs@m.gmane.org; Mon, 24 Oct 2016 02:53:12 +0200 Original-Received: from localhost ([::1]:43143 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1byTVq-0003jF-MM for geb-bug-gnu-emacs@m.gmane.org; Sun, 23 Oct 2016 20:53:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36781) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1byTVj-0003ix-QA for bug-gnu-emacs@gnu.org; Sun, 23 Oct 2016 20:53:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1byTVg-0006yr-LF for bug-gnu-emacs@gnu.org; Sun, 23 Oct 2016 20:53:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35457) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1byTVg-0006tm-ID for bug-gnu-emacs@gnu.org; Sun, 23 Oct 2016 20:53:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1byTVe-0003UU-41 for bug-gnu-emacs@gnu.org; Sun, 23 Oct 2016 20:53:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Live System User Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Oct 2016 00:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24616 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Original-Received: via spool by 24616-submit@debbugs.gnu.org id=B24616.147727032813356 (code B ref 24616); Mon, 24 Oct 2016 00:53:02 +0000 Original-Received: (at 24616) by debbugs.gnu.org; 24 Oct 2016 00:52:08 +0000 Original-Received: from localhost ([127.0.0.1]:50856 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1byTUm-0003TM-77 for submit@debbugs.gnu.org; Sun, 23 Oct 2016 20:52:08 -0400 Original-Received: from omr-a012e.mx.aol.com ([204.29.186.61]:38693) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1byTUl-0003Sv-2B for 24616@debbugs.gnu.org; Sun, 23 Oct 2016 20:52:07 -0400 Original-Received: from mtaout-mac01.mx.aol.com (mtaout-mac01.mx.aol.com [172.26.222.205]) by omr-a012e.mx.aol.com (Outbound Mail Relay) with ESMTP id 76EF6380009E; Sun, 23 Oct 2016 20:52:01 -0400 (EDT) Original-Received: from localhost.localdomain (c-50-163-96-131.hsd1.ma.comcast.net [50.163.96.131]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mtaout-mac01.mx.aol.com (MUA/Third Party Client Interface) with ESMTPSA id DC68438000085; Sun, 23 Oct 2016 20:52:00 -0400 (EDT) x-aol-global-disposition: G DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mx.aol.com; s=20150623; t=1477270321; bh=fdJ3Zb2xLECNhfTQZX3x78JznN/cyTUHVgCIeiMvI4U=; h=From:To:Subject:Message-ID:Date:MIME-Version:Content-Type; b=VzGFCGejQrxdE2j6g5HwGjCYbxs5W9/KBib3VWtNn8677jW7bHbcx5T1q0v7UoA8K 0r2CTxlmnc+jnRz9TTHelM2uFK27LMEChyxKK7EypcS5PKgZ0nK8B6/AeUAKYclOY0 SRzoXb4JGY/5YQ4GwmdNib0sIXqY4yqvGhlJQzC0= x-aol-sid: 3039ac1adecd580d5b301112 X-AOL-IP: 50.163.96.131 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:124941 Archived-At: npostavs@users.sourceforge.net writes: > Eli Zaretskii writes: > >>> From: npostavs@users.sourceforge.net >>> Cc: 24616@debbugs.gnu.org, clement.pit@gmail.com >>> Date: Sat, 22 Oct 2016 11:35:49 -0400 >>> >>> Something like this? >>> >>> diff --git i/doc/lispref/debugging.texi w/doc/lispref/debugging.texi >>> index c88a2fa..bb3ced4 100644 >>> --- i/doc/lispref/debugging.texi >>> +++ w/doc/lispref/debugging.texi >>> @@ -152,6 +152,11 @@ Error Debugging >>> must still fulfill the criteria specified by @code{debug-on-error} and >>> @code{debug-ignored-errors}.) >>> >>> +For example, setting this variable is useful to get a backtrace from >>> +code evaluated by emacsclient. If elisp code evaluated by emacsclient >>> +signals an error while this variable is non-@code{nil}, the backtrace >>> +will popup in the running Emacs. >>> + >> >> Yes, but please mention "--eval", and add an index entry so that this >> text would be easier to locate. Something like this: >> >> @cindex emacsclient, getting a backtrace >> @cindex backtrace from emacsclient's @option{--eval} >> >> Also, a nit: I don't think we use "elisp" in the manual, we say >> "Lisp" instead. >> >> Thanks. > > Fixed and pushed as b2ba6307 "Explain how to debug emacsclient lisp > errors". This example doesn't work for me with Emacs daemon and the default Emacs terminal: 0. emacs -Q --daemon Warning: due to a long standing Gtk+ bug http://bugzilla.gnome.org/show_bug.cgi?id=85715 Emacs might crash when run in daemon mode and the X11 connection is unexpectedly lost. Using an Emacs configured with --with-x-toolkit=lucid does not have this problem. Starting Emacs daemon. 1. emacsclient -n --eval '(progn (defun f () (error "foo")) (setq debug-on-signal t debug-on-error t) (f))' (Aside: Although the option "-n" was used, Emacs doesn't return to the command prompt.) 2. From another xterm, connect to the Emacs server in order to see the *backtrace* buffer that should have been created: emacsclient -n non-existant-file.txt You now see an Emacs in the default TTY-mode with the *backtrace* buffer displayed: Debugger entered--Lisp error: (error "foo") signal(error ("foo")) error("foo") f() (progn (defun f nil (error "foo")) (setq debug-on-signal t debug-on-error t) $ eval((progn (defun f nil (error "foo")) (setq debug-on-signal t debug-on-erro$ server-eval-and-print("(progn (defun f () (error \"foo\")) (setq debug-on-sig$ #[0 "\302\301\242\300\"\207" [#> ("(progn (defun f () (err$ funcall(#[0 "\302\301\242\300\"\207" [#> ("(progn (defun f$ mapc(funcall (#[0 "\302\301\242\300\"\207" [#> ("(progn (d$ server-execute(#> nil t (#[0 "\302\301\242\300\"\207" [#>) server-process-filter(#> "-dir /home/liveuser/ -nowait -cu$ However, when you press any keycords, like "C-x C-b" (list-buffers), nothing happens! You can't "C-x k" (kill-buffer) or "M-x" (execute-extended-command). The only thing you can do is kill Emacs from another terminal shell prompt. You can, of course, do all f these things if you use Emacs in GUI-mode (emacsclient -c ...) instead of its default TTY-mode. Thanks.