unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Heime <heimeborgia@protonmail.com>
To: Heime <heimeborgia@protonmail.com>
Cc: Heime via Users list for the GNU Emacs text editor
	<help-gnu-emacs@gnu.org>
Subject: Re: Wrong argument for buffer name
Date: Mon, 07 Aug 2023 07:39:36 +0000	[thread overview]
Message-ID: <RHdlmAmInb3lHKxbYxKbuPICk2q0OJUw6ZK7eB4cQ0UbgqVeWLyidfjZOCOeGURGc8sB6dvb2DnHQeikz-rPu3_zO7E8YI9BHG3JizcUBJM=@protonmail.com> (raw)
In-Reply-To: <sIyMRrhVfTqaOh5KKar6LZPhnSfAoo8H-b4fptU_PMoYMk2j29C0UVAEHA7hk98ce7dkQ_Vrd2Rep4NJGsdQCI8ojKW9W0OpTZLbRpPw2Yg=@protonmail.com>

------- Original Message -------
On Monday, August 7th, 2023 at 6:59 PM, Heime <heimeborgia@protonmail.com> wrote:


> Why does the following function give
> 
> Lisp error: (wrong-type-argument stringp bfname)
> 
> What can I do to fix this problem for the buffer name ?
> 
> (defconst buffer-name "BFTEMP")
> 
> (defun estring (string &optional bfname)
> "Show STRING in a temporary buffer."
> 
> (or bfname (setq bfname buffer-name))
> 
> (with-output-to-temp-buffer bfname
> (princ string)
> (emacs-lisp-mode)))
 
I think the problem is with these functions

Where I use (mcode '(macro-adder (* 3 5) (* 5 7)))

macro-adder being a macro defined with defmacro

(defun mobject (object &optional bfname)
  (or bfname (setq bfname buffer-name))
  (estring (pp-to-string object) bfname))

(defun mcode (code &optional bfname)
  (or bfname (setq bfname buffer-name))
  (apply 'mobject '((macroexpand code) bfname)) )




  reply	other threads:[~2023-08-07  7:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-07  6:59 Wrong argument for buffer name Heime
2023-08-07  7:39 ` Heime [this message]
2023-08-07 18:53   ` Emanuel Berg

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='RHdlmAmInb3lHKxbYxKbuPICk2q0OJUw6ZK7eB4cQ0UbgqVeWLyidfjZOCOeGURGc8sB6dvb2DnHQeikz-rPu3_zO7E8YI9BHG3JizcUBJM=@protonmail.com' \
    --to=heimeborgia@protonmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /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).