Skip to main content
deleted 1 character in body
Source Link

Say that emacs throws some error that I don't understand. Or maybe the error says "Symbol's value as variable is void: modes", but there are many occurrences of the symbol modes in my code, so I need some context. Can Emacs be configured to mention the line number of the lisp code so I can know what code is causing the error?

I have tried doing (setq stack-trace-on-error '(buffer-read-only)) and ran the perpetrating code in an effort to get a stack trace. No stack trace either.

I have also tryingtried calling edebug-defun on my function and stepping through it. It is not until I step out of the function that the error is thrown.

(I am really not as interested in the cause of the particular error I am facing currently as I am in developing general debugging skills for elisp. Please advise on how I can gleam a line number, or a sexp, or a stack trace from an error.)

Say that emacs throws some error that I don't understand. Or maybe the error says "Symbol's value as variable is void: modes", but there are many occurrences of the symbol modes in my code, so I need some context. Can Emacs be configured to mention the line number of the lisp code so I can know what code is causing the error?

I have tried doing (setq stack-trace-on-error '(buffer-read-only)) and ran the perpetrating code in an effort to get a stack trace. No stack trace either.

I have also trying calling edebug-defun on my function and stepping through it. It is not until I step out of the function that the error is thrown.

(I am really not as interested in the cause of the particular error I am facing currently as I am in developing general debugging skills for elisp. Please advise on how I can gleam a line number, or a sexp, or a stack trace from an error.)

Say that emacs throws some error that I don't understand. Or maybe the error says "Symbol's value as variable is void: modes", but there are many occurrences of the symbol modes in my code, so I need some context. Can Emacs be configured to mention the line number of the lisp code so I can know what code is causing the error?

I have tried doing (setq stack-trace-on-error '(buffer-read-only)) and ran the perpetrating code in an effort to get a stack trace. No stack trace either.

I have also tried calling edebug-defun on my function and stepping through it. It is not until I step out of the function that the error is thrown.

(I am really not as interested in the cause of the particular error I am facing currently as I am in developing general debugging skills for elisp. Please advise on how I can gleam a line number, or a sexp, or a stack trace from an error.)

Source Link

Show line number on error

Say that emacs throws some error that I don't understand. Or maybe the error says "Symbol's value as variable is void: modes", but there are many occurrences of the symbol modes in my code, so I need some context. Can Emacs be configured to mention the line number of the lisp code so I can know what code is causing the error?

I have tried doing (setq stack-trace-on-error '(buffer-read-only)) and ran the perpetrating code in an effort to get a stack trace. No stack trace either.

I have also trying calling edebug-defun on my function and stepping through it. It is not until I step out of the function that the error is thrown.

(I am really not as interested in the cause of the particular error I am facing currently as I am in developing general debugging skills for elisp. Please advise on how I can gleam a line number, or a sexp, or a stack trace from an error.)