GNU bug report logs -
#18373
desktop-create-buffer: may call bury-buffer on a just killed buffer (?)
Previous Next
Reported by: Ivan Shmakov <ivan <at> siamics.net>
Date: Sun, 31 Aug 2014 21:32:01 UTC
Severity: minor
Tags: patch
Fixed in version 24.4
Done: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Tue, 09 Sep 2014 20:48:36 -0400
with message-id <jwvr3zkgv2v.fsf-monnier+emacsbugs <at> gnu.org>
and subject line Re: bug#18373: desktop-create-buffer: may call bury-buffer on a just killed buffer (?)
has caused the debbugs.gnu.org bug report #18373,
regarding desktop-create-buffer: may call bury-buffer on a just killed buffer (?)
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
18373: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18373
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
[Message part 3 (text/plain, inline)]
Package: emacs
Severity: minor
Tags: patch
Currently, desktop-create-buffer calls bury-buffer on every
buffer listed in a saved version of (buffer-list) so to restore
the order of buffers:
1375 ;; Restore buffer list order with new buffer at end. Don't change
1376 ;; the order for old desktop files (old desktop module behavior).
1377 (unless (< desktop-file-version 206)
1378 (mapc 'bury-buffer buffer-list)
1379 (when result (bury-buffer result)))
This, however, fails – should one or more of these buffers be
killed after the list is saved but before it’s processed, – as
happens with some (presumably temporary) buffers used by
url-retrieve, which is in turn used while restoring EWW buffers
per [1]. (Please note that the patch there is broken, though.)
The patch MIMEd seems to fix the issue for me, although I’m not
as of yet certain that no buffer can be killed in between the
buffer-live-p check and the bury-buffer call.
[1] http://debbugs.gnu.org/18010
--
FSF associate member #7257 http://boycottsystemd.org/ … 3013 B6A0 230E 334A
[Message part 4 (text/diff, inline)]
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -1375,7 +1375,10 @@ after that many seconds of idle time."
;; Restore buffer list order with new buffer at end. Don't change
;; the order for old desktop files (old desktop module behavior).
(unless (< desktop-file-version 206)
- (mapc 'bury-buffer buffer-list)
+ (mapc (lambda (buf)
+ (and (buffer-live-p buf)
+ (bury-buffer buf)))
+ buffer-list)
(when result (bury-buffer result)))
(when result
(unless (or desktop-first-buffer (< desktop-file-version 206))
[Message part 5 (message/rfc822, inline)]
Version:24.4
> This, however, fails – should one or more of these buffers be
> killed after the list is saved but before it’s processed, – as
> happens with some (presumably temporary) buffers used by
> url-retrieve, which is in turn used while restoring EWW buffers
> per [1]. (Please note that the patch there is broken, though.)
> The patch MIMEd seems to fix the issue for me, although I’m not
> as of yet certain that no buffer can be killed in between the
> buffer-live-p check and the bury-buffer call.
Thanks, the patch looks good and safe, so I installed it into `emacs-24'.
Stefan
This bug report was last modified 10 years and 326 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.