Function: ibtypes::ipython-stack-frame
ibtypes::ipython-stack-frame is a byte-compiled function defined in
hibtypes.el.
Signature
(ibtypes::ipython-stack-frame)
Documentation
Jump to the line associated with an ipython stack frame line numbered msg.
ipython outputs each pathname once followed by all matching lines in that pathname. Messages are recognized in any buffer (other than a helm completion buffer).
Source Code
;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hibtypes.el
(defib ipython-stack-frame ()
"Jump to the line associated with an ipython stack frame line numbered msg.
ipython outputs each pathname once followed by all matching lines
in that pathname. Messages are recognized in any buffer (other
than a helm completion buffer)."
;; Locate and parse ipython stack trace messages found in any buffer other than a
;; helm completion buffer.
;;
;; Sample ipython stack trace command output:
;;
;; ~/Dropbox/py/inview/inview_pr.py in ap(name_filter, value_filter, print_func)
;; 1389 apc(name_filter, value_filter, print_func, defined_only=True)
;; 1390 print('\n**** Modules/Packages ****')
;; -> 1391 apm(name_filter, value_filter, print_func, defined_only=True)
;; 1392
;; 1393 def apa(name_filter=None, value_filter=None, print_func=pd1, defined_only=False):
(unless (derived-mode-p 'helm-major-mode)
(save-excursion
(beginning-of-line)
(let ((line-num-regexp "\\( *\\|-+> \\)?\\([1-9][0-9]*\\) ")
line-num
file)
(when (looking-at line-num-regexp)
;; ipython stack trace matches and context lines (-A<num> option)
(setq line-num (match-string-no-properties 2)
file nil)
(while (and (= (forward-line -1) 0)
(looking-at line-num-regexp)))
(unless (or (looking-at line-num-regexp)
(not (re-search-forward " in " nil (line-end-position)))
(and (setq file (buffer-substring-no-properties (line-beginning-position) (match-beginning 0)))
(string-empty-p (string-trim file))))
(ibut:label-set (concat file ":" line-num))
(hact 'hib-link-to-file-line file line-num)))))))