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: uzibalqa
Subject: Re: Using key q to quit temporary buffer window
Date: Wed, 24 Aug 2022 04:07:08 +0000

------- Original Message -------
On Wednesday, August 24th, 2022 at 3:54 AM, uzibalqa <uzibalqa@proton.me> wrote:


> ------- Original Message -------
> On Wednesday, August 24th, 2022 at 1:42 AM, Emanuel Berg incal@dataswamp.org 
> wrote:
> 
> 
> 
> > uzibalqa wrote:
> > 
> > > (defun help-show (bufrnm msg)
> > > "Display the output of MSG in buffer named BUFRNM."
> > 
> > Order ...
> > 
> > > (if (stringp msg)
> > > (with-output-to-temp-buffer bufrnm
> > > (print msg)))
> > 
> > `when'
> 
> 
> You are correct, I did not include an alternative.

Also included (switch-to-buffer bfname) to get

(defun help-show (bfname msg)
  "Display the output of MSG"
  (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.









reply via email to

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