]> git.eshelyaron.com Git - emacs.git/commitdiff
(backtrace-goto-source-functions): Make it a normal abnormal hook
authorStefan Monnier <monnier@iro.umontreal.ca>
Sat, 13 Feb 2021 15:41:45 +0000 (10:41 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sat, 13 Feb 2021 15:41:45 +0000 (10:41 -0500)
* lisp/emacs-lisp/backtrace.el (backtrace-goto-source-functions):
Don't mark it as buffer-local any more.
(backtrace-goto-source): Use `run-hook-with-args-until-success`.

* lisp/emacs-lisp/edebug.el (edebug-pop-to-backtrace): Clarify that the
hook is only intended to be modified buffer-locally.

lisp/emacs-lisp/backtrace.el
lisp/emacs-lisp/edebug.el

index 3e1c3292650b36881054cf60961c6887d678d68e..ea70baa95321b316bd5f3511d92667e500afaf83 100644 (file)
@@ -190,7 +190,7 @@ This is commonly used to recompute `backtrace-frames'.")
 (defvar-local backtrace-print-function #'cl-prin1
   "Function used to print values in the current Backtrace buffer.")
 
-(defvar-local backtrace-goto-source-functions nil
+(defvar backtrace-goto-source-functions nil
   "Abnormal hook used to jump to the source code for the current frame.
 Each hook function is called with no argument, and should return
 non-nil if it is able to switch to the buffer containing the
@@ -638,10 +638,8 @@ content of the sexp."
          (source-available (plist-get (backtrace-frame-flags frame)
                                       :source-available)))
     (unless (and source-available
-                 (catch 'done
-                   (dolist (func backtrace-goto-source-functions)
-                     (when (funcall func)
-                       (throw 'done t)))))
+                 (run-hook-with-args-until-success
+                  'backtrace-goto-source-functions))
       (user-error "Source code location not known"))))
 
 (defun backtrace-help-follow-symbol (&optional pos)
index 394f47090ca4450d42549ee03f9fd9e651d145a9..cbf2d171a96970113ea80497fc2f45a544e6316d 100644 (file)
@@ -4247,7 +4247,8 @@ This should be a list of `edebug---frame' objects.")
   (pop-to-buffer edebug-backtrace-buffer)
   (unless (derived-mode-p 'backtrace-mode)
     (backtrace-mode)
-    (add-hook 'backtrace-goto-source-functions #'edebug--backtrace-goto-source))
+    (add-hook 'backtrace-goto-source-functions
+              #'edebug--backtrace-goto-source nil t))
   (setq edebug-instrumented-backtrace-frames
         (backtrace-get-frames 'edebug-debugger
                               :constructor #'edebug--make-frame)