[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#24616: 26.0.50; No backtrace when emacsclient --eval fails

From: Live System User
Subject: bug#24616: 26.0.50; No backtrace when emacsclient --eval fails
Date: Sun, 23 Oct 2016 20:51:19 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

address@hidden writes:

> Eli Zaretskii <address@hidden> writes:
>>> From: address@hidden
>>> Cc: address@hidden,  address@hidden
>>> 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 address@hidden, 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
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 
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

Debugger entered--Lisp error: (error "foo")
  signal(error ("foo"))
  (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" [#<process server <1>> ("(progn (defun f () (err$
  funcall(#[0 "\302\301\242\300\"\207" [#<process server <1>> ("(progn (defun f$
  mapc(funcall (#[0 "\302\301\242\300\"\207" [#<process server <1>> ("(progn (d$
  server-execute(#<process server <1>> nil t (#[0 "\302\301\242\300\"\207" [#<p$
  #[0 "address@hidden@address@hidden
  server-execute-continuation(#<process server <1>>)
  server-process-filter(#<process server <1>> "-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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]