elisp debug

M-x  是運行command的意思。

若使用常規Emacs debugger(即不使用edebuger),先把要debug的函數加入到debug-on-entryshell

  M-x   debug-on-entry   the-function-name   RET
而後再使用eval-last-sexp命令運行單句elisp(須要移動焦點point到函數調用處),通常狀況下它被綁定到鍵盤C-x C-e,
C-x C-e           runs   the   command    eval-last-sexp
而後就會popup一個debug窗口,按d鍵就能夠單步調試,c鍵是skip and continue。


若要查看幫助,能夠:
一、C-h a,  查看包含字串的command, C-h a runs the command  apropos-command
二、C-h f,  查看elise的函數,
describe-function,它能夠查看function和command,其實command也是function。
三、C-h v, 查看變量,
describe-variable
四、 C-h m,查看mode的幫助,  describe-mode


在emacs裏執行elisp語句 :
M-x 後面跟任何function原則上均可以交互執行,好比:M-x getenv RET 以後,輸入USER就能夠得到環境用戶名)
M-x eval-buffer     若是你有一個代碼塊要執行,把它拷貝到一個新建的buffer,而後執行行首的命令。
M-x eval-region     If you want something less hamfisted(拳頭) you can tell Emacs to only evaluate the  region  by                                                      marking what you want to run and executing(代碼很少能夠選擇執行region,沒拳頭那麼大)
C-x C-e                    which is bound to eval-last-sexp: 這句和emacs工做的模式有關,但大多數模式都支持。但這句有一些特別                                             地方:它不會更新由 defvar  或  defcustom什麼的變量的值,另外你必須把point(光標)移動                                                       到要執行的語句的結尾。
C-M-x                      eval-defun,它多是執行某條命令的最好方式了。它基本沒有上面的命令的任何問題,你可                                               以在一個form的任何地方執行這條命令,它會自動選擇執行最外層的form。
M-:                           被綁定到 eval-expression,是讓你本身輸入要執行的語句,如  (getenv "USER")

Running Shell Commands from Emacs

M-! cmd RET

Run the shell command line cmd and display the output (shell-command).express

M-| cmd RET

Run the shell command line cmd with region contents as input; optionally replace the region with the output (shell-command-on-region).less

M-x shell

Run a subshell with input and output through an Emacs buffer. You can then give commands interactively.函數

M-x term

Run a subshell with input and output through an Emacs buffer. You can then give commands interactively. Full terminal emulation is available.lua

M-x eshell

Start the Emacs shell.spa

相關文章
相關標籤/搜索