branch: externals/hyperbole
commit 38d10c827788668c44832856a5beafb67d7826b0
Author: bw <r...@gnu.org>
Commit: bw <r...@gnu.org>

    Hyperbole HyWiki Menu - fix Org M-RET menu; expand Help contexts
    
    Use new 'hywiki-word-activate' as Act menu item.
---
 ChangeLog    |  9 +++++++++
 hui-menu.el  | 14 +++++++-------
 hui-mini.el  | 11 ++++++-----
 hui-mouse.el |  3 +--
 hywiki.el    | 14 +++++++++++++-
 5 files changed, 36 insertions(+), 15 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3b682e3b32..f3112ce5eb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+  hui-mini.el (hui:menus): Change "Act" item from 'hui:ibut-act' to
+    new 'hywiki-word-activate'.
+
+* hui-menu.el (infodock-hyperbole-menu):
+  hui-mini.el (HyWiki, IButton): Change help function from 'hui:hbut-help'
+    to 'hkey-help' so handles more contexts without erroring.
+
+* hui-menu.el (hui-menu-org-meta-return-options): Remove wrong extra parens.
+
 2024-08-17  Bob Weiner  <r...@gnu.org>
 
 * hui-mini.el (hui:menus): Org-M-RET/ Customization menu, add doc to items
diff --git a/hui-menu.el b/hui-menu.el
index cf19c8c443..799ee50486 100644
--- a/hui-menu.el
+++ b/hui-menu.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:    28-Oct-94 at 10:59:44
-;; Last-Mod:     17-Aug-24 at 17:44:53 by Bob Weiner
+;; Last-Mod:     18-Aug-24 at 15:33:29 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -210,7 +210,7 @@ Return t if cutoff, else nil."
          t))
 
 (defconst hui-menu-org-meta-return-options
-  '(("Org-M-RETURN"
+  '("Org-M-RETURN"
      "----"
      "----"
      ["All-Programmed-Contexts"
@@ -224,7 +224,7 @@ Return t if cutoff, else nil."
      ["Ignored-by-Hyperbole"
       (customize-save-variable 'hsys-org-enable-smart-keys nil)
       :style radio :selected (when (boundp 'hsys-org-enable-smart-keys)
-                              (eq hsys-org-enable-smart-keys nil))]))
+                              (eq hsys-org-enable-smart-keys nil))])
   "Settings for Hyperbole Smart Key overrides to {M-RET} within Org mode.")
 
 (defconst hui-menu-options
@@ -450,16 +450,16 @@ REBUILD-FLAG is non-nil, in which case the menu is 
rebuilt."
                 (list "HyWiki"
                       ["Manual"   (id-info "(hyperbole)HyWiki") t]
                       "----"
-                      ["Activate"           hui:ibut-act t]
+                      ["Activate"           hywiki-word-activate t]
                       ["Create"             hywiki-add-page-and-display t]
                       ["Edit"               hywiki-find-page t]
                       ["Grep-Consult"       hywiki-consult-grep t]
-                      ["Help"               hui:hbut-help t]
+                      ["Help"               hkey-help t]
                       ["Link"               hywiki-add-link t]
                       hui-menu-org-meta-return-options
                       ["Publish"            hywiki-publish-to-html t]
                       ["Toggle-HyWiki-Mode" hywiki-mode t]
-                      ["WikiWord-Consult"   hywiki-word-search t])
+                      ["WikiWord-Consult"   hywiki-word-consult-grep t])
                 '("Implicit-Button"
                   ["Manual"   (id-info "(hyperbole)Implicit Buttons") t]
                   "----"
@@ -467,7 +467,7 @@ REBUILD-FLAG is non-nil, in which case the menu is rebuilt."
                   ["Create"   hui:ibut-create t]
                   ["Delete-Type" (hui:htype-delete 'ibtypes) t]
                   ["Edit"   hui:ibut-edit t]
-                  ["Help"   hui:hbut-help t]
+                  ["Help"   hkey-help t]
                   ["Link"   hui:ibut-link-directly t]
                   ["Name"   hui:ibut-label-create t]
                   ["Rename" hui:ibut-rename t]
diff --git a/hui-mini.el b/hui-mini.el
index 26f1a5a0a4..9b0522626c 100644
--- a/hui-mini.el
+++ b/hui-mini.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:    15-Oct-91 at 20:13:17
-;; Last-Mod:     17-Aug-24 at 17:45:49 by Bob Weiner
+;; Last-Mod:     18-Aug-24 at 15:33:00 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -843,14 +843,15 @@ command instead.  Typically prevents clashes over 
{\\`C-c' /}."
          ("Rename" hui:gbut-rename "Rename a global button.")))
        '(hywiki .
         (("HyWiki>")
-         ("Act"            hui:ibut-act      "Activate HyWikiWord link at 
point.")
+         ("Act"            hywiki-word-activate
+          "Activate HyWikiWord link at point or emulate a press of a Smart 
Key.")
          ("Create"         hywiki-add-page-and-display
            "Create and display a new HyWiki page.  Shows existing page names 
to aid in new naming.")
          ("Edit"           hywiki-find-page
           "Prompt with completion for and display a HyWiki page ready for 
editing.")
          ("GrepConsult"    hywiki-consult-grep
           "Grep over HyWiki pages with interactive consult-grep.")
-         ("Help"           hui:hbut-help
+         ("Help"           hkey-help
           "Report on a HyWikiWord's attributes.")
          ("Info"           (id-info "(hyperbole)HyWiki")
           "Display Hyperbole manual section on HyWiki.")
@@ -862,7 +863,7 @@ command instead.  Typically prevents clashes over {\\`C-c' 
/}."
           "Publish modified pages in the HyWiki to HTML; prefix arg to publish 
all pages.")
           ("Toggle"         hywiki-mode
           "Toggle whether HyWikiWords are highlighted and active in buffers 
outside of the HyWiki page directory.")
-         ("WikiWordConsult"         hywiki-word-search
+         ("WikiWordConsult"         hywiki-word-consult-grep
           "Use `hywiki-consult-grep' to show occurrences of a prompted for 
HyWikiWord.")))
        '(ibut .
         (("IButton>")
@@ -873,7 +874,7 @@ command instead.  Typically prevents clashes over {\\`C-c' 
/}."
          ("DeleteType"     (hui:htype-delete 'ibtypes)
           "Delete specified implicit button type.")
          ("Edit"           hui:ibut-edit "Edit/modify named implicit button 
attributes.")
-         ("Help"           hui:hbut-help "Report on button's attributes.")
+         ("Help"           hkey-help "Report on button's attributes.")
          ("Info"           (id-info "(hyperbole)Implicit Buttons")
           "Display manual section on implicit buttons.")
          ("Link"           hui:ibut-link-directly "Insert an ibut link at 
point to other/another window.")
diff --git a/hui-mouse.el b/hui-mouse.el
index e7ce7e5ccc..54e30cddc1 100644
--- a/hui-mouse.el
+++ b/hui-mouse.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:    04-Feb-89
-;; Last-Mod:     12-Jul-24 at 20:48:37 by Mats Lidell
+;; Last-Mod:     18-Aug-24 at 17:58:42 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -253,7 +253,6 @@ Its default value is `smart-scroll-down'.  To disable it, 
set it to
          (setq hkey-value (ert-results-filter-status-p)))
      . ((smart-ert-results hkey-value) . (smart-ert-results-assist 
hkey-value)))
     ;;
-    ;;
     ;; Handle Emacs push buttons in buffers
     ((and (fboundp 'button-at) (button-at (point)))
      . ((smart-push-button nil (mouse-event-p last-command-event))
diff --git a/hywiki.el b/hywiki.el
index 35d757f69c..cd023a19c2 100644
--- a/hywiki.el
+++ b/hywiki.el
@@ -662,7 +662,19 @@ Use `hywiki-get-page' to determine whether a HyWiki page 
exists."
   (when (or (bolp) (cl-find (char-before) "\(\{\<\"'`\t\n\r\f "))
     t))
 
-(defun hywiki-word-at ()
+(defun hywiki-word-activate (&optional arg)
+  "Display HyWiki page for wiki word at point, creating the page if needed.
+If found, return the full path of the page.
+
+If not on a wiki word and optional prefix ARG is null, emulate an
+Action Key press; with a prefix ARG, emulate an Assist Key press."
+  (interactive "P")
+  (let ((word hywiki-word-at))
+    (if word
+       (hywiki-find-page word)
+      (hkey-either arg))))
+
+(defun hywiki-word-at (&optional)
   "Return HyWiki word and optional #section at point or nil if not on one.
 Does not test whether or not a page exists for the HyWiki word; use
 `hywiki-get-page' for that.

Reply via email to