unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: with-output-to-temp-buffer
Date: Fri, 02 Jun 2006 16:07:54 -0600	[thread overview]
Message-ID: <e5qct5$386$1@sea.gmane.org> (raw)
In-Reply-To: <MEEKKIABFKKDFJMPIOEBMEOCDBAA.drew.adams@oracle.com>

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

Hmmm...

-- 
Kevin

      parent reply	other threads:[~2006-06-02 22:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-01 22:53 with-output-to-temp-buffer Drew Adams
2006-06-02  0:17 ` with-output-to-temp-buffer Thien-Thi Nguyen
2006-06-02  0:29   ` with-output-to-temp-buffer Drew Adams
2006-06-02 22:07 ` Kevin Rodgers [this message]

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='e5qct5$386$1@sea.gmane.org' \
    --to=ihs_4664@yahoo.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).