Function: ibtypes::elisp-compiler-msg
ibtypes::elisp-compiler-msg is a byte-compiled function defined in
hibtypes.el.
Signature
(ibtypes::elisp-compiler-msg)
Documentation
Jump to definition of an Emacs Lisp symbol in an error or test message.
The message may come from the Emacs byte compiler, the Emacs Lisp native compiler or the Emacs regression test system (ERT). This works when activated anywhere within file line references.
Source Code
;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hibtypes.el
;;; ========================================================================
;;; Jumps to source of Emacs Lisp byte-compiler error messages.
;;; ========================================================================
(defib elisp-compiler-msg ()
"Jump to definition of an Emacs Lisp symbol in an error or test message.
The message may come from the Emacs byte compiler, the Emacs Lisp native
compiler or the Emacs regression test system (ERT).
This works when activated anywhere within file line references."
(when (or (member (buffer-name) '("*Compile-Log-Show*" "*Compile-Log*"
"*compilation*" "*Async-native-compile-log*" "*ert*"))
(save-excursion
(and (re-search-backward "^[^ \t\n\r]" nil t)
(looking-at "While compiling\\|In \\([^ \n]+\\):$"))))
(let ((case-fold-search t)
src buffer-p label start-end lbl-start-end)
(or
;; Emacs Regression Test (ERT) output lines
(when (or (save-excursion
(forward-line 0)
(or (looking-at "\\s-+\\(passed\\|failed\\|skipped\\)\\s-+\\(?:[0-9]+/[0-9]+\\s-+\\)\\(\\S-+\\)")
(looking-at "\\(Test\\)\\s-+\\(\\S-+\\)\\s-+\\(backtrace\\|condition\\):")))
;; Handle symbols and pathnames in a backtrace from an ERT test exception
(save-match-data
(and (save-excursion
(re-search-backward "^$\\|^Test \\(\\S-+\\)\\s-+\\(backtrace\\|condition\\):" nil t)
(looking-at "Test "))
(or
;; Handle double-quoted pathnames
(and (setq lbl-start-end (hpath:delimited-possible-path nil t)
label (nth 0 lbl-start-end))
(ibut:label-set label (nth 1 lbl-start-end) (nth 2 lbl-start-end)))
;; Handle symbols
(and (setq label (thing-at-point 'symbol)
start-end (bounds-of-thing-at-point 'symbol))
(ibut:label-set label (car start-end) (cdr start-end)))))))
(unless label
(setq label (match-string-no-properties 2))
(ibut:label-set label (match-beginning 2) (match-end 2)))
(if (hpath:is-p label)
(hact 'link-to-file label)
;; Remove prefix generated by actype and ibtype definitions.
(setq label (replace-regexp-in-string "[^:]+::" "" label nil t))
(hact 'smart-tags-display label nil)))
;; GNU Emacs Byte Compiler
(and (save-excursion
(re-search-backward
"^While compiling [^\t\n]+ in \\(file\\|buffer\\) \\([^ \n]+\\):$"
nil t))
(setq buffer-p (equal (match-string-no-properties 1) "buffer")
src (match-string-no-properties 2))
(save-excursion
(end-of-line)
(re-search-backward "^While compiling \\([^ \n]+\\)\\(:$\\| \\)"
nil t))
(progn
(setq label (match-string-no-properties 1))
(ibut:label-set label (match-beginning 1) (match-end 1))
;; Remove prefix generated by actype and ibtype definitions.
(setq label (replace-regexp-in-string "[^:]+::" "" label nil t))
(hact 'link-to-regexp-match
(concat "^\(def[a-z \t]+" (regexp-quote label)
"[ \t\n\r\(]")
1 src buffer-p)))
;; GNU Emacs Native Compiler
(and (save-excursion
(re-search-backward "^Compiling \\([^ \n]+\\)\\.\\.\\.$" nil t))
(setq buffer-p nil
src (match-string-no-properties 1))
(save-excursion
(end-of-line)
(re-search-backward "^In \\([^ \n]+\\):$" nil t))
(progn
(setq label (match-string-no-properties 1))
(ibut:label-set label (match-beginning 1) (match-end 1))
;; Remove prefix generated by actype and ibtype definitions.
(setq label (replace-regexp-in-string "[^:]+::" "" label nil t))
(hact 'link-to-regexp-match
(concat "^\(def[a-z \t]+" (regexp-quote label)
"[ \t\n\r\(]")
1 src buffer-p)))
;; InfoDock and XEmacs
(and (save-excursion
(re-search-backward
"^Compiling \\(file\\|buffer\\) \\([^ \n]+\\) at "
nil t))
(setq buffer-p (equal (match-string-no-properties 1) "buffer")
src (match-string-no-properties 2))
(save-excursion
(end-of-line)
(re-search-backward "^While compiling \\([^ \n]+\\)\\(:$\\| \\)"
nil t))
(progn
(setq label (match-string-no-properties 1))
(ibut:label-set label (match-beginning 1) (match-end 1))
;; Remove prefix generated by actype and ibtype definitions.
(setq label (replace-regexp-in-string "[^:]+::" "" label nil t))
(hact 'link-to-regexp-match
(concat "^\(def[a-z \t]+" (regexp-quote label)
"[ \t\n\r\(]")
1 src buffer-p)))))))