GNU bug report logs - #16816
24.3.50; erroneous docstring in with-temp-buffer-window

Previous Next

Package: emacs;

Reported by: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>

Date: Wed, 19 Feb 2014 21:31:02 UTC

Severity: minor

Merged with 16882

Found in version 24.3.50

Done: martin rudalics <rudalics <at> gmx.at>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 16816 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Nicolas Richard <theonewiththeevillook <at> yahoo.fr>
Cc: 16816 <at> debbugs.gnu.org
Subject: Re: bug#16816: 24.3.50; erroneous docstring in with-temp-buffer-window
Date: Fri, 21 Feb 2014 14:08:43 +0100
> The docstring of `with-temp-buffer-window' contains :
>
>    It does not make the buffer current for BODY.
>
> (2nd sentence of 2nd paragraph).
>
> But I think that is wrong, because :
> (with-temp-buffer-window
>         (get-buffer-create "foo")
>         nil
>         nil
>         (message "curbuf: %s"
>                  (current-buffer)))
>
> outputs "curbuf: foo"
>
> If this is a docbug, here's a suggestion :
>
> --- a/lisp/window.el
> +++ b/lisp/window.el
> @@ -149,10 +149,9 @@ BUFFER-OR-NAME must specify either a live buffer, or the name of a
>  buffer (if it does not exist, this macro creates it).
>
>  This construct makes buffer BUFFER-OR-NAME 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.
> +It makes the buffer current for BODY and 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 the specified buffer unmodified and
>  read-only, and displays it in a window (but does not select it, or make

`with-temp-buffer-window' should behave as `with-output-to-temp-buffer'
in this regard (at least I hope so).  So in revision 116509 I moved the
evaluation of BODY out of the scope of `with-current-buffer'.  If this
causes problems, I will revert and use your patch.

Thanks, martin




This bug report was last modified 11 years and 67 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.