"Richard M. Stallman" <[EMAIL PROTECTED]> 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



_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

Reply via email to