unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Automatically switching to a buffer from interactive function
@ 2024-06-28 12:08 Heime
  2024-06-28 12:22 ` Eli Zaretskii
  0 siblings, 1 reply; 2+ messages in thread
From: Heime @ 2024-06-28 12:08 UTC (permalink / raw)
  To: Heime via Users list for the GNU Emacs text editor

I am inserting text in buffer "Mondisplay" and want to  switch to it automatically
rather than having the user select it from the buffers menu.

(defun mondisplay ()
  (interactive)

  (with-current-buffer (get-buffer-create "Mondisplay")

    (insert "> Mondisplay \n\n")

    (insert-button "[R1]" 'action 'mon-lw)
    (insert " Mon LW \n")

    (insert-button "[R2]" 'action 'mon-kk)
    (insert " Mon KK  \n")))





^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Automatically switching to a buffer from interactive function
  2024-06-28 12:08 Automatically switching to a buffer from interactive function Heime
@ 2024-06-28 12:22 ` Eli Zaretskii
  0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2024-06-28 12:22 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Fri, 28 Jun 2024 12:08:41 +0000
> From: Heime <heimeborgia@protonmail.com>
> 
> I am inserting text in buffer "Mondisplay" and want to  switch to it automatically
> rather than having the user select it from the buffers menu.

Use pop-to-buffer after you insert all the text into the buffer.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-06-28 12:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-28 12:08 Automatically switching to a buffer from interactive function Heime
2024-06-28 12:22 ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).