From 9aa9d79e4420f367242312aedd61594fd173dec6 Mon Sep 17 00:00:00 2001 From: Gemini Lasswell Date: Mon, 25 Jun 2018 13:23:03 -0700 Subject: [PATCH] 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. --- lisp/emacs-lisp/backtrace.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)) -- 2.39.2