help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using key q to quit temporary buffer window


From: Emanuel Berg
Subject: Re: Using key q to quit temporary buffer window
Date: Wed, 24 Aug 2022 07:35:06 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

uzibalqa wrote:

> Also included (switch-to-buffer bfname) to get
>
> (defun help-show (bfname msg)
>   "Display the output of MSG"

Still not good ...

>   (when (stringp msg)
>     (with-output-to-temp-buffer bfname
>       (switch-to-buffer bfname)
>       (print msg))))
>
> But (switch-to-buffer bfname) replaces the buffer.
> Without it, a new buffer is generated underneath the current
> buffer. All I want is to make the temporary buffer to become
> the current buffer.

`get-buffer-create', then `with-current-buffer', then
`pop-to-buffer'.

See `print-roll-outs' here

  https://dataswamp.org/~incal/emacs-init/bike.el

for an example.

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

[Prev in Thread] Current Thread [Next in Thread]