all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#18373: desktop-create-buffer: may call bury-buffer on a just killed buffer (?)
@ 2014-08-31 21:31 Ivan Shmakov
  2014-09-10  0:48 ` Stefan Monnier
  2014-09-10  0:53 ` Stefan Monnier
  0 siblings, 2 replies; 5+ messages in thread
From: Ivan Shmakov @ 2014-08-31 21:31 UTC (permalink / raw
  To: 18373

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#18373: desktop-create-buffer: may call bury-buffer on a just killed buffer (?)
  2014-08-31 21:31 bug#18373: desktop-create-buffer: may call bury-buffer on a just killed buffer (?) Ivan Shmakov
@ 2014-09-10  0:48 ` Stefan Monnier
  2014-09-10  0:53 ` Stefan Monnier
  1 sibling, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2014-09-10  0:48 UTC (permalink / raw
  To: Ivan Shmakov; +Cc: 18373-done

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





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#18373: desktop-create-buffer: may call bury-buffer on a just killed buffer (?)
  2014-08-31 21:31 bug#18373: desktop-create-buffer: may call bury-buffer on a just killed buffer (?) Ivan Shmakov
  2014-09-10  0:48 ` Stefan Monnier
@ 2014-09-10  0:53 ` Stefan Monnier
  2014-09-16 13:59   ` Ivan Shmakov
  1 sibling, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2014-09-10  0:53 UTC (permalink / raw
  To: Ivan Shmakov; +Cc: 18373

While this patch was sufficiently small that we could accept it as is,
if you intend to send us further patches (which I hope you do), you may
soon bump into the limit of what we can accept without paperwork.

So I think it might be worthwhile to sign the paperwork now, so that
it's out of the way.  If you agree, then please fill the form below and
send it to the FSF as instructed so they can send you the relevant
paperwork to sign.

And if I already asked you this, then please accept my apologies for
repeating myself.  I'm having a hard time keeping track of these, for
some reason (I guess I should write it down somewhere).


        Stefan


Please email the following information to assign@gnu.org, and we
will send you the assignment form for your past and future changes.

Please use your full legal name (in ASCII characters) as the subject
line of the message.
----------------------------------------------------------------------
REQUEST: SEND FORM FOR PAST AND FUTURE CHANGES

[What is the name of the program or package you're contributing to?]
Emacs

[Did you copy any files or text written by someone else in these changes?
Even if that material is free software, we need to know about it.]


[Do you have an employer who might have a basis to claim to own
your changes?  Do you attend a school which might make such a claim?]


[For the copyright registration, what country are you a citizen of?]


[What year were you born?]


[Please write your email address here.]


[Please write your postal address here.]





[Which files have you changed so far, and which new files have you written
so far?]





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#18373: desktop-create-buffer: may call bury-buffer on a just killed buffer (?)
  2014-09-10  0:53 ` Stefan Monnier
@ 2014-09-16 13:59   ` Ivan Shmakov
  2014-09-24 18:55     ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Ivan Shmakov @ 2014-09-16 13:59 UTC (permalink / raw
  To: 18373

>>>>> Stefan Monnier <monnier@IRO.UMontreal.CA> writes:

[…]

 > So I think it might be worthwhile to sign the paperwork now, so that
 > it's out of the way.  If you agree, then please fill the form below
 > and send it to the FSF as instructed so they can send you the
 > relevant paperwork to sign.

	I’ve just got confirmation that my assignment papers are
	processed (at last!)  FTR, the rt.gnu.org ticket is #874240.

[…]

-- 
FSF associate member #7257  http://boycottsystemd.org/  … 3013 B6A0 230E 334A





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#18373: desktop-create-buffer: may call bury-buffer on a just killed buffer (?)
  2014-09-16 13:59   ` Ivan Shmakov
@ 2014-09-24 18:55     ` Stefan Monnier
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2014-09-24 18:55 UTC (permalink / raw
  To: Ivan Shmakov; +Cc: 18373

> 	I’ve just got confirmation that my assignment papers are
> 	processed (at last!)  FTR, the rt.gnu.org ticket is #874240.

OK, I see them now.  Great, thank you.
Waiting for your patches now ;-)


        Stefan





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-09-24 18:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-31 21:31 bug#18373: desktop-create-buffer: may call bury-buffer on a just killed buffer (?) Ivan Shmakov
2014-09-10  0:48 ` Stefan Monnier
2014-09-10  0:53 ` Stefan Monnier
2014-09-16 13:59   ` Ivan Shmakov
2014-09-24 18:55     ` Stefan Monnier

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.