Skip to content

Conversation

@matsl
Copy link
Collaborator

@matsl matsl commented Feb 2, 2026

What

Request to merge on master branch instead of rsw. Should be same as
#849 (after rebase with rsw at the time) with an update of the ChangeLog.

Why

rsw branch was merged to master so work continues here.

Includes further improvements. More tests are working now.

I also rolled back to the previous version of hywiki-tests--word-at
and changed it so that if hywiki-word-at finds a wikiword then if we test
highlighting hywiki-highligted-word-at must also find a wikiword.
So that not missing highlighting indicates there is no wikiword.

That rollback causes a test to fail. I think this points to a problem
in hywiki rather than in the test, I can reproduce manually,
so I have marked it as expected failed.


(ert-deftest hywiki-tests--wikiword-identified-in-emacs-lisp-mode ()
"Verify WikiWord is identified when surrounded by delimiters in `emacs-lisp-mode'."
:expected-result :failed
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the test case that fails.

With hywiki-mode :all and WikiWord page created this in emacs-lisp-mode below

;; [[WikiWord]]

There WikiWord is not highlighted but hywiki-word-at says it is a WikiWord. Is that the expected behavior? It seems wrong. It can be reproduced manually.

Ideally tests with or without face check should behave the same.

"Choose what test to perform based on value of `hywiki-tests--with-face-test'."
(let* ((range (hywiki-word-at :range)))
(when (hywiki-get-referent (car range))
(when (and range hywiki-tests--with-face-test)
Copy link
Collaborator Author

@matsl matsl Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The range check is not needed here since we must have a range for hywiki-get-referent to be non nil.
Removed it since I had to rebase.

(when (and range hywiki-tests--with-face-test)
(save-excursion
(goto-char (round (/ (+ (cadr range) (caddr range)) 2.0)))
(should (equal range (hywiki-highlighted-word-at :range)))))
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we verify that the highlighted range is the same as what is returned by hywiki-word-at. Point is though adjusted to be within the range since hywiki-word-at does accept point to be outside of the range and still finds the wikiword.

@matsl
Copy link
Collaborator Author

matsl commented Feb 8, 2026

Closed for rework! ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant