GNU bug report logs - #12502
24.2.50; Debugger messes up current-buffer

Previous Next

Package: emacs;

Reported by: Helmut Eller <eller.helmut <at> gmail.com>

Date: Mon, 24 Sep 2012 08:34:01 UTC

Severity: normal

Found in version 24.2.50

Done: martin rudalics <rudalics <at> gmx.at>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 12502 in the body.
You can then email your comments to 12502 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#12502; Package emacs. (Mon, 24 Sep 2012 08:34:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Helmut Eller <eller.helmut <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 24 Sep 2012 08:34:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Helmut Eller <eller.helmut <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.2.50; Debugger messes up current-buffer
Date: Mon, 24 Sep 2012 10:31:04 +0200
The debugger now changes the current buffer in the following situation:

1. Create a file foo.el with this code:

(progn
  (require 'cl)
  (defun foo ()
    (with-current-buffer (get-buffer-create "test")
      (let ((b (current-buffer)))
	(debug)
	(assert (eq b (current-buffer)) t))))
  (foo))

2. In the foo.el buffer, evaluate the expression with C-x C-e

3. The debugger pops up with this message:
   Debugger entered: nil

4. Press c (i.e. debugger-continue)

5. The assertion fails with:
  Assertion failed: (eq b (current-buffer)), #<buffer test>, #<buffer foo.el>

This is a regression to older versions.


In GNU Emacs 24.2.50.1 (i686-pc-linux-gnu, GTK+ Version 2.20.1)
 of 2012-09-22 on ix
Bzr revision: 110128 cyd <at> gnu.org-20120922032937-yf6yua64ed45tzap
Windowing system distributor `The X.Org Foundation', version 11.0.10707000
Configured using:
 `configure '--with-jpeg=no' '--with-gif=no' '--with-tiff=no''





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12502; Package emacs. (Mon, 24 Sep 2012 12:41:02 GMT) Full text and rfc822 format available.

Message #8 received at 12502 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Helmut Eller <eller.helmut <at> gmail.com>
Cc: 12502 <at> debbugs.gnu.org
Subject: Re: bug#12502: 24.2.50; Debugger messes up current-buffer
Date: Mon, 24 Sep 2012 14:38:01 +0200
[Message part 1 (text/plain, inline)]
> The debugger now changes the current buffer in the following situation:
[...]
> This is a regression to older versions.

Thanks for the report.  Would the attached patch fix it?

BTW, I notice that you quite often run functions with a current buffer
different from that of the selected window.  In all these cases
`quit-window' might misbehave for you because it does not restore the
buffer that was current at the time the window's buffer was displayed.
So if you see any problems in this context, please tell me.  We then
could try to restore the current buffer (optionally at least) too.

martin
[debug-restore-current-buffer.diff (text/plain, inline)]
=== modified file 'lisp/emacs-lisp/debug.el'
--- lisp/emacs-lisp/debug.el	2012-09-20 13:35:13 +0000
+++ lisp/emacs-lisp/debug.el	2012-09-24 12:30:50 +0000
@@ -273,7 +273,8 @@
 	    (setq debugger-previous-window-height
 		  (window-total-size debugger-window))
 	    ;; Unshow debugger-buffer.
-	    (quit-restore-window debugger-window debugger-bury-or-kill))
+	    (quit-restore-window debugger-window debugger-bury-or-kill)
+	    (set-buffer debugger-old-buffer))
           ;; Restore previous state of debugger-buffer in case we were
           ;; in a recursive invocation of the debugger, otherwise just
           ;; erase the buffer and put it into fundamental mode.



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12502; Package emacs. (Tue, 25 Sep 2012 15:39:02 GMT) Full text and rfc822 format available.

Message #11 received at 12502 <at> debbugs.gnu.org (full text, mbox):

From: Helmut Eller <eller.helmut <at> gmail.com>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 12502 <at> debbugs.gnu.org
Subject: Re: bug#12502: 24.2.50; Debugger messes up current-buffer
Date: Tue, 25 Sep 2012 17:36:19 +0200
On Mon, Sep 24 2012, martin rudalics wrote:

>> The debugger now changes the current buffer in the following situation:
> [...]
>> This is a regression to older versions.
>
> Thanks for the report.  Would the attached patch fix it?

Yes, that seems to fix the problem.  But the save-exursion in line 218
looks now supsisously irrelevant.

> BTW, I notice that you quite often run functions with a current buffer
> different from that of the selected window.  In all these cases
> `quit-window' might misbehave for you because it does not restore the
> buffer that was current at the time the window's buffer was displayed.
> So if you see any problems in this context, please tell me.  We then
> could try to restore the current buffer (optionally at least) too.

I'l look for problems, but I'm not sure what the correct/incorrect
behaviour regarding window management should be.  The old
save-window-excursion worked pretty well for me.

Helmut




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#12502; Package emacs. (Tue, 25 Sep 2012 16:48:01 GMT) Full text and rfc822 format available.

Message #14 received at 12502 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Helmut Eller <eller.helmut <at> gmail.com>
Cc: 12502 <at> debbugs.gnu.org
Subject: Re: bug#12502: 24.2.50; Debugger messes up current-buffer
Date: Tue, 25 Sep 2012 18:45:27 +0200
> Yes, that seems to fix the problem.  But the save-exursion in line 218
> looks now supsisously irrelevant.

Maybe.  There's another one nested inside.  I know next to nothing about
the internals of the debugger.

> I'l look for problems, but I'm not sure what the correct/incorrect
> behaviour regarding window management should be.  The old
> save-window-excursion worked pretty well for me.

It didn't work at all for people showing the debugger in an extra frame.

martin




Reply sent to martin rudalics <rudalics <at> gmx.at>:
You have taken responsibility. (Wed, 03 Oct 2012 09:16:02 GMT) Full text and rfc822 format available.

Notification sent to Helmut Eller <eller.helmut <at> gmail.com>:
bug acknowledged by developer. (Wed, 03 Oct 2012 09:16:02 GMT) Full text and rfc822 format available.

Message #19 received at 12502-done <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Helmut Eller <eller.helmut <at> gmail.com>
Cc: 12502-done <at> debbugs.gnu.org
Subject: Re: bug#12502: 24.2.50; Debugger messes up current-buffer
Date: Wed, 03 Oct 2012 11:14:55 +0200
>> Thanks for the report.  Would the attached patch fix it?
>
> Yes, that seems to fix the problem.

Installed.  Bug closed.

> But the save-exursion in line 218
> looks now supsisously irrelevant.

I left it in because IIUC it can't do any harm.

martin




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 31 Oct 2012 11:24:02 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 230 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.