branch: externals/hyperbole
commit b1d56600ca973e07cfd35cda6b4162204a7b2bc9
Author: Bob Weiner <[email protected]>
Commit: Bob Weiner <[email protected]>
ibut:operate - Skip past any inserted comment chars
---
ChangeLog | 3 +++
hbut.el | 3 +++
hui.el | 14 +++++++-------
3 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 36732e0827..cd9e4e3353 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2023-08-25 Bob Weiner <[email protected]>
+* hbut.el (ibut:operate): Skip past any inserted comment chars prior to
+ ibut at point.
+
* hbut.el (ibut:operate): Before call 'ibut:at-p', leave point after any
opening
ibut delimiters, since may have just deleted the button name, for example.
diff --git a/hbut.el b/hbut.el
index 813d60bb40..19d41b33a4 100644
--- a/hbut.el
+++ b/hbut.el
@@ -2364,6 +2364,9 @@ Summary of operations based on inputs (name arg comes
from \\='hbut:current attr
(ibut:insert-text 'hbut:current)))
(goto-char (or start (max (- (point) 2) (point-min))))
+ ;; Skip past any inserted comment char
+ (skip-syntax-forward "-<")
+ ;; Skip past any name or label opening delim chars
(skip-chars-forward "\"<{[| \t\n\r"))
;; Set all in-memory hbut attributes for any button at point
diff --git a/hui.el b/hui.el
index 0952558086..5d43c3a037 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: 12-Aug-23 at 13:19:18 by Bob Weiner
+;; Last-Mod: 25-Aug-23 at 10:36:13 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
@@ -906,7 +906,7 @@ See `hbut:report'."
(defalias 'hui:hbut-summarize #'hui:hbut-report)
(defun hui:ibut-act (&optional ibut)
- "Activate optional labeled implicit button symbol IBUT in current buffer.
+ "Activate optional named implicit button symbol IBUT in current buffer.
Default is any implicit button at point."
(interactive
(let ((ibut (ibut:at-p)) (lst))
@@ -914,17 +914,17 @@ Default is any implicit button at point."
(cond (ibut)
((setq lst (ibut:alist))
(ibut:get (ibut:label-to-key
- (hargs:read-match "Activate labeled implicit button: "
lst nil t
+ (hargs:read-match "Activate named implicit button: "
lst nil t
(ibut:label-p 'as-label) 'ibut))))
(t
- (hypb:error "(ibut-act): No labeled implicit buttons in
buffer."))))))
- (hui:hbut-operate #'ibut:act "Activate labeled implicit button: " ibut))
+ (hypb:error "(ibut-act): No named implicit buttons in
buffer."))))))
+ (hui:hbut-operate #'ibut:act "Activate named implicit button: " ibut))
(defun hui:ibut-create (&optional start end)
"Interactively create an implicit Hyperbole button at point.
-Use any label between optional START and END points (when interactive,
+Use any name between optional START and END points (when interactive,
any active region). Indicate button creation by delimiting
-and adding any necessary instance number to the button label.
+and adding any necessary instance number to the button name.
For programmatic creation, use `ibut:program' instead."
(interactive (list (when (use-region-p) (region-beginning))