使用预定义的lisp代码从shell启动emacs

flo*_*onk 0 lisp emacs shell

可以从shell启动emacs并告诉它执行lisp函数,例如

emacs -f some-lisp-function my_file.py
Run Code Online (Sandbox Code Playgroud)

但是,我想通过参数传递lisp函数,比如

emacs -f "(goto-line 10)" my_file.py
# --> not working
Run Code Online (Sandbox Code Playgroud)

并且在最好的世界中,传递更复杂的由多个函数调用组成的lisp代码,例如

emacs -f "(goto-line 10) (some-other-func some-arg)" my_file.py
# --> not working
Run Code Online (Sandbox Code Playgroud)

有人知道吗?

编辑:为了澄清这一点,我需要一种方法来打开它之后评估文件自己的缓冲区中的lisp代码.

(顺便说一句.我知道goto-line问题可以在不使用的情况下以不同的方式解决,-f但这只是我一般问题的一个例子)

jmb*_*mbr 6

试试emacs my_file.py --eval '(progn (goto-line 10) (some-other-func some-arg))'.另请注意,调用Emacs emacs +10 my_file.py将在第十行打开文件.