emacs 是唯一的 elisp 解释器吗?
Is emacs the only elisp interpreter?
我最近开始使用 emacs 并用 elisp 扩展它。这让我想知道:emacs 是唯一可以评估 elisp 表达式的程序还是存在专用的 elisp 解释器?
如果你使用 Guile,你可以在 emacs 之外使用 Elisp
这是文档:
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 "[=11=]" -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,这是一个 shell,您可以将 emacs lisp s-expressions 与 shell 命令结合起来。显然还有 gccemacs,如果您要在 emacs 中进行大量工作的话。
CLOCC/CLLIB/elisp.lisp
允许 运行 来自 Common Lisp 的 Emacs-Lisp 代码。
我最近开始使用 emacs 并用 elisp 扩展它。这让我想知道:emacs 是唯一可以评估 elisp 表达式的程序还是存在专用的 elisp 解释器?
如果你使用 Guile,你可以在 emacs 之外使用 Elisp
这是文档:
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 "[=11=]" -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,这是一个 shell,您可以将 emacs lisp s-expressions 与 shell 命令结合起来。显然还有 gccemacs,如果您要在 emacs 中进行大量工作的话。
CLOCC/CLLIB/elisp.lisp
允许 运行 来自 Common Lisp 的 Emacs-Lisp 代码。