I'm working on debugging this backtrace (from Emacs bug #12145, shortened):

Debugger entered--Lisp error: (wrong-type-argument "markerp nil")
  signal(wrong-type-argument ("markerp nil"))
  tramp-error((tramp-file-name #("scp" 0 3 (tramp-default t)) nil nil "blacky" nil "REDACTED/.dir-locals.el" > nil) wrong-type-argument "markerp nil")
  tramp-signal-hook-function(wrong-type-argument (markerp nil))
  comint-output-filter(#<process *Find*> "    74785      4 -rw-r--r--   1 thk      thk      ...")
  accept-process-output(#<process *tramp/scp blacky*> nil nil t)
  tramp-accept-process-output(#<process *tramp/scp blacky*>)

This backtrace tells me, that somewhere in comint-output-filter a function gets called with a wrong argument (nil instead of markerp). But it does not tell me, which function.

Is there something to answer this question, e.g. could Emacs print line numbers next to the backtrace to show what the last executed line of a funtion was before a new stackframe?

  • 1
    If you eval the uncompiled lisp source for comint-output-filter you'll get a more detailed backtrace for that code.
    – phils
    Mar 2, 2023 at 20:53

1 Answer 1


It tells you that the function where the error was raised is tramp-error.

Line numbers aren't available, and generally have no meaning. In particular, the Lisp code is usually byte-compiled.

If you want to track just what happens inside tramp-error, sexp-evaluation by sexp-evaluation, then do M-x debug-on-entry tramp-error. If you instead want to follow the evaluation that leads to that function call then do M-x debug-on-entry tramp-signal-hook-function or even M-x debug-on-entry comint-output-filter.

What you decide to track is up to you; depends on what you already know and what you want more to know.

In the debugger, use d to step through each evaluation. Use c to skip through a sexp and all of the sexps it, in turn evaluates.

See the Elisp manual, node Debugger.

Alternatively, you can use Edebug. Use C-M-x on the source-code definition of, say, comint-output-filter (in comint.el). That will step through the code of comint-output-filter, showing you where it is in the source code at each step.

See the Elisp manual, node Edebug.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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