[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/hyperbole 5e6e10dd6e 13/19: elisp-compiler-msg: Add Sma
From: |
ELPA Syncer |
Subject: |
[elpa] externals/hyperbole 5e6e10dd6e 13/19: elisp-compiler-msg: Add Smart Key support for ERT "Test <symbol>" |
Date: |
Sun, 24 Jul 2022 16:57:38 -0400 (EDT) |
branch: externals/hyperbole
commit 5e6e10dd6e61ae1940dca41114087e9e19db21f3
Author: Bob Weiner <rsw@gnu.org>
Commit: Bob Weiner <rsw@gnu.org>
elisp-compiler-msg: Add Smart Key support for ERT "Test <symbol>"
Such lines jump to the def of the symbol. Also add support for
symbol and pathname references from backtraces in ERT output.
---
ChangeLog | 4 ++++
hibtypes.el | 40 ++++++++++++++++++++++++++++++----------
2 files changed, 34 insertions(+), 10 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 3364aafea8..317b847ea9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+* hibtypes.el (elisp-compiler-msg): Add support for ERT "Test <symbol>"
+ lines to jump to the def of the symbol and for symbol and pathname
+ references from backtraces in ERT output.
+
* hib-debbugs.el (debbugs-version-sufficient-p): Handle if version
is nil due to edebug mocking of 'find-file-noselect'.
test/hui-tests.el (hui-gibut-create-link-to-file,
diff --git a/hibtypes.el b/hibtypes.el
index 384d0cd858..ac1811c6f5 100644
--- a/hibtypes.el
+++ b/hibtypes.el
@@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 19-Sep-91 at 20:45:31
-;; Last-Mod: 23-Jul-22 at 01:30:20 by Bob Weiner
+;; Last-Mod: 23-Jul-22 at 18:26:19 by Bob Weiner
;;
;; Copyright (C) 1991-2022 Free Software Foundation, Inc.
;; See the "HY-COPY" file for license information.
@@ -38,6 +38,7 @@
(require 'cl-lib) ;; for cl-count
(require 'subr-x) ;; For string-trim
(require 'hactypes)
+(require 'thingatpt)
;;; ************************************************************************
;;; Public variables
@@ -1066,23 +1067,42 @@ This works with JavaScript and Python tracebacks, gdb,
dbx, and xdb. Such lines
;;; ========================================================================
(defib elisp-compiler-msg ()
- "Jump to source code for definition associated with an Emacs Lisp error
message.
-The error may from the Emacs byte compiler, the Emacs Lisp native
+ "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 the file line references."
+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 (src buffer-p label)
+ (let (src buffer-p label start-end
+ lbl-start-end)
(or
;; Emacs Regression Test (ERT) output lines
- (save-excursion
- (forward-line 0)
- (when (looking-at
"\\s-+\\(passed\\|failed\\|skipped\\)\\s-+[0-9]+/[0-9]+\\s-+\\(\\S-+\\)\\s-+(")
- (setq label (match-string-no-properties 2))
- (ibut:label-set label (match-beginning 2) (match-end 2))
+ (when (or (save-excursion
+ (forward-line 0)
+ (or (looking-at
"\\s-+\\(passed\\|failed\\|skipped\\)\\s-+[0-9]+/[0-9]+\\s-+\\(\\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 (hypb:replace-match-string "[^:]+::" label "" t))
(hact 'smart-tags-display label nil)))
- [elpa] externals/hyperbole 44262d14a7 14/19: Resolve all but one test case issues from the latest updates, (continued)
- [elpa] externals/hyperbole 44262d14a7 14/19: Resolve all but one test case issues from the latest updates, ELPA Syncer, 2022/07/24
- [elpa] externals/hyperbole 80d1d2dd4c 12/19: Update tests to work with new ibut:create code, ELPA Syncer, 2022/07/24
- [elpa] externals/hyperbole c38d137510 03/19: Merge branch 'master' of hyperbole, ELPA Syncer, 2022/07/24
- [elpa] externals/hyperbole e9015341c0 08/19: hypb.el: Support devdocs-lookup package, ELPA Syncer, 2022/07/24
- [elpa] externals/hyperbole 4860da0802 07/19: hsettings.el (hyperbole-web-search): Add flag to return search expr, ELPA Syncer, 2022/07/24
- [elpa] externals/hyperbole 72ca3f0041 10/19: hui-mini.el: Multi-line menu support; add To/ and Doc a-z menus, ELPA Syncer, 2022/07/24
- [elpa] externals/hyperbole 7a86ea33e2 09/19: Add ibut:create and allow Assist Key :help for Elisp functions, ELPA Syncer, 2022/07/24
- [elpa] externals/hyperbole c517641b51 18/19: * ibut:create Ensure lbl-key is always set to name, if available, ELPA Syncer, 2022/07/24
- [elpa] externals/hyperbole 694f3110fd 02/19: hsys-org.el: Activate only if not at eol or eob, ELPA Syncer, 2022/07/24
- [elpa] externals/hyperbole d256f195ee 11/19: Fix major issues with ibut:create but some tests still fail, ELPA Syncer, 2022/07/24
- [elpa] externals/hyperbole 5e6e10dd6e 13/19: elisp-compiler-msg: Add Smart Key support for ERT "Test <symbol>",
ELPA Syncer <=
- [elpa] externals/hyperbole 75c9214c35 19/19: hypb:require-package: Prompt user with y/n query before install pkg, ELPA Syncer, 2022/07/24
- [elpa] externals/hyperbole dcb0b9e7aa 17/19: Merge branch 'master' of hyperbole; initial 80-col comment fixes, ELPA Syncer, 2022/07/24
- [elpa] externals/hyperbole dcc51fb827 15/19: Change pushd to cd since /bin/sh does not support pushd, ELPA Syncer, 2022/07/24
- [elpa] externals/hyperbole 716507c51c 16/19: Fix a number of issues with ibut attribute handling, ELPA Syncer, 2022/07/24