emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/hyperbole f2b98683ef 18/18: Merge pull request #612 fro


From: ELPA Syncer
Subject: [elpa] externals/hyperbole f2b98683ef 18/18: Merge pull request #612 from rswgnu/rsw
Date: Tue, 19 Nov 2024 03:58:29 -0500 (EST)

branch: externals/hyperbole
commit f2b98683ef86cc6464fbff59f9ae07e69999a943
Merge: f7edef655f 30cf230e02
Author: Robert Weiner <rsw@gnu.org>
Commit: GitHub <noreply@github.com>

    Merge pull request #612 from rswgnu/rsw
    
    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  <rsw@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  <rsw@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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]