branch: externals/hyperbole
commit a7efb9be796edb4af710c4fbc5307c690437ddb9
Author: bw <[email protected]>
Commit: bw <[email protected]>
FAST-DEMO include ert test in file to avoid loading all test files
hbut.el (ebut:label-p): For <action> buttons, allow unlimited length
button labels since might be an entire long sexpression.
hib-debbugs.el (debbugs-gnu-query:list): Debbugs support libary has been
renamed
from 'debbugs-gnu' to just 'debbugs'.
test/hui-tests.el (hui--link-possible-types): Make use .otl rather than
.outl
file suffix which automatically invokes 'outline-mode'.
---
ChangeLog | 14 ++++++++++++++
FAST-DEMO | 18 ++++++++++++++----
hbut.el | 17 ++++++++++++++---
hib-debbugs.el | 4 ++--
hypb-ert.el | 7 +++++--
test/hui-tests.el | 5 ++---
6 files changed, 51 insertions(+), 14 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 08502460d9..c4c4e97a62 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
+2023-12-30 Bob Weiner <[email protected]>
+
+* FAST-DEMO (Action Buttons): Update to include ert test definition within
+ the file so do not have to load all of the test files to run the demo.
+
+* hbut.el (ebut:label-p): For <action> buttons, allow unlimited length
+ button labels since might be an entire long sexpression.
+
+* hib-debbugs.el (debbugs-gnu-query:list): Debbugs support libary has been
renamed
+ from 'debbugs-gnu' to just 'debbugs'.
+
2023-12-29 Bob Weiner <[email protected]>
+* test/hui-tests.el (hui--link-possible-types): Make use .otl rather than .outl
+ file suffix which automatically invokes 'outline-mode'.
+
* hyrolo.el (hyrolo-to-entry-end): Fix bug where HyRolo fgrep would get stuck
in Org buffers without any outline delimiters due to this function moving
backwards.
diff --git a/FAST-DEMO b/FAST-DEMO
index f42c5b4e52..8c0c6982ac 100644
--- a/FAST-DEMO
+++ b/FAST-DEMO
@@ -341,10 +341,20 @@ pspell-config(1) - prints information about a
libpspell installation
Display a Hyperbole Koutline starting from cell 3b10 with lines per
cell clipped to 2.
- <hbut-tests-ibut-insert-kbd-key>
-
- Run one of the Hyperbole regression tests. Thus, tests defined with
- the Emacs Regression Test framework using `ert-deftest' work too.
+ <ert-deftest hbut-tests-ibut-program-link-to-directory ()
+ "Programmatically create ibut link-to-directory."
+ (with-temp-buffer
+ (ibut:program nil 'link-to-directory "/tmp")
+ (should (string= "\"/tmp\"" (buffer-string))))>
+
+ <hbut-tests-ibut-program-link-to-directory>
+
+ Tests defined with the Emacs Regression Test framework using
+ `ert-deftest' can be run via action buttons as well. Press {M-RET}
+ on the first line of each of the two above action buttons, within
+ the <> delimiters. Start with the first one which defines an ERT
+ test case; the second one runs it, displaying the result which should
+ be successful.
** Many More Implicit Button Types to Learn Across Time
diff --git a/hbut.el b/hbut.el
index cf9809d34e..7b9bd40a65 100644
--- a/hbut.el
+++ b/hbut.el
@@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 18-Sep-91 at 02:57:09
-;; Last-Mod: 26-Dec-23 at 23:32:56 by Bob Weiner
+;; Last-Mod: 30-Dec-23 at 01:38:30 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -297,7 +297,15 @@ delimiters. With TWO-LINES-FLAG non-nil, constrain label
search
to two lines."
(let ((opoint (point))
(quoted "\\(^\\|[^\\{$]\\)")
- (hbut:max-len hbut:max-len)
+ ;; For <> delimited action buttons which can be long
+ ;; sexpressions, don't enforce the normal, short button length
+ ;; limit. Setting this to 0 means unlimited length, assuming
+ ;; the TWO-LINES-FLAG is nil.
+ (hbut:max-len
+ (if (and (string-equal start-delim "<")
+ (string-equal end-delim ">"))
+ 0
+ hbut:max-len))
npoint start lbl-key end but-start but-end start-regexp end-regexp)
(unless start-delim (setq start-delim ebut:label-start))
(unless end-delim (setq end-delim ebut:label-end))
@@ -1773,7 +1781,10 @@ excluding delimiters, not just one."
(setq lbl-start-end (if (and start-delim end-delim)
(ibut:label-p nil start-delim end-delim t t)
(or (ibut:label-p nil "\"" "\"" t t)
- (ibut:label-p nil "<" ">" t t)
+ ;; <action> buttons can be longer
+ ;; than two lines, so don't limit
+ ;; the length.
+ (ibut:label-p nil "<" ">" t)
(ibut:label-p nil "{" "}" t t)
(ibut:label-p nil "[" "]" t t))))
(when lbl-start-end
diff --git a/hib-debbugs.el b/hib-debbugs.el
index d395179553..78d17f5d87 100644
--- a/hib-debbugs.el
+++ b/hib-debbugs.el
@@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 21-Jun-16 at 14:24:53
-;; Last-Mod: 3-Oct-23 at 23:23:16 by Mats Lidell
+;; Last-Mod: 30-Dec-23 at 00:13:19 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -189,7 +189,7 @@ used as well in place of `bug'."
Each element of the list should be of the form (attribute . attribute-value).
Attribute may be a symbol or a string. Common attributes
include: status, severity, and package."
- (require 'debbugs-gnu)
+ (require 'debbugs)
(setq debbugs-gnu-current-query nil)
(dolist (attr query-attribute-list)
(add-to-list 'debbugs-gnu-current-query
diff --git a/hypb-ert.el b/hypb-ert.el
index 639c2f3ede..7f7e5fcc7b 100644
--- a/hypb-ert.el
+++ b/hypb-ert.el
@@ -3,7 +3,7 @@
;; Author: Mats Lidell <[email protected]> and Bob Weiner <[email protected]>
;;
;; Orig-Date: 31-Mar-21 at 21:11:00
-;; Last-Mod: 28-Dec-23 at 15:33:38 by Bob Weiner
+;; Last-Mod: 30-Dec-23 at 00:38:40 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -41,7 +41,10 @@
;; Suppress ert messages so last test case message stays in the
minibuffer;
;; 3rd arg message-fn available only in Emacs 27 and earlier
(ert selector nil #'hypb-ert-message-function)
- (ert selector)))
+ (ert selector))
+ ;; ERT can display a long internal data structure as a result, so
+ ;; replace it in the minibuffer with a blank message.
+ (message ""))
(defun hypb-ert-run-test (test-name)
"Run the specified TEST-NAME ert test."
diff --git a/test/hui-tests.el b/test/hui-tests.el
index cc67aac880..c059fc5fda 100644
--- a/test/hui-tests.el
+++ b/test/hui-tests.el
@@ -3,7 +3,7 @@
;; Author: Mats Lidell <[email protected]>
;;
;; Orig-Date: 30-Jan-21 at 12:00:00
-;; Last-Mod: 26-Dec-23 at 11:54:57 by Bob Weiner
+;; Last-Mod: 30-Dec-23 at 00:00:18 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -1043,11 +1043,10 @@ With point on label suggest that ibut for rename."
(hy-delete-file-and-buffer file)))
;; Outline Heading link-to-string-match
- (let ((file (make-temp-file "hypb" nil ".outl" "* heading\nbody\n")))
+ (let ((file (make-temp-file "hypb" nil ".otl" "* heading\nbody\n")))
(unwind-protect
(progn
(find-file file)
- (outline-mode)
(goto-char 1)
(hy-test-helpers:ensure-link-possible-type 'link-to-string-match))
(hy-delete-file-and-buffer file)))