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

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

Re: Wrong argument for buffer name


From: Heime
Subject: Re: Wrong argument for buffer name
Date: Mon, 07 Aug 2023 07:39:36 +0000

------- 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 via email to

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