aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman2007-10-24 08:22:35 +0000
committerRichard M. Stallman2007-10-24 08:22:35 +0000
commit80281b01bf8bfa2b1e30cb18964f3f4c61e9ce69 (patch)
treedbb12c2a6bc3cb2cb798ead01919dc0e267cc9b5 /src
parentb6c764efaff79cd9aee41c5b7cc5e49dc980ce2c (diff)
downloademacs-80281b01bf8bfa2b1e30cb18964f3f4c61e9ce69.tar.gz
emacs-80281b01bf8bfa2b1e30cb18964f3f4c61e9ce69.zip
(Fwith_output_to_temp_buffer): Doc fix.
Diffstat (limited to 'src')
-rw-r--r--src/print.c39
1 files changed, 24 insertions, 15 deletions
diff --git a/src/print.c b/src/print.c
index cae80d1acfe..88e7b6d1547 100644
--- a/src/print.c
+++ b/src/print.c
@@ -674,21 +674,30 @@ DEFUN ("with-output-to-temp-buffer",
674 Fwith_output_to_temp_buffer, Swith_output_to_temp_buffer, 674 Fwith_output_to_temp_buffer, Swith_output_to_temp_buffer,
675 1, UNEVALLED, 0, 675 1, UNEVALLED, 0,
676 doc: /* Bind `standard-output' to buffer BUFNAME, eval BODY, then show that buffer. 676 doc: /* Bind `standard-output' to buffer BUFNAME, eval BODY, then show that buffer.
677The buffer is cleared out initially, and marked as unmodified when done. 677
678All output done by BODY is inserted in that buffer by default. 678This construct makes buffer BUFNAME empty before running BODY.
679The buffer is displayed in another window, but not selected. 679It does not make the buffer current for BODY.
680The value of the last form in BODY is returned. 680Instead it binds `standard-output' to that buffer, so that output
681If BODY does not finish normally, the buffer BUFNAME is not displayed. 681generated with `prin1' and similar functions in BODY goes into
682 682the buffer.
683The hook `temp-buffer-setup-hook' is run before BODY, 683
684with the buffer BUFNAME temporarily current. 684At the end of BODY, this marks buffer BUFNAME unmodifed and displays
685The hook `temp-buffer-show-hook' is run after the buffer is displayed, 685it in a window, but does not select it. The normal way to do this is
686with the buffer temporarily current, and the window that was used 686by calling `display-buffer', then running `temp-buffer-show-hook'.
687to display it temporarily selected. 687However, if `temp-buffer-show-function' is non-nil, it calls that
688 688function instead (and does not run `temp-buffer-show-hook'). The
689If variable `temp-buffer-show-function' is non-nil, call it at the end 689function gets one argument, the buffer to display.
690to get the buffer displayed instead of just displaying the non-selected 690
691buffer and calling the hook. It gets one argument, the buffer to display. 691The return value of `with-output-to-temp-buffer' is the value of the
692last form in BODY. If BODY does not finish normally, the buffer
693BUFNAME is not displayed.
694
695This runs the hook `temp-buffer-setup-hook' before BODY,
696with the buffer BUFNAME temporarily current. It runs the hook
697`temp-buffer-show-hook' after displaying buffer BUFNAME, with that
698buffer temporarily current, and the window that was used to display it
699temporarily selected. But it doesn't run `temp-buffer-show-hook'
700if it uses `temp-buffer-show-function'.
692 701
693usage: (with-output-to-temp-buffer BUFNAME BODY...) */) 702usage: (with-output-to-temp-buffer BUFNAME BODY...) */)
694 (args) 703 (args)