[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/hyperbole 7670cfb36a 3/6: hibtypes.el - Add new 'hywiki
From: |
ELPA Syncer |
Subject: |
[elpa] externals/hyperbole 7670cfb36a 3/6: hibtypes.el - Add new 'hywiki-existing-word' ibtype |
Date: |
Mon, 19 Aug 2024 03:58:19 -0400 (EDT) |
branch: externals/hyperbole
commit 7670cfb36a484d6543f2e393f94c5329a716f880
Author: bw <rsw@gnu.org>
Commit: bw <rsw@gnu.org>
hibtypes.el - Add new 'hywiki-existing-word' ibtype
Separates handling of this from HyWikiWords that don't yet have pages.
---
ChangeLog | 7 +++++++
hibtypes.el | 15 +++++++++++++++
2 files changed, 22 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 59f383b6bc..38dfe0dc68 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-08-18 Bob Weiner <rsw@gnu.org>
+
+* hibtypes.el (hywiki-existing-word): Add this new ibtype to match to
+ HyWikiWords with an existing page at a higher priority than those
+ without an existing page, so can be handled separately. Must be
+ defined in this file to set its priority at a high level.
+
* hywiki.el (hywiki-is-wikiword): Rename to 'hywiki-word-is-p'.
(hywiki-word-activate , hywiki-page-strip-section,
hywiki-page-exists-p): Add.
diff --git a/hibtypes.el b/hibtypes.el
index 78742fa0da..781ac4ee56 100644
--- a/hibtypes.el
+++ b/hibtypes.el
@@ -1632,6 +1632,21 @@ If a boolean function or variable, display its value."
(apply #'actype:eval actype args)))
(error "(action:help): No action button labeled: %s" label)))))
+;;; ========================================================================
+;;; Activates HyWikiWords with existing HyWiki pages.
+;;; 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 ()
+ "When on a HyWiki word with an existing page, display its page and optional
section."
+ (cl-destructuring-bind (page-name start end)
+ (hywiki-page-exists-p 'range)
+ (when page-name
+ (when (and start end)
+ (ibut:label-set page-name (match-beginning 0) (match-end 0)))
+ (hact 'hywiki-find-page page-name))))
+
;;; ========================================================================
;;; Inserts completion into minibuffer or other window.
;;; ========================================================================
- [elpa] externals/hyperbole updated (12c4a31a82 -> 8fa9e4e198), ELPA Syncer, 2024/08/19
- [elpa] externals/hyperbole e6d8488fe6 2/6: hywiki.el - Add new helper functions and rename some, ELPA Syncer, 2024/08/19
- [elpa] externals/hyperbole 8fa9e4e198 6/6: Merge pull request #578 from rswgnu/rsw, ELPA Syncer, 2024/08/19
- [elpa] externals/hyperbole 7670cfb36a 3/6: hibtypes.el - Add new 'hywiki-existing-word' ibtype,
ELPA Syncer <=
- [elpa] externals/hyperbole 53f757ce03 5/6: hywiki.el (hywiki-maybe-at-wikiword-beginning): Handle opening [, ELPA Syncer, 2024/08/19
- [elpa] externals/hyperbole 38d10c8277 1/6: Hyperbole HyWiki Menu - fix Org M-RET menu; expand Help contexts, ELPA Syncer, 2024/08/19
- [elpa] externals/hyperbole 70ca1ea327 4/6: Merge branch 'master' into rsw, ELPA Syncer, 2024/08/19