這裏的設置:Elisp:使符號函數返回源代碼?
(defun square (x)
(* x x))
;; square
(symbol-function 'square)
;; (lambda (x) (* x x))
(byte-compile 'square)
;; #[(x) "\211_\207" [x] 2]
(symbol-function 'square)
;; #[(x) "\211_\207" [x] 2]
有沒有辦法獲取源square
後(lambda (x) (* x x))
已經字節編譯?
我能想到的兩種用法是內聯當前函數調用 並執行調試步驟。
我試着find-definition-noselect
搞亂獲取源, 但我不知道是否有更好的方法,因爲它有時會引發
(error "Don't know where ... is defined")
你誤解了內聯部分。我的意思是內聯擴展,即將'(square 5)' 替換爲內部的'(* 5 5)'。 同樣適用於調試:在上面的情況中,我想跳轉到'square'的定義,而 在頂層將'arg'設置爲'5'。沒有錯。 我不喜歡'edebug',因爲它使源只讀。我更願意在調試時編寫代碼。 –