From: Gemini Lasswell Date: Mon, 25 Jun 2018 20:23:03 +0000 (-0700) Subject: Add links in backtraces to functions written in C (bug#25393) X-Git-Tag: emacs-27.0.90~4655^2~11 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9aa9d79e4420f367242312aedd61594fd173dec6;p=emacs.git Add links in backtraces to functions written in C (bug#25393) * lisp/emacs-lisp/backtrace.el (backtrace--print-func-and-args): Look up file names for built-in functions with evaluated arguments. --- diff --git a/lisp/emacs-lisp/backtrace.el b/lisp/emacs-lisp/backtrace.el index d6c04bb4c67..bec57f29245 100644 --- a/lisp/emacs-lisp/backtrace.el +++ b/lisp/emacs-lisp/backtrace.el @@ -651,7 +651,11 @@ Format it according to VIEW." (evald (backtrace-frame-evald frame)) (fun (backtrace-frame-fun frame)) (args (backtrace-frame-args frame)) - (fun-file (symbol-file fun 'defun)) + (def (and (symbolp fun) (fboundp fun) (symbol-function fun))) + (fun-file (or (symbol-file fun 'defun) + (and (subrp def) + (not (eq 'unevalled (cdr (subr-arity def)))) + (find-lisp-object-file-name fun def)))) (fun-pt (point))) (cond ((and evald (not debugger-stack-frame-as-list))