I am attempting to edit a file. Emacs is preventing me from making the edit, and throwing: Args out of range: #<buffer user.action.js>, 4965, 17721. It is completely not obvious to me where this exception is coming from. How can I debug errors such as this one?

  • @Drew: the similarity between the two seems rather tenuous. – Stefan Sep 26 '18 at 15:21
  • @stefan: Indeed; sorry. The question is essentially how to see what happened & why, when an error is raised - catch the error and show a call stack. A general answer is, as you suggested, to show a backtrace via debug-on-error. Seems like the question has been asked, but I don't find a good duplicate. – Drew Sep 26 '18 at 16:00

Enable debugging via M-x toggle-debug-on-error or in the menu Options => Enter Debugger on Error.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.