branch: externals/hyperbole commit 70fe668600c2505837183ceb3100edf9e7a3f660 Author: bw <r...@gnu.org> Commit: bw <r...@gnu.org>
hywiki-maybe-highlight-page-name - Fix dehilight of nums in WikiWord --- ChangeLog | 6 ++++++ hywiki.el | 15 ++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 108878b68a..1324ae46e7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2024-11-19 Bob Weiner <r...@gnu.org> + +* hywiki.el (hywiki-maybe-highlight-page-name): Fix that adding + numbers to the middle of a HyWikiWord did not dehighlight it; + see updates at the end of this function. + 2024-11-18 Bob Weiner <r...@gnu.org> * hactypes.el (require): Remove require of 'man' and do it only in diff --git a/hywiki.el b/hywiki.el index 6f6e232ce8..0d4572489b 100644 --- a/hywiki.el +++ b/hywiki.el @@ -3,7 +3,7 @@ ;; Author: Bob Weiner ;; ;; Orig-Date: 21-Apr-24 at 22:41:13 -;; Last-Mod: 17-Nov-24 at 15:56:48 by Bob Weiner +;; Last-Mod: 19-Nov-24 at 00:21:19 by Bob Weiner ;; ;; SPDX-License-Identifier: GPL-3.0-or-later ;; @@ -1293,10 +1293,15 @@ the current page unless they have sections attached." ;; Remove any potential earlier highlighting since the ;; previous word may have changed. (skip-syntax-backward "^-$()<>._\"\'") - (when (and hywiki--start hywiki--end) - (hproperty:but-clear-all-in-list - (hproperty:but-get-all-in-region hywiki--start hywiki--end - 'face hywiki-word-face)))))))))) + (if (setq hywiki--buts (hproperty:but-get-all-in-region + (point) (1+ (point)) 'face hywiki-word-face)) + (if (> (length hywiki--buts) 1) + (hproperty:but-clear-all-in-list hywiki--buts) + ;; There is only one existing button + (setq hywiki--buts (car hywiki--buts) + hywiki--but-start (hproperty:but-start hywiki--buts) + hywiki--but-end (hproperty:but-end hywiki--buts)) + (hproperty:but-delete hywiki--buts)))))))))) (defun hywiki-maybe-highlight-between-page-names () "Highlight any non-Org link HyWiki page#section names between point.