unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Emanuel Berg via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Messages in el functions & the Mini-Buffer
Date: Wed, 28 Oct 2020 13:29:22 +0100	[thread overview]
Message-ID: <87pn52zg7x.fsf@zoho.eu> (raw)
In-Reply-To: trinity-a9822255-73bc-4f4d-9211-774822e041f6-1603880791341@3c-app-mailcom-bs01

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




      parent reply	other threads:[~2020-10-28 12:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-28 10:26 Messages in el functions & the Mini-Buffer Christopher Dimech
2020-10-28 10:44 ` tomas
2020-10-28 10:53   ` Christopher Dimech
2020-10-28 11:06     ` Joost Kremers
2020-10-28 12:25       ` Michael Heerdegen
2020-10-28 12:29 ` Emanuel Berg via Users list for the GNU Emacs text editor [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pn52zg7x.fsf@zoho.eu \
    --to=help-gnu-emacs@gnu.org \
    --cc=moasenwood@zoho.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).