unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Setting mode to a temporary buffer
@ 2022-08-25  6:30 uzibalqa
  2022-08-25  9:28 ` Jean Louis
  2022-08-25 13:35 ` Stefan Monnier via Users list for the GNU Emacs text editor
  0 siblings, 2 replies; 4+ messages in thread
From: uzibalqa @ 2022-08-25  6:30 UTC (permalink / raw)
  To: uzibalqa via Users list for the GNU Emacs text editor


I am using the following function to write a message to a temporary buffer.  To set the mode
of the buffer I call (with-current-buffer bfname (org-mode)).  Another alternative is to
add (org-mode) after (pop-to-buffer bfname).

switch-to-buffer uses pop-to-buffer under the hood.  What is the way to do this?  Use 
(pop-to-buffer bfname) followed by (org-mode)?

(defun galaxy-help-show (bfname msg)

  "Makes temporary buffer BFNAME and prints message MSG."

  (when (stringp msg)

    (with-output-to-temp-buffer bfname

      (princ msg))

    (with-current-buffer bfname (org-mode))

    (pop-to-buffer bfname)))





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

end of thread, other threads:[~2022-08-25 13:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-25  6:30 Setting mode to a temporary buffer uzibalqa
2022-08-25  9:28 ` Jean Louis
2022-08-25 10:43   ` uzibalqa
2022-08-25 13:35 ` Stefan Monnier via Users list for the GNU Emacs text editor

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).