I ran a command and received a warning in the minibuffer.

The exact warning was comint-completion-at-point failed to return valid completion data, after I autocompleted a command in shell-mode.

How can I determine the elisp origin of the warning?

  • Have a look at the manual on Debugging Lisp Programs.
    – freakhill
    Dec 11, 2014 at 16:31
  • 1
    C-h f comint-completion-at-point, then click the file name to see the source code. Look for that error message. (You can also grep for the error msg in the Lisp sources, to find it.)
    – Drew
    Dec 11, 2014 at 16:33

1 Answer 1


As pointed out in the other answer you'll find the fine manual useful for all the debug tools it has. For you specific problem I'd consider:

(setq debug-on-message "comint-completion-at-point failed to return valid completion data")

As the help text states:

If non-nil, debug if a message matching this regexp is displayed.

From this you should get a backtrace when the failure hits. You can then instrument the functions in question with C-u C-M-x and step through the failure next time it occurs for more information.

  • 3
    This is an excellent answer. Thank you. I think you have an extra quote in your first line, where you combine setq and 'debug-on-message. Changing it to setq debug-on-message or set 'debug-on-message fixed it for me. Dec 11, 2014 at 17:11
  • @MatthewPiziak: thanks - overzealous quoting fixed.
    – stsquad
    Dec 11, 2014 at 22:47
  • This is so much better than zgrepping the Emacs compressed sources! Only downside of this is that the problematic condition must occur before one can debug it.
    – user66
    Dec 25, 2019 at 12:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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