diff --git a/ChangeLog b/ChangeLog index 1724593d..a1e69c0b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2026-06-16 Bob Weiner +* test/demo-tests.el (fast-demo-display-kotl-starting-from-cell): Fix to + erase viespec modification to "kotl/EXAMPLE.kotl" which test was leaving. + +* hsys-activities.el: Improve documentation. + +* hui.el (hui:ebut-message, hui:ibut-message): Fix 'actype' setting so + it never ends up nil. + * hsys-org.el (hsys-org-link-at-p): Rewrite to handle non-delimited Org links, such as: file:my-file::my-text. Leave file:// links for www-url ibtype by using 'hpath:www-at-p' test as Org url test will match to this: diff --git a/hsys-activities.el b/hsys-activities.el index e197aeb3..7c135d48 100644 --- a/hsys-activities.el +++ b/hsys-activities.el @@ -3,7 +3,7 @@ ;; Author: Mats Lidell ;; ;; Orig-Date: 7-Dec-25 at 22:48:29 -;; Last-Mod: 2-Jan-26 at 21:31:06 by Bob Weiner +;; Last-Mod: 16-Jun-26 at 18:32:44 by Bob Weiner ;; ;; SPDX-License-Identifier: GPL-3.0-or-later ;; @@ -14,13 +14,19 @@ ;;; Commentary: ;; -;; Use as action button +;; The 'activities' package persistently saves and restores window +;; configurations as well as tab and frame configurations. ;; -;; Create "Activity" if it does not exist. If "Activity" is not -;; active, switch to its latest state. If "Activity" is active, -;; revert it to its default state. If "Activity" is active and the -;; action button is called with a prefix argument a new default state -;; is set. +;; This library defines a single function, hsys-activities, that can be used +;; as an action button to interface the `activities' package for use +;; with Hyperbole. Adding the action button: +;; +;; to any text achieves the following: +;; 1. If "Activity" does not exist, create it. +;; 2. If "Activity" is not active, switch to its latest saved state. +;; 3. If "Activity" is active, revert to its default state. +;; 4. If "Activity" is active and the action button is called with +;; a prefix argument, a new default state is set. ;;; Code: diff --git a/hui.el b/hui.el index 77a90454..e73c7f95 100644 --- a/hui.el +++ b/hui.el @@ -3,7 +3,7 @@ ;; Author: Bob Weiner ;; ;; Orig-Date: 19-Sep-91 at 21:42:03 -;; Last-Mod: 5-Jun-26 at 07:58:00 by Bob Weiner +;; Last-Mod: 16-Jun-26 at 17:51:27 by Bob Weiner ;; ;; SPDX-License-Identifier: GPL-3.0-or-later ;; @@ -1693,7 +1693,9 @@ from the button that point is within." With BUT-EDIT-FLAG non-nil message about ebut being edited." (let ((actype (symbol-name (hattr:get 'hbut:current 'actype))) (args (hattr:get 'hbut:current 'args))) - (setq actype (actype:def-symbol actype)) + (setq actype (or (actype:def-symbol (actype:elisp-symbol actype)) + (when (symbolp actype) + actype))) (message "%s%s%s %s %S" ebut:label-start (hbut:key-to-label (hattr:get 'hbut:current 'lbl-key)) @@ -1944,7 +1946,9 @@ within." With BUT-EDIT-FLAG non-nil message about ibut being edited." (let ((actype (symbol-name (hattr:get 'hbut:current 'actype))) (args (hattr:get 'hbut:current 'args))) - (setq actype (actype:def-symbol actype)) + (setq actype (or (actype:def-symbol (actype:elisp-symbol actype)) + (when (symbolp actype) + actype))) (message "%s%s%s %s %S" ibut:label-start (hbut:key-to-label (hattr:get 'hbut:current 'lbl-key)) diff --git a/test/demo-tests.el b/test/demo-tests.el index cd2883b5..7587e246 100644 --- a/test/demo-tests.el +++ b/test/demo-tests.el @@ -3,7 +3,7 @@ ;; Author: Mats Lidell ;; ;; Orig-Date: 30-Jan-21 at 12:00:00 -;; Last-Mod: 16-Mar-26 at 00:16:06 by Bob Weiner +;; Last-Mod: 16-Jun-26 at 22:09:58 by Bob Weiner ;; ;; SPDX-License-Identifier: GPL-3.0-or-later ;; @@ -807,12 +807,19 @@ enough files with matching mode loaded." (insert (format "<%skotl/EXAMPLE.kotl#3b10|c2en>" default-directory)) (goto-char 5) - (action-key) - (setq buf (current-buffer)) - (should (string-suffix-p "EXAMPLE.kotl" buffer-file-name)) - (should (looking-at-p "Cell Transposition:")) - ;; Ensure visible cell length is cutoff at 2 lines - (should (= 2 (hypb:string-count-matches "\n" (kcell-view:contents))))))) + (unwind-protect + (progn (action-key) + (setq buf (current-buffer)) + (should (string-suffix-p "EXAMPLE.kotl" buffer-file-name)) + (should (looking-at-p "Cell Transposition:")) + ;; Ensure visible cell length is cutoff at 2 lines + (should (= 2 (hypb:string-count-matches + "\n" (kcell-view:contents))))) + ;; Restore kotl/EXAMPLE.kotl to its original viewspec and kill the + ;; buffer so it is unchanged. + (kvspec:activate "ben") + (set-buffer-modified-p nil) + (kill-buffer (current-buffer)))))) (provide 'demo-tests)