From 7651f044e26d5139d7140e0c4fd052893ef422d7 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Sat, 15 Jan 2022 09:30:01 +0100 Subject: [PATCH] Improve the with-output-to-temp-buffer doc string * lisp/subr.el (with-output-to-temp-buffer): Clarify the point of the macro (bug#53265). --- lisp/subr.el | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lisp/subr.el b/lisp/subr.el index dd260dfe418..81c02338531 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -4294,11 +4294,13 @@ in which case `save-window-excursion' cannot help." (defmacro with-output-to-temp-buffer (bufname &rest body) "Bind `standard-output' to buffer BUFNAME, eval BODY, then show that buffer. -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. +This is a convenience macro meant for displaying help buffers and +the like. It empties the BUFNAME buffer before evaluating BODY +and disables undo in that buffer. + +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 unmodified and displays it in a window, but does not select it. The normal way to do this is -- 2.39.2