Skip to content
Closed
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
184 changes: 184 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,90 @@
2026-02-01 Mats Lidell <matsl@gnu.org>

* test/hywiki-tests.el (hywiki-tests--save-referent-find-use-menu): Use
hywiki-tests--preserve-hywiki-mode macro and refactor test to utilize that.

2026-01-31 Bob Weiner <rsw@gnu.org>

* hproperty.el (hproperty:char-property-face-p): Rename to
'hproperty:but-face-p' since does not utilize char-properties.
hywiki.el (hywiki-maybe-highlight-region-reference): Use new
function name above.

* hywiki.el: Replace all uses of 'hproperty:char-property-range' with
'hproperty:overlay-range' to avoid interaction with other code
that uses text properties.

* test/hywiki-tests.el (hywiki-tests--command-execute): Force run of
'post-self-insert-hook' when executing a 'self-insert-command'.

* hywiki.el (hywiki-highlight-word-get-range): Fix to highlight only
if within a buffer context where HyWiki words are valid.
(hywiki-word-store-around-point): For insert commands,
capture the 'hywiki--start' position before the insert. Also,
dehighlight a wikiword at point if outside a valid context.
(hywiki-maybe-dehighlight-reference,
hywiki-word-highlight-post-command): Make dehighlight
in non-highlight contexts since an edit may have just made
the context invalid.
(hywiki-non-hook-context-p): Update doc on use with
'post-command-hook' calls.
(hywiki-word-highlight-post-self-insert,
hywiki-word-highlight-post-command): Rewrite so non-hook
context tests are all applied at the proper point.

2026-01-29 Bob Weiner <rsw@gnu.org>

* hywiki.el (hywiki-word-highlight-in-buffers): Change hook depth setting
from 95 to -60 to run these hooks nearly first.

2026-01-25 Bob Weiner <rsw@gnu.org>

* test/hywiki-tests.el (hywiki-tests--filename-same-as-wiki-word): Rewrote
to correct the tests therein.

* hywiki.el (hywiki-potential-buffer-p, hywiki-non-hook-context-p): Comment
out 'edebug-active' checks, so can examine same behavior when edebugging.
(hywiki-word-set-auto-highlighting): Fix to ensure all hywiki
hooks are removed any time 'hywiki-mode' is disabled.

* test/hywiki-tests.el (hywiki-tests--interpolate-buffer): Fix to highlight
any HyWiki word at point and create its page by activating it. This is
separate from processing action buttons.

2026-01-24 Bob Weiner <rsw@gnu.org>

* test/hywiki-tests.el (hywiki-tests--wikiword-identified-in-emacs-lisp-mode,
hywiki-tests--wikiword-identified-in-strings-in-emacs-lisp-mode,
hywiki-tests--wikiword-identified-in-emacs-lisp-mode,
hywiki-tests--filename-same-as-wiki-word,
hywiki-tests--verify-removal-of-delimiter-updates-face,
hywiki-tests--wikiword-yanked-with-extra-words,
hywiki-test--hywiki-mode,
hywiki-tests--interactive-hywiki-mode-toggles):
Remove unneeded calls due to 'hywiki-tests--preserve-hywiki-mode' macro.
(hywiki-tests--verify-removal-of-delimiter-updates-face,
(hywiki-tests--maybe-highlight-page-names): Remove expected fail so can
debug.
(hywiki-tests--nonexistent-wikiword-with-section-should-create-wikiword):
Rewrite.

* hywiki.el (hywiki-active-in-current-buffer-p, hywiki-get-buffers): Fix
minibuffer predicate used to reflect current buffer even if window
not selected. Add and use 'hywiki-potential-buffer-p' to share common
predicates.
(hywiki-get-buffers): Stop filtering out hidden buffers that start
with a space since they may be in a text mode and may be shown in a window.
Also fix usage of 'hywiki-mode-status' argument so is part of the filtering.
(hywiki-in-page-p): Ensure 'buffer-file-name' ends with
'hywiki-file-suffix'.
(hywiki-active-in-current-buffer-p): Fix filtering when 'hywiki-mode'
is :pages.

2026-01-19 Bob Weiner <rsw@gnu.org>

* test/hywiki-tests.el (hywiki-tests--execute-commands): Manually run
'post-self-insert-hook' when appropriate.

2026-01-19 Mats Lidell <matsl@gnu.org>

* test/kotl-mode-tests.el (kotl-mode--delete-region)
Expand All @@ -11,17 +98,114 @@
called with kill-flag. (The latter is implicit when used interactively
with a prefix arg.)

2026-01-18 Bob Weiner <rsw@gnu.org>

* hywiki.el (hywiki--get-all-references): Handle ref ordering diffs between
Emacs prior to 29 and after so callers do not have to handle.

* test/hywiki-tests.el (hywiki-tests--hywiki-face-region-at): Remove, unused.

* hywiki.el (hywiki-highlight-word-get-range): Rename to 'hywiki-word-range-at'.
(hywiki-get-reference-range): Add and use in tests.
(hywiki-word-highlighted-at): Rename to 'hywiki-highlighted-word-at'.

* test/hywiki-tests.el (hywiki-tests--word-n-face-at): Remove and replace
with calls to 'hywiki-highlighted-word-at'.

* hproperty.el (hproperty:char-property-face-p): Fix doc to not refer to HyWiki.
(hproperty:but-is-p): Add.

* test/hywiki-tests.el (hywiki-tests--preserve-hywiki-mode): Fix to use the
actual prior value of 'hywiki-mode' since there are now 3 valid states.
Also setup more of the test scenarios and rewrite tests to not duplicate
this behavior.
(hywiki-tests--face-property-for-wikiword-with-wikipage): Fix this test.

* test/hywiki-yki-tests.el (hywiki-test--set-buffer-text-with-point-and-highlight):
For clarity change 'hywiki-mode' arg from 1 to :all and move before
'erase-buffer' call.

2026-01-12 Bob Weiner <rsw@gnu.org>

* hywiki.el: (hywiki-word-highlight-in-buffers, hywiki-word-highlight-in-frame):
Add to support window-change-based HyWikiWord highlighting.

2026-01-11 Bob Weiner <rsw@gnu.org>

* test/hsys-org-tests.el (hsys-org:org-link-at-p): Fix 4th test
by ensuring hywiki-mode is off.

2026-01-07 Mats Lidell <matsl@gnu.org>

* hywiki.el (hywiki-mode): Remove arg value :toggle, not an alternative to
'toggle.

* test/hywiki-tests.el (hywiki-test--hywiki-mode): Add test for hywiki-mode.

2026-01-06 Bob Weiner <rsw@gnu.org>

* hywiki.el (hywiki-get-buffers-in-windows): Add and call in
'hywiki-get-buffers'.

2026-01-05 Bob Weiner <rsw@gnu.org>

* hibtypes.el (hywiki-word): Move from "hywiki.el" to here.

* hyperbole.el: Add (require 'hywiki).
(hyperb:init): (hywiki-mode :pages) at the end.

2026-01-02 Bob Weiner <rsw@gnu.org>

* hywiki.el (hywiki-maybe-highlight-page-names): Rename to
'hywiki-maybe-highlight-references'.
(hywiki-maybe-highlight-page-name): Rename to
'hywiki-maybe-highlight-reference'.
(hywiki-maybe-highlight-between-page-names): Rename to
'hywiki-maybe-highlight-between-references'.
(hywiki-maybe-highlight-off-page-name): Rename to
'hywiki-maybe-highlight-off-reference'.
(hywiki-maybe-highlight-on-page-name): Rename to
'hywiki-maybe-highlight-on-reference'.
(hywiki-maybe-highlight-word): Rename to
'hywiki-maybe-highlight-region-reference'.
(hywiki-maybe-dehighlight-page-names): Rename to
'hywiki-maybe-dehighlight-references'.
(hywiki-maybe-dehighlight-between-page-names): Rename to
'hywiki-maybe-dehighlight-between-references'.
(hywiki-maybe-dehighlight-off-page-name): Rename to
'hywiki-maybe-dehighlight-off-reference'.
(hywiki-maybe-dehighlight-on-page-name): Rename to
'hywiki-maybe-dehighlight-on-reference'.
(hywiki-maybe-dehighlight-page-name): Rename to
'hywiki-maybe-dehighlight-reference'.

2025-12-31 Mats Lidell <matsl@gnu.org>

* Remove starting asterix from defcustom variable docstrings.

2025-12-30 Bob Weiner <rsw@gnu.org>

* hywiki.el (hywiki-get-buffers): Add to return active hywiki-mode buffers.
(hywiki-word-set-auto-highlighting): Rewrite to account for 'hywiki-mode'
setting before and after this call. Apply highlighting hooks locally
to each buffer. Remove interactive use.
(hywiki-word-highlight-buffers, hywiki-word-dehighlight-buffers): Add and use in above function.

2025-12-27 Bob Weiner <rsw@gnu.org>

* hywiki.el (hywiki-word-highlight-flag, hywiki-word-highlight-flag-changed): Remove.
(hywiki-mode, hywiki-in-page-p): Remove 'hywiki-word-highlight-flag' and
update to support` all 'hywiki-mode' values.
(hywiki-maybe-dehighlight-sexp):
(hywiki-active-in-current-buffer-p):
(hywiki-word-set-auto-highlighting): Replace 'hywiki-word-highlight-flag'
with 'hywiki-mode'.
test/hywiki-tests.el (hywiki-tests--active-in-current-buffer-p): Change let of
'hywiki-mode' to function call to set the minor mode.

* hibtypes.el (hywiki-existing-word):
hywiki.el (hywiki-word): Skip if not 'hywiki-active-in-current-buffer-p'.

2025-12-25 Mats Lidell <matsl@gnu.org>

* hywiki.el (hywiki--preparation-function, hywiki--completion-function)
Expand Down
49 changes: 36 additions & 13 deletions hibtypes.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 19-Sep-91 at 20:45:31
;; Last-Mod: 22-Nov-25 at 12:40:34 by Bob Weiner
;; Last-Mod: 5-Jan-26 at 23:42:19 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
Expand Down Expand Up @@ -108,8 +108,28 @@
;;; Creates and displays personal wiki pages and sections with auto-wikiword links
;;; ========================================================================

;; Defines `hywiki-word' ibtype
(load "hywiki" nil t)
(defib hywiki-word ()
"When on a non-existing HyWikiWord, create it and display its referent.
A call to (hywiki-active-in-current-buffer-p) must return non-nil
for this to activate.

If the associated HyWiki referent is a page, create it automatically
unless it is the first HyWiki page to be created, in which case,
prompt the user whether to create it, to prevent any unexpected HyWiki
use.

Existing HyWikiWords are handled by the implicit button type
`hywiki-existing-word'."
(when (hywiki-active-in-current-buffer-p)
(let* ((wikiword-start-end (hywiki-highlight-word-get-range))
(wikiword (nth 0 wikiword-start-end))
(start (nth 1 wikiword-start-end))
(end (nth 2 wikiword-start-end)))
(when wikiword
(unless (or (ibtypes::pathname-line-and-column)
(ibtypes::pathname))
(ibut:label-set wikiword start end)
(hact 'hywiki-word-create-and-display wikiword))))))

;;; ========================================================================
;;; Jumps to source line from Python traceback lines
Expand Down Expand Up @@ -1713,25 +1733,28 @@ If a boolean function or variable, display its value."
(error "(action:help): No action button labeled: %s" label)))))

;;; ========================================================================
;;; Activates HyWikiWords with existing HyWiki pages.
;;; Activates HyWikiWords with existing referents.
;;; Non-existing HyWikiWords are handled by the (load "hywiki") at a low
;;; priority earlier in this file which defines the `hywiki-word' ibtype.
;;; ========================================================================

(defib hywiki-existing-word ()
"On a HyWikiWord with an existing referent, display the referent.
A call to (hywiki-active-in-current-buffer-p) must return non-nil
for this to activate.

See the implicit button type `hywiki-word' for creation of referents to
not yet existing HyWikiWords."
(cl-destructuring-bind (wikiword start end)
(hywiki-referent-exists-p :range)
(when wikiword
(unless (or (ibtypes::pathname-line-and-column)
(ibtypes::pathname))
(if (and start end)
(ibut:label-set wikiword start end)
(ibut:label-set wikiword))
(hact 'hywiki-find-referent wikiword)))))
(when (hywiki-active-in-current-buffer-p)
(cl-destructuring-bind (wikiword start end)
(hywiki-referent-exists-p :range)
(when wikiword
(unless (or (ibtypes::pathname-line-and-column)
(ibtypes::pathname))
(if (and start end)
(ibut:label-set wikiword start end)
(ibut:label-set wikiword))
(hact 'hywiki-find-referent wikiword))))))

;;; ========================================================================
;;; Inserts completion into minibuffer or other window.
Expand Down
25 changes: 13 additions & 12 deletions hproperty.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 21-Aug-92
;; Last-Mod: 31-Dec-25 at 16:02:19 by Mats Lidell
;; Last-Mod: 31-Jan-26 at 22:44:11 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
Expand All @@ -14,7 +14,7 @@

;;; Commentary:
;;
;; Can't use read-only buttons here because then outline-mode
;; Can't use read-only buttons here because then `outline-mode'
;; becomes unusable.

;;; Code:
Expand All @@ -28,12 +28,13 @@
;;; ************************************************************************

(declare-function hattr:get "hbut")
(declare-function hbut:is-p "hbut")
(declare-function ibut:map "hbut")
(declare-function ebut:map "hbut")

;; Comment out next line out because this triggers loads of kview
;; which loads klink which contains a defib whose priority should be set
;; by loading klink from hibtypes.el instead.
;; Comment out next line out because this loads kview which loads
;; klink which contains a defib whose priority should be set by
;; loading klink from hibtypes.el instead.
;; (eval-when-compile (require 'hyrolo))

;;; ************************************************************************
Expand Down Expand Up @@ -244,6 +245,12 @@ moves over it."
See `hproperty:but-get'."
(overlay-end hproperty-but))

(defun hproperty:but-face-p (pos face-list)
"At POS, return non-nil if find any face in FACE-LIST, else nil."
(save-excursion
(goto-char pos)
(seq-intersection (face-at-point nil t) face-list #'eq)))

(defun hproperty:but-flash ()
"Flash a Hyperbole button at or near point to indicate selection."
(interactive)
Expand Down Expand Up @@ -324,6 +331,7 @@ Return nil if none."
(overlays-in start end))
nil))

(defalias 'hproperty:but-is-p 'hbut:is-p)
(defun hproperty:but-move (hproperty-but start end &optional buffer)
"Set the endpoints of HPROPERTY-BUT to START and END in optional BUFFER.
If BUFFER is nil and HPROPERTY-BUT has no buffer, put it in the current buffer;
Expand Down Expand Up @@ -370,13 +378,6 @@ See `hproperty:but-get'."
(and (listp val) (memq value val)))
value)))

(defun hproperty:char-property-face-p (pos face-list)
"At POS, skip HyWikiWord highlighting if find any face in FACE-LIST.
Return non-nil in any such case, else nil."
(save-excursion
(goto-char pos)
(seq-intersection (face-at-point nil t) face-list #'eq)))

(defun hproperty:char-property-start (pos property value)
"From POS, return the start of text PROPERTY with VALUE overlapping POS.
Otherwise, return nil. Value must be a symbol."
Expand Down
Loading
Loading