branch: externals/hyperbole
commit 435938fe842c8815e9e92c4dc2cb551af792c392
Author: bw <[email protected]>
Commit: bw <[email protected]>

    hpath:shorten - Expand & abbrev, don't shorten gbut activated paths
    
    hmouse-tag.el (smart-prog-tag):
    hui-mouse.el (hkey-alist): Change Assist Key behavior when on a programming
    symbol/tag.  If the symbol is a variable holding an in-memory Hyperbole 
button,
    then display a help buffer with the button's attributes.  Otherwise, if an 
Elisp
    symbol, then display a help buffer with symbol documentation, if any, to 
match
    the Hyperbole manual documentation.  For any other language symbol, display 
its
    definition, just as the Action Key does.
---
 ChangeLog          | 14 ++++++++++++++
 hbut.el            |  8 ++++----
 hmouse-tag.el      | 12 ++++++++----
 hpath.el           |  8 ++++++--
 hui-mouse.el       | 11 ++++++++++-
 man/hyperbole.texi | 16 +++++++++-------
 6 files changed, 51 insertions(+), 18 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3aa48e52b6..91752ff96e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,20 @@
 * MANIFEST: Add "HY-TALK/HYPERBOLEQA.kotl" from EmacsConf2025 talk.
   HY-TALK/HYPERBOLEQA.kotl - Add.
 
+2025-12-07  Bob Weiner  <[email protected]>
+
+* hpath.el (hpath:shorten): Expand and abbreviate but don't shorten paths if
+    within a global button activation.  Otherwise, relative paths may be 
computed
+    wrong.  Still this problem shown with (gbut:act "td") is not yet resolved.
+
+* hmouse-tag.el (smart-prog-tag):
+  hui-mouse.el (hkey-alist): Change Assist Key behavior when on a programming
+    symbol/tag.  If the symbol is a variable holding an in-memory Hyperbole 
button,
+    then display a help buffer with the button's attributes.  Otherwise, if an 
Elisp
+    symbol, then display a help buffer with symbol documentation, if any, to 
match
+    the Hyperbole manual documentation.  For any other language symbol, 
display its
+    definiton, just as the Action Key does.
+
 2025-12-06  Bob Weiner  <[email protected]>
 
 * hpath.el (hpath:absolute-to): Rewrite to fix when given multiple 
'default-dirs'
diff --git a/hbut.el b/hbut.el
index c89799aab9..bb37b4754a 100644
--- a/hbut.el
+++ b/hbut.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:    18-Sep-91 at 02:57:09
-;; Last-Mod:     31-Aug-25 at 16:22:09 by Bob Weiner
+;; Last-Mod:      7-Dec-25 at 19:24:08 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -1721,13 +1721,13 @@ Return number of buttons reported on or nil if none."
                        lbl
                      (concat ebut:label-start lbl ebut:label-end)))
             (terpri)
+            (hattr:report attribs)
+            (terpri)
             (let ((doc (actype:doc but (= 1 (length lbl-lst)))))
               (when doc
                 (princ "  ")
                 (princ doc)
-                (terpri)))
-            (hattr:report attribs)
-            (terpri)))
+                (terpri)))))
         lbl-lst))
       (length lbl-lst))))
 
diff --git a/hmouse-tag.el b/hmouse-tag.el
index c01b8e0010..927a4bfbe4 100644
--- a/hmouse-tag.el
+++ b/hmouse-tag.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:    24-Aug-91
-;; Last-Mod:      5-Oct-25 at 11:21:21 by Bob Weiner
+;; Last-Mod:      7-Dec-25 at 20:25:10 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -983,9 +983,13 @@ Uses `xref' for identifier recognition."
 
 ;;;###autoload
 (defun smart-prog-tag (&optional identifier next)
-  "Jump to definition of optional programming IDENTIFIER or the one at point.
-Optional second arg NEXT means jump to next matching tag."
-  (smart-tags-display (or identifier (hsys-xref-identifier-at-point)) next)
+  "Jump to definition of optional IDENTIFIER string or the one at point.
+Optional second arg NEXT is used by the Assist Key.  If IDENTIFIER is
+an Elisp symbol, it displays the IDENTIFIER'S documention; otherwise, it jumps
+to next matching tag definition."
+  (if (and next (smart-emacs-lisp-mode-p))
+      (describe-symbol (intern identifier))
+    (smart-tags-display (or identifier (hsys-xref-identifier-at-point)) next))
   t)
 
 (defun smart-jedi-find-file (file line column other-window)
diff --git a/hpath.el b/hpath.el
index 169cf9510a..08d2dc275c 100644
--- a/hpath.el
+++ b/hpath.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:     1-Nov-91 at 00:44:23
-;; Last-Mod:      6-Dec-25 at 22:57:33 by Bob Weiner
+;; Last-Mod:      7-Dec-25 at 21:12:14 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -2078,6 +2078,8 @@ prior to calling this function."
 
 (defun hpath:shorten (path &optional relative-to)
   "Expand and then shorten and return a PATH optionally RELATIVE-TO other path.
+Don't shorten if acting on a global button.
+
 Ignore optional RELATIVE-TO if editing a message,
 i.e. (hmail:editor-p) => t.  If RELATIVE-TO is omitted or nil,
 set it to `default-directory'.  Replace Emacs Lisp variables and
@@ -2097,7 +2099,9 @@ used.  Then abbreviate any remaining path."
       (setq relative-to (expand-file-name
                         (hpath:substitute-value relative-to))
            path
-           (cond ((string-equal path relative-to)
+           (cond ((hyperb:stack-frame '(gbut:act))
+                  path)
+                 ((string-equal path relative-to)
                   "")
                  ((string-equal (file-name-directory path) relative-to)
                   (file-name-nondirectory path))
diff --git a/hui-mouse.el b/hui-mouse.el
index 4381b09f99..3e4372c9b1 100644
--- a/hui-mouse.el
+++ b/hui-mouse.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:    04-Feb-89
-;; Last-Mod:      9-Sep-25 at 01:30:54 by Bob Weiner
+;; Last-Mod:      7-Dec-25 at 20:15:46 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -455,6 +455,15 @@ The button's attributes are stored in the symbol, 
`hbut:current'.")
     ((eq major-mode 'pages-directory-mode)
      . ((pages-directory-goto) . (pages-directory-goto)))
     ;;
+    ;; If a variable holding an in-memory Hyperbole button object, e.g. 
hbut:current:
+    ;; Action Key - Jump to variable definition
+    ;; Assist Key - Display button attributes of any Hyperbole button symbol 
at point
+    ((and (setq hkey-value (smart-prog-at-tag-p))
+         (hbut:is-p (intern-soft hkey-value)))
+     . ((ignore-errors (smart-prog-tag hkey-value)) .
+       (hbut:report (intern-soft hkey-value))))
+    ;;
+    ;; Handle programming language tag definition finding via xref.
     ;; For most programming languages use xref which supports various
     ;; Language Servers
     ((and (setq hkey-value (smart-prog-at-tag-p))
diff --git a/man/hyperbole.texi b/man/hyperbole.texi
index 35beda1d85..f76d523254 100644
--- a/man/hyperbole.texi
+++ b/man/hyperbole.texi
@@ -7,7 +7,7 @@
 @c Author:       Bob Weiner
 @c
 @c Orig-Date:     6-Nov-91 at 11:18:03
-@c Last-Mod:      1-Dec-25 at 10:00:11 by Mats Lidell
+@c Last-Mod:      7-Dec-25 at 20:30:10 by Bob Weiner
 
 @c %**start of header (This is for running Texinfo on a region.)
 @setfilename hyperbole.info
@@ -30,7 +30,7 @@
 @set txicodequoteundirected
 @set txicodequotebacktick
 
-@set UPDATED December 1, 2025
+@set UPDATED December 7, 2025
 @set UPDATED-MONTH December 2025
 @set EDITION 9.0.2pre
 @set VERSION 9.0.2pre
@@ -171,7 +171,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</P>
 
 <PRE>
 Edition 9.0.2pre
-Printed December 1, 2025.
+Printed December 7, 2025.
 
   Published by the Free Software Foundation, Inc.
   Author:    Bob Weiner
@@ -213,7 +213,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 @example
 Edition 9.0.2pre
-December 1, 2025 @c AUTO-REPLACE-ON-SAVE
+December 7, 2025 @c AUTO-REPLACE-ON-SAVE
 
 
   Published by the Free Software Foundation, Inc.
@@ -11447,9 +11447,11 @@ identifier:
      Emacs Lisp require, load, or autoload clause and the (find-library)
      function is defined, jumps to the library source, if possible.
   ASSIST KEY
-     Jumps to the next tag matching an identifier at point or if
-     the identifier is an Emacs Lisp symbol, then this displays the
-     documentation for the symbol.
+     Jumps to the next tag matching an identifier at point unless
+     the identifier is an Emacs Lisp symbol, then:
+       1. if it contains an in-memory Hyperbole button, display the buttons
+          attributes in a help buffer.
+       2. otherwise, display the identifier's documentation in a help buffer.
 @end group
 @end format
 

Reply via email to