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

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

Re: Messages in el functions & the Mini-Buffer


From: Emanuel Berg
Subject: Re: Messages in el functions & the Mini-Buffer
Date: Wed, 28 Oct 2020 13:29:22 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Christopher Dimech wrote:

> When I introduce (message "Fuckup")

...

> in an Elisp function, does it always use the mini-buffer? Is there
> a command to output in a window buffer like when I use M-x
> describe function?

You can write such a general command, by studying this function:

(defun print-roll-outs (chainrings sprockets bsd tire)
  (let ((out-buffer (get-buffer-create "*gears*")))
    (with-current-buffer out-buffer
      (goto-char (point-max))
      (print-intro-data chainrings sprockets bsd tire)
      (let ((ros (all-roll-outs chainrings sprockets bsd tire)))
        (cl-loop for ro in ros do
                 (let ((c (   car   ro))
                       (s (   cadr  ro))
                       (r (cl-caddr ro)))
                   (insert (format "% 9d% 14d% 15.0f\n" c s r)) ))))
    (pop-to-buffer out-buffer) ))

In particular, `get-buffer-create', `with-current-buffer', `insert',
and `pop-to-buffer'.

Half source:

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

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




reply via email to

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