gpt4 book ai didi

emacs - emacs 是唯一的 elisp 解释器吗?

转载 作者:行者123 更新时间:2023-12-04 14:43:36 24 4
gpt4 key购买 nike

我最近开始使用 emacs 并用 elisp 扩展它。这让我想知道:emacs 是唯一可以评估 elisp 表达式的程序还是存在专用的 elisp 解释器?

最佳答案

如果你使用 Guile,你可以在 emacs 之外使用 Elisp
这是 de 文档:
https://www.gnu.org/software/guile/manual/html_node/Using-Other-Languages.html

☸ sandas-nonpro (qa) in ~ via ⬢ v12.4.0 took 11s
❯ guile ~
GNU Guile 3.0.7
Copyright (C) 1995-2021 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guile-user)> ,language elisp
Happy hacking with Emacs Lisp! To switch back, type `,L scheme'.
elisp@(guile-user)> (printf "Hello World!)
您也可以 write scripts in emacs lisp像这样:
☸ sandas-nonpro (qa) in ~ via ⬢ v8.9.4
❯ cat > test.el ~
:;exec emacs -batch -l "$0" -f main "$@"

(defun main ()
(print (version))
(print (format "I did it. you passed in %s" command-line-args-left)))

;; Local Variables:
;; mode: emacs-lisp
;; End:

☸ sandas-nonpro (qa) in ~ via ⬢ v12.4.0
❯ chmod +x test.el ~

☸ sandas-nonpro (qa) in ~ via ⬢ v12.4.0
❯ ./test.el cat dog ~

"GNU Emacs 28.0.50 (build 2, x86_64-apple-darwin20.6.0, NS appkit-2022.60 Version 11.5.2 (Build 20G95))
of 2021-09-15"

"I did it. you passed in (cat dog)"
但我鼓励在 emacs 中使用它,使用 ielm buffer alot 或 eshell,这是一个可以将 emacs lisp s 表达式与 shell 命令结合使用的 shell。显然是 gccemacs,如果你在 emacs 中做大量的工作。

关于emacs - emacs 是唯一的 elisp 解释器吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69272381/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com