branch: externals/hyperbole
commit c70b1d33b136da21a6742406e516d52acee27543
Author: bw <[email protected]>
Commit: bw <[email protected]>
hypb:in-string-modes-regexps): Allow Python delimiters in all modes
---
ChangeLog | 5 +++++
hypb.el | 11 ++++-------
test/hpath-tests.el | 4 ++--
test/hywiki-tests.el | 2 +-
4 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 16fbf13cab..11222cb55d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2025-10-18 Bob Weiner <[email protected]>
+* hypb.el (hypb:in-string-modes-regexps): Change to support Python delimiters
in
+ all modes, e.g. Org mode with code embedding so do not miss strings.
+ test/hywiki-tests.el (hywiki-tests--hkey-help): Fix by adding second arg nil
to
+ 'documentation' mock and update to customization above.
+
* hyrolo.el (hyrolo-grep-file): Fix bug#79643. Add a mark at the end point of
all record insertions so can be referenced in 'hyrolo-yank' when calls
'hyrolo-yank-reformat-function'. This also allows the user to mark the
region
diff --git a/hypb.el b/hypb.el
index b9ecda8a75..8d911bfa33 100644
--- a/hypb.el
+++ b/hypb.el
@@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 6-Oct-91 at 03:42:38
-;; Last-Mod: 16-Aug-25 at 23:58:24 by Bob Weiner
+;; Last-Mod: 18-Oct-25 at 12:22:12 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -71,15 +71,12 @@ This should end with a space.")
(defcustom hypb:in-string-modes-regexps
'(let ((open-regexp "\\(^\\|[^\\]\\)\\(%s\\)")
(close-regexp "\\(^\\|[^\\]\\)\\(%s\\)"))
- (cond ((derived-mode-p 'python-mode)
- (list (format open-regexp "\"\\|'''\\|\"\"\"\\|'")
- (format close-regexp "\"\\|'''\\|\"\"\"\\|'")))
- ((derived-mode-p 'texinfo-mode)
+ (cond ((derived-mode-p 'texinfo-mode)
(list (format open-regexp "``\\|\"")
(format close-regexp "''\\|\"")))
(t
- (list (format open-regexp "\"")
- (format close-regexp "\"")))))
+ (list (format open-regexp "'''\\|\"\"\"\\|\"\\|'")
+ (format close-regexp "'''\\|\"\"\"\\|\"\\|'")))))
"Return a list of open/close string delimiter regexps for `hypb:in-string-p'.
Or clauses in regexps must be arranged from longest match to shortest match."
:type 'sexp
diff --git a/test/hpath-tests.el b/test/hpath-tests.el
index 8e7c9da008..3519ebd923 100644
--- a/test/hpath-tests.el
+++ b/test/hpath-tests.el
@@ -3,7 +3,7 @@
;; Author: Mats Lidell <[email protected]>
;;
;; Orig-Date: 28-Feb-21 at 23:26:00
-;; Last-Mod: 25-Apr-25 at 21:51:39 by Mats Lidell
+;; Last-Mod: 18-Oct-25 at 12:43:56 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -420,7 +420,7 @@ See `hpath:line-and-column-regexp'."
("\tfile1.ext file2.ext file3.ext" ; Leading tab
("file1" "file2" "file3"))
- ;; Failing cases
+ ;; !! TODO - Failing cases
;; ("'file1\".ext' 'file2\".ext' 'file3\".ext'" ; Single quoted
with double quote
;; ("file1\"" "file2\"" "file3\""))
;; ("\"file1'.ext\" \"file2'.ext\" \"file3'.ext\"" ; Double quoted
with single quote
diff --git a/test/hywiki-tests.el b/test/hywiki-tests.el
index 888480f897..c077ffde66 100644
--- a/test/hywiki-tests.el
+++ b/test/hywiki-tests.el
@@ -1956,7 +1956,7 @@ Insert test in the middle of other text."
(kill-buffer help-bn))
(mocklet (((hkey-actions) => nil)
(hkey-help not-called)
- ((documentation 'ibtypes::hywiki-existing-word) => "Doc
string"))
+ ((documentation 'ibtypes::hywiki-existing-word nil) =>
"Doc string"))
(hywiki-help)
(should (get-buffer help-bn))
(with-current-buffer help-bn