[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: with-output-to-temp-buffer

From: Kevin Rodgers
Subject: Re: with-output-to-temp-buffer
Date: Fri, 02 Jun 2006 16:07:54 -0600
User-agent: Thunderbird (Windows/20060308)

Drew Adams wrote:
I had this code:

  (set-buffer (get-buffer-create "foo"))
  (let (...) ...)
  (select-frame (make-frame ...))

I changed it to this code:

  (with-output-to-temp-buffer "foo" ...)
  (let ((temp-buffer-setup-hook nil)
        (temp-buffer-show-functions nil)
  (select-window (get-buffer-window "foo" 'visible))
  (modify-frame-parameters (selected-frame) ...)

The rest of the code (i.e. "...") is identical. The latter code runs about
twice as fast (clock time)! I don't use any print functions inside the
with-* - I use only `insert', so I wouldn't think that with-* would be of
any special benefit here.

I don't understand this. A glance at the C code makes me think that
with-output-to-temp-buffer would only do more, not less, stuff.

How do with-current-buffer and with-temp-buffer perform compared to the
original version and the with-output-to-temp-buffer?

(Thinking that the difference might be make-frame vs
modify-frame-parameters, I tried using modify-frame-* for the first code
too, but that made no difference. I guess it must be with-* that speeds
things up.)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]