Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
2026-06-18 Bob Weiner <rsw@gnu.org>

* test/hibtypes-tests.el (ibtypes::ilink-test): Add and ensure only one
instance of this test.

* hywiki.el (hywiki-include-special-modes): Add to recognize HyWikiWords in
particular special major modes, like eww and elfeed ones.
(hywiki-potential-buffer-p): Use above setting in this function.
Expand Down
6 changes: 4 additions & 2 deletions hactypes.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 23-Sep-91 at 20:34:36
;; Last-Mod: 14-Jun-26 at 16:06:31 by Bob Weiner
;; Last-Mod: 18-Jun-26 at 10:01:03 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
Expand Down Expand Up @@ -587,7 +587,9 @@ on the implicit button to which to link."
(ibut:key-to-label name-key)
key-src))))


;; !! Left over code from an earlier version of `link-to-ibut' in case
;; is ever needed for reference. rsw - 2026-06-18
;;
;; (if key-src
;; (unless (and (get-buffer key-src)
;; (not (hypb:buffer-file-name (get-buffer key-src))))
Expand Down
29 changes: 17 additions & 12 deletions test/hibtypes-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
;; Author: Mats Lidell <matsl@gnu.org>
;;
;; Orig-Date: 20-Feb-21 at 23:45:00
;; Last-Mod: 14-Jun-26 at 15:57:15 by Bob Weiner
;; Last-Mod: 18-Jun-26 at 12:04:02 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
Expand Down Expand Up @@ -373,26 +373,31 @@
;; ilink
(ert-deftest ibtypes::ilink-test ()
"Verify link to ibut in same buffer."
(let ((file (make-temp-file "ilink")))
(let ((file (make-temp-file "ilink-test")))
(unwind-protect
(progn
(find-file file)
(insert "\
<ilink: Button >
<[Button]> <identity \"ARG\">
")
(insert "<ilink: Button1 >\n<[Button1]> <identity 1>")
(goto-char 4)
(should (string= "ARG" (ibtypes::ilink)))
(should (ibtype:test-p 'ilink))
(should (= (ibut:act) 1))

;; ilink with file name
(erase-buffer)
(insert "<[Button2]> <identity 2>")
(save-excursion
(with-temp-buffer
(insert (format "<ilink: Button2:\"%s\">\n" file))
(goto-char 4)
(should (ibtype:test-p 'ilink))
(should (= (ibut:act) 2))))

(erase-buffer)
(insert "\
<ilink: Button >
<[Other]> <identity \"ARG\">
")
(insert "<ilink: Button3 >\n<[Other]> <identity 3>")
(goto-char 4)
(let ((err (should-error (ibtypes::ilink))))
(should
(string-match-p (rx "No button " (any punct) "Button" (any punct) " in")
(string-match-p (rx "No button " (any punct) "Button3" (any punct) " in")
(cadr err)))))
(hy-delete-file-and-buffer file))))

Expand Down