(Tôi có dạng ví dụ này một chút, trình gỡ lỗi không đường gấp dài Như thường lệ, bạn có thể bỏ các trình gỡ lỗi bằng cách gõ q 'backtrace * *' đệm) Trong thực tế, cho một lỗi đơn giản như thế này, dòng 'Lisp lỗi sẽ cho bạn biết những gì bạn cần biết để đúng định nghĩa. | 232 Chapter 17 Debugging eval triangle-bugged 4 eval-last-sexp-l nil eval-last-sexp nil call-interactively eval-last-sexp --------- Buffer Backtrace --------- I have reformatted this example slightly the debugger does not fold long lines. As usual you can quit the debugger by typing q in the Backtrace buffer. In practice for a bug as simple as this the Lisp error line will tell you what you need to know to correct the definition. The function 1 is void . In GNU Emacs 20 and before you will see Symbol s function definition is void 1 which has the same meaning as the Backtrace buffer line in version 21. However suppose you are not quite certain what is going on You can read the complete backtrace. In this case you need to run GNU Emacs 21 which automatically starts the debugger that puts you in the Backtrace buffer or else you need to start the debugger manually as described below. Read the Backtrace buffer from the bottom up it tells you what Emacs did that led to the error. Emacs made an interactive call to C-x C-e eval-last-sexp which led to the evaluation of the triangle-bugged expression. Each line above tells you what the Lisp interpreter evaluated next. The third line from the top of the buffer is setq number 1 number Emacs tried to evaluate this expression in order to do so it tried to evaluate the inner expression shown on the second line from the top 1 number This is where the error occurred as the top line says Debugger entered Lisp error void-function 1 You can correct the mistake re-evaluate the function definition and then run your test again. debug-on-entry GNU Emacs 21 starts the debugger automatically when your function has an error. GNU Emacs version 20 and before did not it simply presented you with an error message. You had to start the debugger manually. You can start the debugger manually for all versions of Emacs the advantage is that the debugger runs even if you do not have a bug in your code. Sometimes your code will be free of bugs .