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

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

Re: Converting string to symbol


From: Emanuel Berg
Subject: Re: Converting string to symbol
Date: Tue, 05 Jan 2021 05:44:10 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

excalamus wrote:

> When I run M-x my-test <RET>, I get read--expression: End of
> file during parsing. The function halts immediately and
> doesn't evaluate the body. I'm not sure how I could
> catch that.
>
> (defun my-test (expr)
>  "test interactive X behavior."
>  (interactive "XLisp expression: ")
>  (message "before compare") (if expr
>  (message "%s" expr)
>  (message "is nil"))
>  (message "after compare"))
>
> I assume read--expression is being used within (interactive
> X...). It's not documented and I didn't have much luck
> trying to use it (not detailing those efforts here since
> it's really not meant for "public" use).

I don't understand a lot but

(defun print-lisp (expr)
  (interactive "xlisp: ")
  (message "lisp: %s" expr) )

M-x print-lisp RET (+ 1 1) RET

"lisp: (+ 1 1)"

-- 
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]