diff options
author | Miles Bader <miles@gnu.org> | 2007-10-27 09:12:07 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 2007-10-27 09:12:07 +0000 |
commit | 18cd1f1a08833b0baad21c1d7b13a6845d95cf57 (patch) | |
tree | 03f33df7513d15bd5de0348aec35ef82bd061508 /src/print.c | |
parent | 74863e7a78b1c8da1094a8250660a009c3b23015 (diff) | |
parent | fdc9061358d3654e14bfc1419632e1d6c6c5c13e (diff) | |
download | emacs-18cd1f1a08833b0baad21c1d7b13a6845d95cf57.tar.gz emacs-18cd1f1a08833b0baad21c1d7b13a6845d95cf57.tar.bz2 emacs-18cd1f1a08833b0baad21c1d7b13a6845d95cf57.zip |
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 902-908)
- Update from CVS
- Merge from emacs--rel--22
* emacs--rel--22 (patch 131-137)
- Update from CVS
- Merge from gnus--rel--5.10
* gnus--rel--5.10 (patch 261-262)
- Update from CVS
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-278
Diffstat (limited to 'src/print.c')
-rw-r--r-- | src/print.c | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/src/print.c b/src/print.c index c23e020eb8d..c6304bbd24e 100644 --- a/src/print.c +++ b/src/print.c @@ -675,21 +675,30 @@ DEFUN ("with-output-to-temp-buffer", Fwith_output_to_temp_buffer, Swith_output_to_temp_buffer, 1, UNEVALLED, 0, doc: /* Bind `standard-output' to buffer BUFNAME, eval BODY, then show that buffer. -The buffer is cleared out initially, and marked as unmodified when done. -All output done by BODY is inserted in that buffer by default. -The buffer is displayed in another window, but not selected. -The value of the last form in BODY is returned. -If BODY does not finish normally, the buffer BUFNAME is not displayed. - -The hook `temp-buffer-setup-hook' is run before BODY, -with the buffer BUFNAME temporarily current. -The hook `temp-buffer-show-hook' is run after the buffer is displayed, -with the buffer temporarily current, and the window that was used -to display it temporarily selected. - -If variable `temp-buffer-show-function' is non-nil, call it at the end -to get the buffer displayed instead of just displaying the non-selected -buffer and calling the hook. It gets one argument, the buffer to display. + +This construct makes buffer BUFNAME empty before running BODY. +It does not make the buffer current for BODY. +Instead it binds `standard-output' to that buffer, so that output +generated with `prin1' and similar functions in BODY goes into +the buffer. + +At the end of BODY, this marks buffer BUFNAME unmodifed and displays +it in a window, but does not select it. The normal way to do this is +by calling `display-buffer', then running `temp-buffer-show-hook'. +However, if `temp-buffer-show-function' is non-nil, it calls that +function instead (and does not run `temp-buffer-show-hook'). The +function gets one argument, the buffer to display. + +The return value of `with-output-to-temp-buffer' is the value of the +last form in BODY. If BODY does not finish normally, the buffer +BUFNAME is not displayed. + +This runs the hook `temp-buffer-setup-hook' before BODY, +with the buffer BUFNAME temporarily current. It runs the hook +`temp-buffer-show-hook' after displaying buffer BUFNAME, with that +buffer temporarily current, and the window that was used to display it +temporarily selected. But it doesn't run `temp-buffer-show-hook' +if it uses `temp-buffer-show-function'. usage: (with-output-to-temp-buffer BUFNAME BODY...) */) (args) |