|
From: | Lennart Borgman (gmail) |
Subject: | Re: Debug on error and Emacs client |
Date: | Wed, 16 May 2007 13:43:48 +0200 |
User-agent: | Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070326 Thunderbird/2.0.0.0 Mnenhy/0.7.5.666 |
Juanma Barranquero wrote:
On 5/16/07, Lennart Borgman (gmail) <address@hidden> wrote:Sorry, I was using -n too, forgot that. With -n you do not see the error anywhere.That's what I would expect. You're saying to emacsclient to no expect any answer, after all. You can always do: emacsclient -n -e "(condition-case nil (my-bad-fun) (error (raise-frame) (backtrace)))" or something like that if you want to see errors in the server.
Would it not be easier if you get a normal backtrace if debug-on-error is t? Something like this can be used in server.el, server-process-filter:
(if eval (let* (errorp (v (if debug-on-error (eval (car (read-from-string arg))) (condition-case errobj (eval (car (read-from-string arg))) (error (setq errorp t) errobj))))) (when v (with-temp-buffer (let ((standard-output (current-buffer))) (when errorp (princ "error: ")) (pp v) (ignore-errors(process-send-region proc (point-min) (point-max)))
))))I have just added the (if debug-on-error ...) here. Maybe there should be another, server specific variable too so that one can have debug-on-error t without getting a backtrace for this case.
[Prev in Thread] | Current Thread | [Next in Thread] |