From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: bojohan+news@dd.chalmers.se (Johan =?utf-8?Q?Bockg=C3=A5rd?=) Newsgroups: gmane.emacs.devel Subject: Re: eval-buffer with debug-on-error t Date: Sat, 09 Jul 2005 12:23:01 +0200 Message-ID: References: <42CD314E.7050709@student.lu.se> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1120905076 1053 80.91.229.2 (9 Jul 2005 10:31:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 9 Jul 2005 10:31:16 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 09 12:31:07 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DrCbt-0004yy-TZ for ged-emacs-devel@m.gmane.org; Sat, 09 Jul 2005 12:31:02 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DrCdL-0003u4-VV for ged-emacs-devel@m.gmane.org; Sat, 09 Jul 2005 06:32:32 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DrCX4-0003Mw-6c for emacs-devel@gnu.org; Sat, 09 Jul 2005 06:26:04 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DrCWy-0003MA-4O for emacs-devel@gnu.org; Sat, 09 Jul 2005 06:25:57 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DrCWv-0003KM-8z for emacs-devel@gnu.org; Sat, 09 Jul 2005 06:25:54 -0400 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtp (TLS-1.0:RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1DrCbd-00035v-Lq for emacs-devel@gnu.org; Sat, 09 Jul 2005 06:30:45 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1DrCUN-0004PX-7h for emacs-devel@gnu.org; Sat, 09 Jul 2005 12:23:15 +0200 Original-Received: from linus003.dd.chalmers.se ([129.16.117.203]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 09 Jul 2005 12:23:15 +0200 Original-Received: from bojohan+news by linus003.dd.chalmers.se with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 09 Jul 2005 12:23:15 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-To: emacs-devel@gnu.org Original-Lines: 55 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: linus003.dd.chalmers.se Mail-Copies-To: never User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:4eC7d0L/+Fncms3Cab6+7X3+XAM= X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:40686 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:40686 "Richard M. Stallman" writes: > Does this fix it? (I installed a more elaborate patch.) Well, it does make the error go away. A problem is that `debugger-old-buffer' is not necessarily the same buffer that was current when `eval-buffer' was called. Example (with the patch): Run emacs -Q M-x toggle-debug-on-error RET Insert this into *scratch*: (get-buffer-create "foo") (with-current-buffer "foo" (error "foo")) M-x eval-buffer RET => Debugger entered--Lisp error: (error "foo") signal(error ("foo")) error("foo") (save-current-buffer (set-buffer "foo") (error "foo")) (with-current-buffer "foo" (error "foo")) eval-buffer() ; Reading at buffer position 1 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This is the position in the "foo" buffer. `eval-region' has the same problem. In fact, regardless of that problem the feature does not seem very useful at present when it comes to eval-region. E.g. if you do C-x h M-x eval-region RET and there is an error you will get a note like this in the backtrace no matter where the error occurred: eval-region(1 500) ; Reading at buffer position 1 Since point doesn't move (eval-region apparently works differently than eval-buffer in this respect) the value of point will always be at the start or the end of the region (and these values are already present in the backtrace). -- Johan Bockgård