emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] scratch/backtrace-mode 2ed27cf 07/11: Add links in backtra


From: Gemini Lasswell
Subject: [Emacs-diffs] scratch/backtrace-mode 2ed27cf 07/11: Add links in backtraces to functions written in C (bug#25393)
Date: Sun, 15 Jul 2018 15:06:18 -0400 (EDT)

branch: scratch/backtrace-mode
commit 2ed27cf5fe07b1897daded75a30bd6d82563b939
Author: Gemini Lasswell <address@hidden>
Commit: Gemini Lasswell <address@hidden>

    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 | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lisp/emacs-lisp/backtrace.el b/lisp/emacs-lisp/backtrace.el
index b113882..f47c7c5 100644
--- a/lisp/emacs-lisp/backtrace.el
+++ b/lisp/emacs-lisp/backtrace.el
@@ -691,7 +691,12 @@ Format it according to VIEW."
          (evald (backtrace-frame-evald frame))
          (fun   (backtrace-frame-fun frame))
          (args  (backtrace-frame-args frame))
-         (fun-file (and (plist-get view :do-xrefs) (symbol-file fun 'defun)))
+         (def   (and (symbolp fun) (fboundp fun) (symbol-function fun)))
+         (fun-file (and (plist-get view :do-xrefs)
+                        (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))
@@ -717,7 +722,7 @@ Format it according to VIEW."
     (when fun-file
       (make-text-button fun-pt (+ fun-pt (length (symbol-name fun)))
                         :type 'help-function-def
-                        'help-args (list fun fun-file)))
+                        'help-args (list fun fun-file nil)))
     ;; After any frame that uses eval-buffer, insert a comment that
     ;; states the buffer position it's reading at.
     (when (backtrace-frame-pos frame)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]