all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / 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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.