Skip to content
Merged
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
38 changes: 38 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,41 @@
2026-06-27 Bob Weiner <rsw@gnu.org>

* man/hyperbole.texi (Smart Key - Hyperbole Buttons): Cross-reference
how to add ibtype help functions.

* hywiki.el (hywiki-word-highlight-post-command): Fix to add support
for WikiWord rehighlighting after a capitalize, downcase or upcase
command.

2026-06-26 Bob Weiner <rsw@gnu.org>

* hmouse-drv.el (hkey-help): Suppress generic Assist Key doc when
ibut has its own :help function.

* hibtypes.el (hywiki-word:help): Add to to dispatch for creating a
HyWikiWord with prompting for its reference type or displaying
help for the potential WikiWord ibtype.

* hywiki.el (hywiki-add-page): Fix so 'page-in-hasht' is t only if ref
type is a page, not some other type.
(hywiki-word-dehighlight-in-buffers): Fix so does not move
point in any of these buffers.
(hywiki-referent-menu): Change title from 'HyWiki Add>' to
'HyWiki RefType>' to match that used in 'hywiki-create-referent'.
(hywiki-add-spec): Add this autoloaded command that
lets you create a HyWikiWord but defer deciding on its type until
it is activated with the Action Key.
(hywiki-display-spec): Add to transform spec to a standard
HyWiki referent.
(hywiki-referent-menu): Change "Sexp" to "Elisp" and add in
"Spec".
(hywiki-display-sexpression): Make obsolete; replace with
'hywiki-display-elisp'.
(hywiki-add-sexpression): Replace with 'hywiki-add-elisp'.
(hywiki-add-elisp, hywiki-display-elisp): Add.
man/hyperbole.texi (HyWiki Menu): Add doc on referent types that when
activated aare given the WikiWord as an argument.

2026-06-25 Bob Weiner <rsw@gnu.org>

* hasht.el (hash-merge-values): Remove ordered result requirement to allow
Expand Down
43 changes: 40 additions & 3 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: 14-Jun-26 at 15:13:01 by Bob Weiner
;; Last-Mod: 27-Jun-26 at 18:36:25 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
Expand Down Expand Up @@ -115,8 +115,9 @@

(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.
This is the Action Key function that activates HyWikiWords. 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,
Expand All @@ -136,6 +137,40 @@ Existing HyWikiWords are handled by the implicit button type
(ibut:label-set wikiword start end)
(hact 'hywiki-word-create-and-display wikiword))))))

(defun hywiki-word:help (ibut)
"Dispatch to desired HyWikiWord Assist Key function based on prefix arg.

This table summarizes the function run for each prefix argument:
|--------------------------------------+-------------------------------------|
| Function | Key Binding |
|--------------------------------------+-------------------------------------|
| 1. Set Referent Type and Display | {M-0 M-RET} or {C-u C-u M-RET} |
| 2. Create a WikiWord Spec | {M-1 M-RET} or {M-0 M-RET s} |
| (Set Referent on Activation) | |
| 3. Show Assist Key Help for WikiWord | {C-u M-RET} or any other prefix arg |
|--------------------------------------+-------------------------------------|

#1 prompts for a referent type, creates and displays the wikiword's
referent. With an Assist Key press on a non-existing wikiword, it prompts
for its wikiword referent type, then creates and displays it. A call
to (hywiki-active-in-current-buffer-p) must return non-nil for this to
activate.

#2 creates a wikiword spec that when activated via the Action Key with
{M-RET} prompts for and replaces the spec with the chosen referent type
and associated attributes (it follows the procedure in #2 above).

#3 shows the wikiword attributes and this doc string."
(pcase current-prefix-arg
((or '(16) 0) (hywiki-word-create-and-display
(ibut:key-to-label (hattr:get ibut 'lbl-key))
t))
(1 (let ((wikiword (ibut:key-to-label (hattr:get ibut 'lbl-key))))
(hywiki-add-spec wikiword)
(hywiki-message-spec wikiword)))
;; Any other prefix arg, show wikiword attributes and the doc string.
(_ (hkey-help t))))

;;; ========================================================================
;;; Jumps to source line from Python traceback lines
;;; ========================================================================
Expand Down Expand Up @@ -1809,6 +1844,8 @@ not yet existing HyWikiWords."
(ibut:label-set wikiword))
(hact 'link-to-wikiword wikiword))))))

(defalias 'hywiki-existing-word:help 'hywiki-word:help)

;;; ========================================================================
;;; Inserts completion into minibuffer or other window.
;;; ========================================================================
Expand Down
78 changes: 41 additions & 37 deletions hmouse-drv.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 04-Feb-90
;; Last-Mod: 25-Jun-26 at 08:53:26 by Bob Weiner
;; Last-Mod: 26-Jun-26 at 12:36:25 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
Expand Down Expand Up @@ -1146,7 +1146,14 @@ documentation is found."
(setq hkey-help-msg
(if (and cmd-sym (symbolp cmd-sym))
(progn
(let* ((condition (car hkey-form))
(let* ((actype (or (actype:elisp-symbol
(hattr:get 'hbut:current 'actype))
(hattr:get 'hbut:current 'actype)))
(assist-function-flag (and assisting
(symbolp actype)
(fboundp actype)
(documentation actype)))
(condition (car hkey-form))
(temp-buffer-show-hook
(lambda (buf)
(set-buffer buf)
Expand All @@ -1171,10 +1178,8 @@ documentation is found."

;; Print Hyperbole button attributes
(when (memq cmd-sym '(hui:hbut-act hui:hbut-help))
(let* ((actype (or (actype:elisp-symbol (hattr:get 'hbut:current 'actype))
(hattr:get 'hbut:current 'actype)))
;; (lbl-key (hattr:get 'hbut:current 'lbl-key))
(categ (hattr:get 'hbut:current 'categ))
(let* ;; (lbl-key (hattr:get 'hbut:current 'lbl-key))
((categ (hattr:get 'hbut:current 'categ))
(attributes (nthcdr 2 (hattr:list 'hbut:current)))
(but-def-symbol (htype:def-symbol
(if (eq categ 'explicit) actype categ)))
Expand Down Expand Up @@ -1227,9 +1232,7 @@ documentation is found."
(replace-regexp-in-string
"^" " " (documentation type-help-func)
nil t))))
(when (and (symbolp actype)
(fboundp actype)
(documentation actype))
(when assist-function-flag
(princ (format "\n%s ACTION KEY SPECIFICS:\n%s\n"
(or (actype:def-symbol actype) actype)
(replace-regexp-in-string "^" " " (documentation actype)
Expand All @@ -1252,34 +1255,35 @@ documentation is found."
nil t))))
(terpri))))

(princ (format "A %s of the %s %sKey"
(if mouse-flag
(if mouse-drag-flag "drag" "click")
"press")
(if assisting "Assist" "Action")
(if mouse-flag "Mouse " "")))
(terpri)
(princ "WHEN ")
(princ
(or condition
"there is no matching context"))
(terpri)

(mapc (lambda (c)
(when (and (> (length calls) 1)
(not (eq (car calls) c)))
;; Is an 'or' set of calls
(princ "OR "))
(princ "CALLS ") (princ (if (consp c) c (list c)))
(when (and (fboundp (setq call (if (consp c) (car c) c)))
(setq doc (documentation call)))
(princ " WHICH")
(princ (if (string-match "\\`[a-zA-Z]*[a-rt-zA-RT-Z]+s[ [:punct:]]" doc)
":" " WILL:"))
(terpri) (terpri)
(princ (replace-regexp-in-string "^" " " doc nil t))
(terpri) (terpri)))
calls)))
(unless assist-function-flag
(princ (format "A %s of the %s %sKey"
(if mouse-flag
(if mouse-drag-flag "drag" "click")
"press")
(if assisting "Assist" "Action")
(if mouse-flag "Mouse " "")))
(terpri)
(princ "WHEN ")
(princ
(or condition
"there is no matching context"))
(terpri)

(mapc (lambda (c)
(when (and (> (length calls) 1)
(not (eq (car calls) c)))
;; Is an 'or' set of calls
(princ "OR "))
(princ "CALLS ") (princ (if (consp c) c (list c)))
(when (and (fboundp (setq call (if (consp c) (car c) c)))
(setq doc (documentation call)))
(princ " WHICH")
(princ (if (string-match "\\`[a-zA-Z]*[a-rt-zA-RT-Z]+s[ [:punct:]]" doc)
":" " WILL:"))
(terpri) (terpri)
(princ (replace-regexp-in-string "^" " " doc nil t))
(terpri) (terpri)))
calls))))
"")
(message "No %s Key command for current context."
(if assisting "Assist" "Action"))))
Expand Down
Loading