Mercurial > emacs
comparison src/print.c @ 79204:588d507a3ebf
(Fwith_output_to_temp_buffer): Doc fix.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Wed, 24 Oct 2007 08:22:35 +0000 |
parents | 30f73a22d4ce |
children | fc2bcd2a8aad b210bba3f477 |
comparison
equal
deleted
inserted
replaced
79203:883dd6a77245 | 79204:588d507a3ebf |
---|---|
672 | 672 |
673 DEFUN ("with-output-to-temp-buffer", | 673 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) |
695 Lisp_Object args; | 704 Lisp_Object args; |
696 { | 705 { |