branch: externals/hyperbole
commit 13e4c57d7aaf65bb8b4e6e302ee1d73897c1b318
Merge: bac4fd78fb 645e8341ec
Author: bw <[email protected]>
Commit: bw <[email protected]>
Merge branch 'master' into rsw
---
ChangeLog | 44 ++++++++++++++++++++++++++++++++++++++++++++
hsys-org.el | 1 +
hui-mini.el | 1 +
hyrolo.el | 7 ++++---
hywiki.el | 9 +++++----
test/demo-tests.el | 25 -------------------------
test/hmouse-drv-tests.el | 2 --
test/hui-select-tests.el | 6 ++----
test/hui-tests.el | 4 ----
test/hyrolo-tests.el | 22 ----------------------
test/hywiki-tests.el | 48 ++++++++++++++++++++++++++++++++++++++++--------
test/hywiki-yki-tests.el | 11 +++--------
test/kotl-mode-tests.el | 5 -----
13 files changed, 100 insertions(+), 85 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index dea4faf878..2725b4730e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -30,6 +30,50 @@
* README.md: Add Hyperbole Articles section.
+2026-02-18 Mats Lidell <[email protected]>
+
+* hsys-org.el: require 'find-func for find-library--from-load-history.
+
+* hui-mini.el (hywiki-mode):
+* hyrolo.el (hywiki-mode): Defvar.
+
+* hywiki.el (hywiki-potential-buffer-p, hywiki-word-from-reference): Fix
+ quotes.
+
+2026-02-17 Mats Lidell <[email protected]>
+
+* test/hywiki-tests.el
(hywiki-tests--verify-removal-of-delimiter-updates-face):
+ (hywiki-tests--wikiword-yanked-with-extra-words):
+ (hywiki-tests--create-wikiword-file-highlights-wikiword): Use
+ hywiki-tests--with-face-test default value.
+* test/hywiki-yki-tests.el
(hywiki--verify-get-buffer-text-with-point-and-highlight-compact):
+ Use hywiki-tests--with-face-test default value. Let
+ hywiki-tests--preserve-hywiki-mode handle wikiword file and
hywiki-directory.
+
+2026-02-16 Mats Lidell <[email protected]>
+
+* test/demo-tests.el:
+* test/hmouse-drv-tests.el:
+* test/hui-select-tests.el:
+* test/hui-tests.el:
+* test/hyrolo-tests.el:
+* test/kotl-mode-tests.el: Activate skipped test that can run in batch mode.
+ * In addition to activating the tests some use of
+ hy-test-helpers:consume-input-events has been removed where it is not
+ needed.
+ * A few tests were blocked by checking quoted strings where the quotes
+ differ between batch and interactive. They have been modified to not verify
+ the part of the message that contains the quotes.
+
+2026-02-15 Mats Lidell <[email protected]>
+
+* hywiki.el (hywiki--org-link-html-format): Use
+ `hpath:dashes-to-spaces-markup-anchor' to make header match target.
+* test/hywiki-tests.el
(hywiki-tests--action-key-moves-to-word-and-section-using-dash-to-space-conversion):
+ Add test for headers with dashes.
+ (hywiki-tests--published-html-links-to-word-and-section): Update test to
+ the dash to space conversion in headers.
+
2026-02-15 Bob Weiner <[email protected]>
* hywiki.el (hywiki-word-highlight-in-current-buffer): Fix bug that added
diff --git a/hsys-org.el b/hsys-org.el
index 4c473fb7c2..43b99a2bdb 100644
--- a/hsys-org.el
+++ b/hsys-org.el
@@ -41,6 +41,7 @@
(require 'org-macs)
(require 'package)
(require 'warnings)
+(require 'find-func)
;; Avoid any potential library name conflict by giving the load directory.
(require 'set (expand-file-name "set" hyperb:dir))
diff --git a/hui-mini.el b/hui-mini.el
index 139cb8a723..8c307dc243 100644
--- a/hui-mini.el
+++ b/hui-mini.el
@@ -38,6 +38,7 @@
(defvar hyrolo-add-hook) ; "hyrolo.el"
(defvar hyrolo-edit-hook) ; "hyrolo.el"
(defvar hyrolo-file-list) ; "hyrolo.el"
+(defvar hywiki-mode) ; "hywiki.el"
(defvar org-mode-map) ; "org.el"
(declare-function hpath:find "hpath")
diff --git a/hyrolo.el b/hyrolo.el
index 48ada801e8..a6f7a07211 100644
--- a/hyrolo.el
+++ b/hyrolo.el
@@ -89,14 +89,15 @@
(declare-function org-outline-level "org")
(defvar consult-preview-key) ; "ext:consult.el"
+(defvar google-contacts-buffer-name) ; "ext:google-contacts.el"
+(defvar hbut:source-prefix) ; "hbut.el"
+(defvar hywiki-mode) ; "hywiki.el"
+(defvar org-agenda-buffer-tmp-name) ; "org-agenda.el"
(defvar org-directory) ; "org.el"
(defvar org-mode-map) ; "org-keys.el"
(defvar org-mode-syntax-table) ; "org.el"
(defvar org-outline-regexp) ; "org.el"
(defvar org-outline-regexp-bol) ; "org.el"
-(defvar org-agenda-buffer-tmp-name) ; "org-agenda.el"
-(defvar google-contacts-buffer-name) ; "ext:google-contacts.el"
-(defvar hbut:source-prefix) ; "hbut.el"
;; markdown-mode.el
(defvar markdown-regex-header)
diff --git a/hywiki.el b/hywiki.el
index 0d7e5cb315..dc04a2aa18 100644
--- a/hywiki.el
+++ b/hywiki.el
@@ -1103,7 +1103,7 @@ Exclude the minibuffer if selected and return nil."
"Return non-nil if the current buffer can support HyWikiWords.
Always exclude minibuffers.
This does not mean `hywiki-mode' is presently active in that buffer;
-use 'hywiki-active-in-current-buffer-p' for that."
+use `hywiki-active-in-current-buffer-p' for that."
(and (not (minibufferp))
;; (not (and (boundp 'edebug-active) edebug-active))
@@ -3151,7 +3151,8 @@ If not found, set it up and return the new project
properties."
(defun hywiki--org-link-html-format (path-stem suffix desc info)
"Format an html link using Org ids."
- (let* ((heading (and suffix (not (string-empty-p suffix)) (substring suffix
1)))
+ (let* ((raw-heading (and suffix (not (string-empty-p suffix)) (substring
suffix 1)))
+ (heading (and raw-heading (hpath:dashes-to-spaces-markup-anchor
raw-heading)))
(link-obj (org-element-create
'link
(list
@@ -3789,9 +3790,9 @@ Default to any HyWikiWord at point."
(defun hywiki-word-from-reference (ref)
"Return the HyWikiWord part of a reference (part before the #).
This does not test whether a referent exists for the HyWikiWord; call
-‘hywiki-referent-exists-p’ without an argument for that. Nor does it
+`hywiki-referent-exists-p' without an argument for that. Nor does it
test whether the HyWikiWord reference is within an invalid context;
-call ‘hywiki-non-hook-context-p’ for that."
+call `hywiki-non-hook-context-p' for that."
(when (and (stringp ref)
(string-match hywiki-word-with-optional-suffix-exact-regexp ref))
(match-string 1 ref)))
diff --git a/test/demo-tests.el b/test/demo-tests.el
index 244dbae9f2..6170738604 100644
--- a/test/demo-tests.el
+++ b/test/demo-tests.el
@@ -74,7 +74,6 @@
;; Smart scrolling
(ert-deftest demo-smart-scrolling-proportional-test ()
- (skip-unless (not noninteractive))
(unwind-protect
(let ((enable-local-variables nil))
(hypb:display-file-with-logo "DEMO")
@@ -148,12 +147,10 @@
;; HyRolo
(ert-deftest demo-hyrolo-test ()
- (skip-unless (not noninteractive))
(unwind-protect
(with-temp-buffer
(load (expand-file-name "hyrolo-demo.el" hyperb:dir))
(should (hact 'kbd-key "C-x 4 r work RET"))
- (hy-test-helpers:consume-input-events)
(should (string= (buffer-name) hyrolo-display-buffer))
(should (search-forward "Dunn, John")))
(hyrolo-demo-quit)))
@@ -414,7 +411,6 @@
(hy-test-helpers:kill-buffer "DEMO")))
(ert-deftest demo-factorial-ebutton-test ()
- (skip-unless (not noninteractive))
(unwind-protect
(let ((enable-local-variables nil))
(hypb:display-file-with-logo "DEMO")
@@ -508,37 +504,31 @@
(ert-deftest fast-demo-key-series-dired-other-window ()
"Action key on `dired-other-window' brings up Dired in the other window."
- (skip-unless (not noninteractive))
(with-temp-buffer
(insert "{M-x dired-other-window RET ${hyperb:dir}/*.el RET}")
(goto-char 5)
(action-key)
- (hy-test-helpers:consume-input-events)
(should (equal 'dired-mode major-mode))
(should (equal hyperb:dir (expand-file-name default-directory)))))
(ert-deftest fast-demo-key-series-window-grid-22 ()
"Action key on window grid key series creates a grid."
- (skip-unless (not noninteractive))
(with-temp-buffer
(insert "{C-c @ 22 RET}")
(goto-char 3)
(action-key)
- (hy-test-helpers:consume-input-events)
(should (= 4 (length (window-list))))))
(ert-deftest fast-demo-key-series-kotl-files ()
"Action key brings up kotl files in a grid.
Note: Depends on key series in FAST-DEMO and how many files in
hyberbole folder that starts with kotl."
- (skip-unless (not noninteractive))
(unwind-protect
(let ((enable-local-variables nil))
(hypb:display-file-with-logo "FAST-DEMO")
(goto-char (point-min))
(search-forward "{C--1 C-c @")
(action-key)
- (hy-test-helpers:consume-input-events)
(should (= 4 (length (window-list)))))
(hy-test-helpers:kill-buffer "FAST-DEMO")))
@@ -546,28 +536,23 @@ hyberbole folder that starts with kotl."
"Action key brings up `emacs-lisp-mode' files in a grid.
Note: Relies on that empty windows are created when there are not
enough files with matching mode loaded."
- (skip-unless (not noninteractive))
(with-temp-buffer
(insert "{C-u 0 C-c @ emacs-lisp-mode RET 33 RET}")
(goto-char 3)
(action-key)
- (hy-test-helpers:consume-input-events)
(should (= 9 (length (window-list))))))
(ert-deftest fast-demo-key-series-hyperbole-dir ()
"Action key on hyperb:dir brings up hyperbole folder."
- (skip-unless (not noninteractive))
(with-temp-buffer
(insert "{C-x 4 d ${hyperb:dir} RET}")
(goto-char 5)
(action-key)
- (hy-test-helpers:consume-input-events)
(should (equal 'dired-mode major-mode))
(should (equal hyperb:dir (expand-file-name default-directory)))))
(ert-deftest fast-demo-key-series-keep-lines-ext ()
"Action key opens Ibuffer and keep lines with extension."
- (skip-unless (not noninteractive))
(let ((buff "*Ibuffer*")
(old (global-key-binding (kbd "C-x C-b")))
(tmp (make-temp-file "hypb" nil ".hypb-test")))
@@ -578,7 +563,6 @@ enough files with matching mode loaded."
(insert "{C-x C-b C-x C-q M-x keep-lines RET .hypb-test$ RET C-x
C-q}")
(goto-char 5)
(action-key)
- (hy-test-helpers:consume-input-events)
(with-current-buffer buff
(should (looking-at-p (concat ".*" tmp)))))
(hy-test-helpers:kill-buffer buff)
@@ -588,7 +572,6 @@ enough files with matching mode loaded."
(ert-deftest fast-demo-key-series-keep-lines-slash ()
"Action key opens Ibuffer and keep lines that contains a slash."
- (skip-unless (not noninteractive))
(let ((buff "*Ibuffer*")
(old (global-key-binding (kbd "C-x C-b")))
(dir (dired hyperb:dir)))
@@ -598,7 +581,6 @@ enough files with matching mode loaded."
(insert "{C-x C-b C-x C-q M-x keep-lines RET [\\/]$ RET C-x C-q}")
(goto-char 5)
(action-key)
- (hy-test-helpers:consume-input-events)
(with-current-buffer buff
(should (looking-at-p (concat ".*[\\/]")))))
(hy-test-helpers:kill-buffer buff)
@@ -617,7 +599,6 @@ enough files with matching mode loaded."
(insert "{C-x C-b / RET dired-mode RET}")
(goto-char 5)
(action-key)
- (hy-test-helpers:consume-input-events)
(with-current-buffer buff
(should (looking-at-p (concat ".*Dired by name")))))
(hy-test-helpers:kill-buffer buff)
@@ -637,7 +618,6 @@ enough files with matching mode loaded."
(insert "{ M-x shell RET M-> (cd ${hyperb:dir} && echo && echo
\"PWD=$(pwd)\") RET }")
(goto-char 5)
(action-key)
- (hy-test-helpers:consume-input-events)
(with-current-buffer shell-buffer-name
(goto-char (point-max))
(accept-process-output (get-buffer-process shell-buffer-name) 1)
@@ -650,7 +630,6 @@ enough files with matching mode loaded."
(ert-deftest fast-demo-key-series-shell-grep ()
"Action key executes grep shell command."
- (skip-unless (not noninteractive))
(let* ((shell-file-name (executable-find "sh"))
(shell-buffer-name "*shell*")
(existing-shell-flag (get-buffer-process shell-buffer-name)))
@@ -659,7 +638,6 @@ enough files with matching mode loaded."
(insert "{M-x shell RET M-> (export HYPERBOLE_DIR=${hyperb:dir} &&
cd $HYPERBOLE_DIR && grep -n gbut:label-list *.el) RET}")
(goto-char 5)
(action-key)
- (hy-test-helpers:consume-input-events)
(with-current-buffer shell-buffer-name
(with-timeout (5 (ert-fail "Test timed out"))
(while (not (string-match-p
"\n.*\\.el:[0-9]+:.*defun.*gbut:label-list ()" (buffer-substring-no-properties
(point-min) (point-max))))
@@ -707,7 +685,6 @@ enough files with matching mode loaded."
(goto-char 5)
(view-mode)
(action-key)
- (hy-test-helpers:consume-input-events)
(with-current-buffer shell-buffer-name
(goto-char (point-max))
(accept-process-output (get-buffer-process shell-buffer-name) 1)
@@ -720,7 +697,6 @@ enough files with matching mode loaded."
(ert-deftest fast-demo-key-series-shell-grep-view-mode ()
"Action key executes grep shell command from buffer in `view-mode`."
- (skip-unless (not noninteractive))
(let* ((shell-file-name (executable-find "sh"))
(shell-buffer-name "*shell*")
(existing-shell-flag (get-buffer-process shell-buffer-name)))
@@ -730,7 +706,6 @@ enough files with matching mode loaded."
(goto-char 5)
(view-mode)
(action-key)
- (hy-test-helpers:consume-input-events)
(with-current-buffer shell-buffer-name
(with-timeout (5 (ert-fail "Test timed out"))
(while (not (string-match-p
"\n.*\\.el:[0-9]+:.*defun.*gbut:label-list ()"
diff --git a/test/hmouse-drv-tests.el b/test/hmouse-drv-tests.el
index 1e8636d465..b964b85868 100644
--- a/test/hmouse-drv-tests.el
+++ b/test/hmouse-drv-tests.el
@@ -63,7 +63,6 @@
(ibtype:delete 'ibtypes::defal-url)))
(ert-deftest hbut-defal-key-sequence ()
- (skip-unless (not noninteractive))
(defal defal-key "{C-h v \\1 RET}")
(unwind-protect
(with-temp-buffer
@@ -137,7 +136,6 @@
(ibtype:delete 'ibtypes::defil-url)))
(ert-deftest hbut-defil-key-sequence ()
- (skip-unless (not noninteractive))
(defil defil-key "<<<" ">>>" ".*" "{C-h v \\& RET}")
(unwind-protect
(with-temp-buffer
diff --git a/test/hui-select-tests.el b/test/hui-select-tests.el
index 7c935cee7b..ea1287ee1c 100644
--- a/test/hui-select-tests.el
+++ b/test/hui-select-tests.el
@@ -81,7 +81,6 @@
(ert-deftest hui-select--thing ()
"`hui-select-thing' selects bigger sections of text when called repeatedly."
- (skip-unless (not noninteractive))
(hui-select-reset)
(with-temp-buffer
(insert "Buffer\n\nParagraph\nline. One word.")
@@ -120,12 +119,11 @@
;; error
(ert-with-message-capture cap
(should-not (hui-select-thing))
- (hy-test-helpers:should-last-message "(hui-select-boundaries): ‘buffer’
is the largest selectable region" cap))))
+ (hy-test-helpers:should-last-message "the largest selectable region"
cap))))
(ert-deftest hui-select--thing-interactive-prints-type-of-match ()
"`hui-select-thing' selects bigger sections of text when called repeatedly.
Verifies right type of match is printed when `hui-select-display-type' is set
to t."
- (skip-unless (not noninteractive))
(let ((hui-select-display-type t))
(hui-select-reset)
(with-temp-buffer
@@ -167,7 +165,7 @@ Verifies right type of match is printed when
`hui-select-display-type' is set to
(ert-with-message-capture cap
(should-not (call-interactively 'hui-select-thing))
- (hy-test-helpers:should-last-message "(hui-select-boundaries):
‘buffer’ is the largest selectable region" cap)))))
+ (hy-test-helpers:should-last-message "the largest selectable region"
cap)))))
(provide 'hui-select-tests)
;;; hui-select-tests.el ends here
diff --git a/test/hui-tests.el b/test/hui-tests.el
index 4bc32b8375..b03d2fa9f1 100644
--- a/test/hui-tests.el
+++ b/test/hui-tests.el
@@ -518,7 +518,6 @@ of the defun."
(ert-deftest hui--copy-to-register--yank-in-same-kotl ()
"Yank klink in register into same kotl file."
- (skip-unless (not noninteractive))
(let ((kotl-file (make-temp-file "hypb" nil ".kotl")))
(unwind-protect
(progn
@@ -541,7 +540,6 @@ of the defun."
(ert-deftest hui--copy-to-register--yank-in-other-kotl ()
"Yank klink in register into other kotl file."
- (skip-unless (not noninteractive))
(let ((kotl-file (make-temp-file "hypb" nil ".kotl"))
(other-file (make-temp-file "hypb" nil ".kotl")))
(unwind-protect
@@ -567,7 +565,6 @@ of the defun."
(ert-deftest hui--copy-to-register--yank-in-other-file ()
"Yank klink in regiuster into other file."
- (skip-unless (not noninteractive))
(let ((kotl-file (make-temp-file "hypb" nil ".kotl"))
(other-file (make-temp-file "hypb" nil ".txt")))
(unwind-protect
@@ -592,7 +589,6 @@ of the defun."
(ert-deftest hui--copy-to-register--yank-in-other-file-other-dir ()
"Yank klink in register into other file in other dir."
- (skip-unless (not noninteractive))
(let* ((kotl-file (make-temp-file "hypb" nil ".kotl"))
(other-dir (make-temp-file "hypb" t))
(other-file (expand-file-name "other-file" other-dir)))
diff --git a/test/hyrolo-tests.el b/test/hyrolo-tests.el
index 3893c4b291..82dd45cddc 100644
--- a/test/hyrolo-tests.el
+++ b/test/hyrolo-tests.el
@@ -47,12 +47,10 @@
(ert-deftest hyrolo-demo-search-work ()
"Use demo example and search for work should match work."
- (skip-unless (not noninteractive))
(unwind-protect
(progn
(load "../hyrolo-demo")
(should (hact 'kbd-key "C-x 4r work RET"))
- (hy-test-helpers:consume-input-events)
(should (string= (buffer-name) hyrolo-display-buffer))
(should (looking-at "======"))
(forward-line 5)
@@ -61,24 +59,20 @@
(ert-deftest hyrolo-demo-tab-jump-to-first-match ()
"{TAB} shall jump to first match."
- (skip-unless (not noninteractive))
(unwind-protect
(progn
(load "../hyrolo-demo")
(should (hact 'kbd-key "C-x 4r work RET TAB"))
- (hy-test-helpers:consume-input-events)
(should (string= (buffer-name) hyrolo-display-buffer))
(should (looking-at "Work")))
(hyrolo-demo-quit)))
(ert-deftest hyrolo-demo-toggle-visibility ()
"Keys {h} and {a} shall toggle visibility."
- (skip-unless (not noninteractive))
(unwind-protect
(progn
(load "../hyrolo-demo")
(should (hact 'kbd-key "C-x 4r work RET TAB"))
- (hy-test-helpers:consume-input-events)
(should (string= (buffer-name) hyrolo-display-buffer))
(should (looking-at "Work"))
@@ -99,17 +93,14 @@
(ert-deftest hyrolo-demo-show-overview ()
"Key {o} shall show overview."
- (skip-unless (not noninteractive))
(unwind-protect
(progn
(load "../hyrolo-demo")
(should (hact 'kbd-key "C-x 4r work RET TAB"))
- (hy-test-helpers:consume-input-events)
(should (string= (buffer-name) hyrolo-display-buffer))
(should (looking-at "work"))
(should (hact 'kbd-key "o"))
- (hy-test-helpers:consume-input-events)
(forward-line 1)
(end-of-line)
(should (get-char-property (point) 'invisible))
@@ -122,12 +113,10 @@
(ert-deftest hyrolo-demo-move-to-beginning-and-end-of-file ()
"*HyRolo* keys {<} and {>} move to begin and end of file, respectively."
- (skip-unless (not noninteractive))
(unwind-protect
(progn
(load "../hyrolo-demo")
(should (hact 'kbd-key "C-x 4r work RET TAB"))
- (hy-test-helpers:consume-input-events)
(should (string= (buffer-name) hyrolo-display-buffer))
(should (looking-at "work"))
@@ -140,32 +129,26 @@
(ert-deftest hyrolo-demo-move-to-beginning-and-end-of-entry ()
"*HyRolo* keys {,} and {.} move to begin and end of an entry, respectively."
- (skip-unless (not noninteractive))
(unwind-protect
(progn
(load "../hyrolo-demo")
(should (hact 'kbd-key "C-x 4r work RET TAB"))
- (hy-test-helpers:consume-input-events)
(should (string= (buffer-name) hyrolo-display-buffer))
(should (hact 'kbd-key "\C-u,n"))
- (hy-test-helpers:consume-input-events)
(should (looking-at "\\*\\*\\s-+Hansen"))
(should (hact 'kbd-key "."))
- (hy-test-helpers:consume-input-events)
(should (looking-at "\\s-?\\*\\*\\*\\s-+Dunn")))
(hyrolo-demo-quit)))
(ert-deftest hyrolo-demo-move-between-entries-on-same-level ()
"Key {n} shall move to the next cell, {f} the next same level cell,
and {b} the previous same level cell."
- (skip-unless (not noninteractive))
(unwind-protect
(progn
(load "../hyrolo-demo")
(should (hact 'kbd-key "C-x 4r com RET TAB"))
- (hy-test-helpers:consume-input-events)
(should (string= (buffer-name) hyrolo-display-buffer))
(should (hact 'kbd-key "<"))
(should (equal (point) (point-min)))
@@ -182,12 +165,10 @@ and {b} the previous same level cell."
(ert-deftest hyrolo-demo-no-following-same-level-heading ()
"Error when trying to move to non existing next level heading."
- (skip-unless (not noninteractive))
(unwind-protect
(progn
(load "../hyrolo-demo")
(should (hact 'kbd-key "C-x 4r com RET TAB"))
- (hy-test-helpers:consume-input-events)
(should (string= (buffer-name) hyrolo-display-buffer))
(should (hact 'kbd-key "<"))
@@ -1349,8 +1330,6 @@ body
(hyrolo-tests--outline-as-string)))
(should (hact 'kbd-key "TAB"))
- (hy-test-helpers:consume-input-events)
- (hy-test-helpers:consume-input-events)
(should (string=
(concat (hyrolo-tests--hyrolo-section-header org-file1)
"* h-org 1\nbody\n** h-org 1.1\nbody\n** h-org
1.2\nbody\n*** h-org 1.2.1\nbody\n* h-org 2...\n")
@@ -1385,7 +1364,6 @@ body
;; (hyrolo-tests--outline-as-string)))
(should (hact 'kbd-key "f TAB"))
- (hy-test-helpers:consume-input-events)
(should (string=
(concat (hyrolo-tests--hyrolo-section-header org-file1)
"* h-org 1\nbody\n** h-org 1.1\nbody\n** h-org
1.2\nbody\n*** h-org 1.2.1\nbody\n* h-org 2\nbody\n** h-org 2.1\nbody\n")
diff --git a/test/hywiki-tests.el b/test/hywiki-tests.el
index a9aa5ac46e..989a5c25da 100644
--- a/test/hywiki-tests.el
+++ b/test/hywiki-tests.el
@@ -877,7 +877,7 @@ body B
(condition-case err-msg
(dolist (w words)
(setq wiki-link (car w)
- expected-str-at-pos (cdr w))
+ expected-str-at-pos (regexp-quote (cdr w)))
(erase-buffer)
(hywiki-tests--insert wiki-link)
(goto-char 4)
@@ -887,6 +887,41 @@ body B
(error (error "'%s', '%s' - Error: %s"
wiki-link expected-str-at-pos err-msg))))))))
+(ert-deftest
hywiki-tests--action-key-moves-to-word-and-section-using-dash-to-space-conversion
()
+ "Verify action key on a WikiWord with section, line and column works.
+Verify dash in the header matches a target with dash replaced by space."
+ (hywiki-tests--preserve-hywiki-mode
+ (let ((words '(("WikiWord#first" . "* first")
+ ("WikiWord#header-one" . "* header one")
+ ("WikiWord#first one" . "* first")
+ ("(WikiWord#header one)" . "* header one")
+ ("WikiWord#header--two" . "* header two")
+ ("(WikiWord#header--three)" . "* header three")
+ ("WikiWord#header---four" . "* header four"))))
+ ;; Setup target WikiWord
+ (with-current-buffer (find-file-noselect wiki-page)
+ (hywiki-tests--insert "\
+* first
+* header one
+* header two
+* header three
+* header four
+")
+ (save-buffer))
+ ;; Create temp buffers with WikiWord links to the target
+ ;; WikiWord page and verify they work.
+ (with-temp-buffer
+ (dolist (w words)
+ (let ((wiki-link (car w))
+ (expected-str-at-pos (regexp-quote (cdr w))))
+ (ert-info ((format "Link: %s Header: %s" wiki-link
expected-str-at-pos))
+ (erase-buffer)
+ (hywiki-tests--insert wiki-link)
+ (goto-char 4)
+ (save-excursion
+ (action-key)
+ (should (looking-at-p expected-str-at-pos))))))))))
+
(defun hywiki-tests--search-section (section)
"Find SECTION in current buffer and return the id string.
Search for elements of type <h?>...</h?> for the id string. Example:
@@ -924,7 +959,7 @@ First line
body A
** Bsection subsection
body B
-*** Csection-subsection
+*** Csection subsection
body C
")
(save-buffer)
@@ -950,7 +985,7 @@ WikiWord#Csection-subsection
(with-current-buffer (find-file-noselect wikiword-html)
(setq idA (should (hywiki-tests--search-section "Asection")))
(setq idB (should (hywiki-tests--search-section "Bsection
subsection")))
- (setq idC (should (hywiki-tests--search-section
"Csection-subsection"))))
+ (setq idC (should (hywiki-tests--search-section "Csection
subsection"))))
;; Verify links are generated
(find-file wikipage-html)
@@ -1793,8 +1828,7 @@ face is verified during the change."
(ert-deftest hywiki-tests--verify-removal-of-delimiter-updates-face ()
"Verify WikiWord highlight face change when adding/removing a delimiter."
(hywiki-tests--preserve-hywiki-mode
- (let ((hywiki-tests--with-face-test t)
- (hi-page (cdr (hywiki-add-page "Hi"))))
+ (let ((hi-page (cdr (hywiki-add-page "Hi"))))
(unwind-protect
(dolist (testcase
'((("\"Hi#a b c\"" . "Hi#a b c") (p3 . "Hi#a b c")
@@ -1808,8 +1842,7 @@ face is verified during the change."
"Verify that a yanked in WikiWord highlights properly."
(hywiki-tests--preserve-hywiki-mode
(let* ((wikiHi (cdr (hywiki-add-page "Hi")))
- (wikiHo (cdr (hywiki-add-page "Ho")))
- (hywiki-tests--with-face-test t))
+ (wikiHo (cdr (hywiki-add-page "Ho"))))
(unwind-protect
(progn
;; Left part of WikiWord yanked in.
@@ -1862,7 +1895,6 @@ face is verified during the change."
"Verify creating a WikiWord-file highlights the WikiWord in another file."
(hywiki-tests--preserve-hywiki-mode
(let* ((wikiHi (cdr (hywiki-add-page "Hi")))
- (hywiki-tests--with-face-test t)
wikiHo)
(unwind-protect
(progn
diff --git a/test/hywiki-yki-tests.el b/test/hywiki-yki-tests.el
index 4beff36960..07b54254ae 100644
--- a/test/hywiki-yki-tests.el
+++ b/test/hywiki-yki-tests.el
@@ -160,13 +160,9 @@ Each test is constructed as three phases:
`buffer-string' as a string is constructed where chars are used for
point, and start and stop of the highlighting with angle brackets.
That is then compared to the expected string."
- (skip-unless (not noninteractive)) ; Only works in interactive mode for
now
(hywiki-tests--preserve-hywiki-mode
- (let* ((hywiki-directory (make-temp-file "hywiki" t))
- (wikiHi (cdr (hywiki-add-page "Hi")))
- (wikiHo (cdr (hywiki-add-page "Ho")))
- (wikiWord (cdr (hywiki-add-page "WikiWord")))
- (hywiki-tests--with-face-test t))
+ (let* ((wikiHi (cdr (hywiki-add-page "Hi")))
+ (wikiHo (cdr (hywiki-add-page "Ho"))))
(cl-flet* ((pre: (start)
(hywiki-test--set-buffer-text-with-point-and-highlight
start))
(exec: (cmd &rest args)
@@ -267,8 +263,7 @@ Each test is constructed as three phases:
(del: "<abc> abc")
(post: "<WikiWord> ^ <WikiWord>")))
- (hy-delete-files-and-buffers (list wikiHi wikiHo wikiWord))
- (hywiki-tests--delete-hywiki-dir-and-buffer hywiki-directory))))))
+ (hy-delete-files-and-buffers (list wikiHi wikiHo)))))))
(provide 'hywiki-yki-tests)
diff --git a/test/kotl-mode-tests.el b/test/kotl-mode-tests.el
index 2672d56e76..81665be41a 100644
--- a/test/kotl-mode-tests.el
+++ b/test/kotl-mode-tests.el
@@ -71,7 +71,6 @@
(ert-deftest kotl-mode-indent-cell-changes-level ()
"Loading kotl-mode example file works."
- (skip-unless (not noninteractive))
(setup-kotl-mode-example-test
(kotl-mode:example temporary-file-directory t)
(kotl-mode:beginning-of-buffer)
@@ -95,7 +94,6 @@
(ert-deftest kotl-mode-set-view-with-kbd ()
"When the view mode is changed the label is changed too."
- (skip-unless (not noninteractive))
(let ((kotl-file (make-temp-file "hypb" nil ".kotl")))
(unwind-protect
(progn
@@ -525,7 +523,6 @@
(ert-deftest kotl-mode-backward-cell-from-invalid-pos-leave-point-in-valid-pos
()
"From invalid pos backward cell leaves point in valid pos on error."
- (skip-unless (not noninteractive))
(let ((kotl-file (make-temp-file "hypb" nil ".kotl")))
(unwind-protect
(progn
@@ -831,7 +828,6 @@ In non interactive mode there shall be no beep (nor
message)"
(ert-deftest kotl-mode-move-up-to-first-line ()
"Move up to first line shall succeed with no beep nor message."
- (skip-unless (not noninteractive))
(let ((kotl-file (make-temp-file "hypb" nil ".kotl")))
(unwind-protect
(progn
@@ -877,7 +873,6 @@ In non-interactive mode there shall be no beep nor message."
(ert-deftest kotl-mode-move-down-to-last-line-shall-not-beep ()
"Moving down to last line shall not beep."
- (skip-unless (not noninteractive))
(let ((kotl-file (make-temp-file "hypb" nil ".kotl")))
(unwind-protect
(progn