diff options
| author | Richard M. Stallman | 2007-10-24 08:22:35 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2007-10-24 08:22:35 +0000 |
| commit | 80281b01bf8bfa2b1e30cb18964f3f4c61e9ce69 (patch) | |
| tree | dbb12c2a6bc3cb2cb798ead01919dc0e267cc9b5 /src | |
| parent | b6c764efaff79cd9aee41c5b7cc5e49dc980ce2c (diff) | |
| download | emacs-80281b01bf8bfa2b1e30cb18964f3f4c61e9ce69.tar.gz emacs-80281b01bf8bfa2b1e30cb18964f3f4c61e9ce69.zip | |
(Fwith_output_to_temp_buffer): Doc fix.
Diffstat (limited to 'src')
| -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 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. |
| 677 | The buffer is cleared out initially, and marked as unmodified when done. | 677 | |
| 678 | All output done by BODY is inserted in that buffer by default. | 678 | This construct makes buffer BUFNAME empty before running BODY. |
| 679 | The buffer is displayed in another window, but not selected. | 679 | It does not make the buffer current for BODY. |
| 680 | The value of the last form in BODY is returned. | 680 | Instead it binds `standard-output' to that buffer, so that output |
| 681 | If BODY does not finish normally, the buffer BUFNAME is not displayed. | 681 | generated with `prin1' and similar functions in BODY goes into |
| 682 | 682 | the buffer. | |
| 683 | The hook `temp-buffer-setup-hook' is run before BODY, | 683 | |
| 684 | with the buffer BUFNAME temporarily current. | 684 | At the end of BODY, this marks buffer BUFNAME unmodifed and displays |
| 685 | The hook `temp-buffer-show-hook' is run after the buffer is displayed, | 685 | it in a window, but does not select it. The normal way to do this is |
| 686 | with the buffer temporarily current, and the window that was used | 686 | by calling `display-buffer', then running `temp-buffer-show-hook'. |
| 687 | to display it temporarily selected. | 687 | However, if `temp-buffer-show-function' is non-nil, it calls that |
| 688 | 688 | function instead (and does not run `temp-buffer-show-hook'). The | |
| 689 | If variable `temp-buffer-show-function' is non-nil, call it at the end | 689 | function gets one argument, the buffer to display. |
| 690 | to get the buffer displayed instead of just displaying the non-selected | 690 | |
| 691 | buffer and calling the hook. It gets one argument, the buffer to display. | 691 | The return value of `with-output-to-temp-buffer' is the value of the |
| 692 | last form in BODY. If BODY does not finish normally, the buffer | ||
| 693 | BUFNAME is not displayed. | ||
| 694 | |||
| 695 | This runs the hook `temp-buffer-setup-hook' before BODY, | ||
| 696 | with the buffer BUFNAME temporarily current. It runs the hook | ||
| 697 | `temp-buffer-show-hook' after displaying buffer BUFNAME, with that | ||
| 698 | buffer temporarily current, and the window that was used to display it | ||
| 699 | temporarily selected. But it doesn't run `temp-buffer-show-hook' | ||
| 700 | if it uses `temp-buffer-show-function'. | ||
| 692 | 701 | ||
| 693 | usage: (with-output-to-temp-buffer BUFNAME BODY...) */) | 702 | usage: (with-output-to-temp-buffer BUFNAME BODY...) */) |
| 694 | (args) | 703 | (args) |