(defun foo ()
(send-to-debug-log "Error. Function terminated." (get-current-function-name)))
我目前正在这样做:
(defun foo ()
(send-to-debug-log "Error. Function terminated." 'foo)))
硬编码函数名称似乎不是一个好习惯。
关于实现
get-current-function-name
或get-function-name-that-call-me
的任何建议。
最佳答案
(defun foo ()
(send-to-debug-log "Error. Function terminated." (nth 1 (backtrace-frame 2))))
关于function - 有没有办法获取当前函数的函数名?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35907038/