Skip to content
Open
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
145 changes: 145 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,14 +1,159 @@
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-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
15 changes: 8 additions & 7 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: 18-Jan-26 at 12:04:29 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 @@ -324,6 +325,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 @@ -371,8 +373,7 @@ See `hproperty:but-get'."
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."
"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)))
Expand Down
28 changes: 20 additions & 8 deletions hsys-activities.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
;; Author: Mats Lidell
;;
;; Orig-Date: 7-Dec-25 at 22:48:29
;; Last-Mod: 11-Dec-25 at 22:26:21 by Mats Lidell
;; Last-Mod: 2-Jan-26 at 21:31:06 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
Expand All @@ -28,8 +28,15 @@
;;; Requirements
;;; ************************************************************************

(hypb:require-package 'activities)
(require 'hypb)

(add-hook 'activities-tabs-mode-hook
(lambda ()
(when activities-tabs-mode
(advice-remove #'activities-resume #'activities-tabs-before-resume)
(advice-add #'hsys-activities-before-resume :before #'activities-tabs-before-resume))))

;;; ************************************************************************
;;; Public declarations
;;; ************************************************************************
Expand All @@ -55,27 +62,32 @@
- If activity NAME is not active, switch to its latest state.
- If activity NAME is active and current, revert to its default state.
- If activity NAME is active and hsys-activity is called with
`current-prefix-arg' set then set the default state."
`current-prefix-arg', then update the default state."
(interactive (list (completing-read "Activity: " (activities-names) nil nil)))
(hypb:require-package 'activities)
(let ((activity (activities-named name)))
(cond ((not activity)
(activities-define name)
(message "Activity %s defined." name))
(message "Activity %s defined" name))
((let ((current-activity (activities-current)))
(and current-activity
(string=
(string-equal
(activities-name-for activity)
(activities-name-for current-activity))))
(if current-prefix-arg
(progn
(activities-define name :forcep t)
(message "Activity %s set to new default." name))
(message "Activity %s set to new default" name))
(activities-revert activity)
(message "Activity %s reverted." name)))
(message "Activity %s reverted" name)))
(t
(activities-resume activity)
(message "Activity %s resumed." name)))))
(message "Activity %s resumed" name)))))

(defun hsys-activities-before-resume (activity)
(if (and activities-tabs-mode
(tab-switcher-current-tab nil))
(activities-revert activity)
(activities-resume activity)))

(provide 'hsys-activities)
;;; hsys-activities.el ends here
6 changes: 3 additions & 3 deletions hynote.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 23-Jun-24 at 12:50:37
;; Last-Mod: 1-Jan-26 at 18:19:13 by Mats Lidell
;; Last-Mod: 18-Jan-26 at 08:29:26 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
Expand Down Expand Up @@ -105,7 +105,7 @@ After successfully finding a file and reading it into a buffer, run
(when (and (stringp section) (not (string-prefix-p "#" section)))
(setq section (concat "#" section)))
(hpath:find (concat file section))
(hywiki-maybe-highlight-page-names)
(hywiki-maybe-highlight-references)
(run-hooks 'hynote-find-file-hook)
file))

Expand All @@ -126,7 +126,7 @@ After successfully finding a file and reading it into a buffer, run
(substring file-stem-name (match-beginning 0))))
(when file
(hpath:find (concat file section))
(hywiki-maybe-highlight-page-names)
(hywiki-maybe-highlight-references)
(run-hooks 'hynote-find-file-hook)
file)))))

Expand Down
Loading