[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/hyperbole 9e4862fc4f 3/7: Add HyWikiWord highlighting o
From: |
ELPA Syncer |
Subject: |
[elpa] externals/hyperbole 9e4862fc4f 3/7: Add HyWikiWord highlighting only when not already highlighted |
Date: |
Wed, 31 Jul 2024 03:58:25 -0400 (EDT) |
branch: externals/hyperbole
commit 9e4862fc4f76d29bc460fd98c5a022bc50e6e258
Author: bw <rsw@gnu.org>
Commit: bw <rsw@gnu.org>
Add HyWikiWord highlighting only when not already highlighted
---
ChangeLog | 3 +++
hproperty.el | 14 +++++++++-----
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 42150229d2..e47deb3513 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+* hproperty.el (hproperty:but-add): Add a button only when a button with the
same property
+ value, start, and end does not already exist, to prevent duplicates.
+
* hibtypes.el (Info-node): Handle decoding of Info node names in
Hyperbole Help buffer lbl-key: lines, eliminating excess underscores.
diff --git a/hproperty.el b/hproperty.el
index 2a34918c23..11fad38c95 100644
--- a/hproperty.el
+++ b/hproperty.el
@@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 21-Aug-92
-;; Last-Mod: 29-Jun-24 at 18:57:42 by Bob Weiner
+;; Last-Mod: 28-Jul-24 at 23:58:16 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -150,14 +150,18 @@ This is shown when hovering over the button with the
mouse."
(defun hproperty:but-add (start end face)
"Add between START and END a button using FACE in current buffer.
+Button is added only if it does not already exist.
If `hproperty:but-emphasize-flag' is non-nil when this is called,
emphasize that button is selectable whenever the mouse cursor
moves over it."
- (let ((but (make-overlay start end nil t)))
- (overlay-put but 'face face)
- (when hproperty:but-emphasize-flag
- (overlay-put but 'mouse-face 'highlight))))
+ (let ((but (hproperty:but-get start 'face face)))
+ (unless (and but (eq start (hproperty:but-start but))
+ (eq end (hproperty:but-end but)))
+ (setq but (make-overlay start end nil t))
+ (overlay-put but 'face face)
+ (when hproperty:but-emphasize-flag
+ (overlay-put but 'mouse-face 'highlight)))))
(defun hproperty:but-clear (&optional pos property value)
"Remove highlighting from any named Hyperbole button at point or POS.
- [elpa] externals/hyperbole updated (9ee1f8ea12 -> 2d2112713d), ELPA Syncer, 2024/07/31
- [elpa] externals/hyperbole ec0236813f 2/7: Add `help-mode' to `smart-lisp-mode-p' predicate, ELPA Syncer, 2024/07/31
- [elpa] externals/hyperbole bcc6ebd031 4/7: Highlight [HyWikiWord], <HyWikiWord>, not [[HyWikiWord]], <<HyWikiWord>>, ELPA Syncer, 2024/07/31
- [elpa] externals/hyperbole 9e4862fc4f 3/7: Add HyWikiWord highlighting only when not already highlighted,
ELPA Syncer <=
- [elpa] externals/hyperbole 2d2112713d 7/7: Merge pull request #565 from rswgnu/rsw, ELPA Syncer, 2024/07/31
- [elpa] externals/hyperbole d977223650 6/7: Fix hsys-org tag handling test, ELPA Syncer, 2024/07/31
- [elpa] externals/hyperbole f89d3b4677 5/7: Merge branch 'master' into rsw, ELPA Syncer, 2024/07/31
- [elpa] externals/hyperbole b8687ce867 1/7: Remove # function quoting from derived-mode-p argument, ELPA Syncer, 2024/07/31