all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Kevin Ryde <user42@zip.com.au>
Cc: 5273@debbugs.gnu.org
Subject: bug#5273: 23.1; format-alist encode vs write-region-post-annotation-function
Date: Fri, 22 Jan 2010 10:29:35 -0500	[thread overview]
Message-ID: <jwvhbqekvox.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <871vhj5c25.fsf@blah.blah> (Kevin Ryde's message of "Fri, 22 Jan 2010 09:26:58 +1100")

>> the issue of temp buffers accumulating if to-fn errors out is indeed
>> a problem, but not a new one,

> I presume kill-on-write was an attempt to address that though.

No, not at all, the kill-on-write is done so that the buffer gets killed
after the calling's write-region terminates (the
post-annotation-function returns the buffer to write-region, so it
cannot kill it itself and is not involved any more after that so it has
no direct way to kill the buffer other than via this
write-region-post-annotation-function).

> As I say, I suspect the `format-count' passed from build_annotations()
> naming the buffer "Format Temp 0" etc the same on each call will keep a
> lid on how many leftovers.

> I suspect that also means it's not reentrant -- if the TO-FN writes from
> another buffer with a buffer-file-format then "Format Temp 0" will get
> re-used and clobbered too soon.

Could be.

>> with-temp-buffer is not an option, since the new "temp" buffer (usually)
>> needs to be returned as the new current-buffer at the end of
>> the function.

> There must be some far-enough outer scope of write-region or whatever
> where temporaries can be discarded ... but the amount of stuff done just
> to save some bytes is scary! :-)

Yes, but at that outside point, we don't know if such a temp buffer will
be needed, and worse, we don't know how many (there can be several
annotation functions that each take a buffer as input and produce the
result into a new output buffer).


        Stefan






  reply	other threads:[~2010-01-22 15:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-27  0:17 bug#5273: 23.1; format-alist encode vs write-region-post-annotation-function Kevin Ryde
     [not found] ` <jwveim53dzx.fsf-monnier+emacs@gnu.org>
2010-01-08 21:57   ` Kevin Ryde
2010-01-10  5:25     ` Stefan Monnier
2010-01-21 22:26       ` Kevin Ryde
2010-01-22 15:29         ` Stefan Monnier [this message]
2010-02-02 21:55           ` Kevin Ryde

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=jwvhbqekvox.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=5273@debbugs.gnu.org \
    --cc=user42@zip.com.au \
    /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.