all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ivan Shmakov <ivan@siamics.net>
To: 18373@debbugs.gnu.org
Subject: bug#18373: desktop-create-buffer: may call bury-buffer on a just killed buffer (?)
Date: Sun, 31 Aug 2014 21:31:41 +0000	[thread overview]
Message-ID: <87ppfgtkg2.fsf@violet.siamics.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 1123 bytes --]

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/diff, Size: 539 bytes --]

--- 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))

             reply	other threads:[~2014-08-31 21:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-31 21:31 Ivan Shmakov [this message]
2014-09-10  0:48 ` bug#18373: desktop-create-buffer: may call bury-buffer on a just killed buffer (?) Stefan Monnier
2014-09-10  0:53 ` Stefan Monnier
2014-09-16 13:59   ` Ivan Shmakov
2014-09-24 18:55     ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ppfgtkg2.fsf@violet.siamics.net \
    --to=ivan@siamics.net \
    --cc=18373@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.