[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/hyperbole 7b421cdcc1 1/2: Support setting/getting attri
From: |
ELPA Syncer |
Subject: |
[elpa] externals/hyperbole 7b421cdcc1 1/2: Support setting/getting attributes in invisible outline root 0 cell |
Date: |
Thu, 20 Jan 2022 04:57:33 -0500 (EST) |
branch: externals/hyperbole
commit 7b421cdcc100d2b430cad6770d85445f750af9a2
Author: Robert Weiner <rsw@gnu.org>
Commit: Robert Weiner <rsw@gnu.org>
Support setting/getting attributes in invisible outline root 0 cell
---
ChangeLog | 4 ++++
kotl/kotl-mode.el | 22 ++++++++++++++++------
2 files changed, 20 insertions(+), 6 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 3623913355..0ef802019e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2022-01-19 Bob Weiner <rsw@gnu.org>
+* kotl/kotl-mode.el (kotl-mode:set-cell-attribute,
kotl-mode:remove-cell-attribute):
+ Update interactive parts to utilize the hidden top-level 0 cell when given
a
+ zero-valued prefix argument.
+
* hactypes.el (link-to-texinfo-node, link-to-Info-index-item,
link-to-Info-node):
Remove any runs of tabs or newlines that might be in name and replace each
with a single space.
diff --git a/kotl/kotl-mode.el b/kotl/kotl-mode.el
index fe584725c4..20d6f80414 100644
--- a/kotl/kotl-mode.el
+++ b/kotl/kotl-mode.el
@@ -2475,6 +2475,8 @@ ATTRIBUTE and ignore any value of POS."
(interactive
(let* ((plist (copy-sequence (kcell-view:plist)))
(existing-attributes plist)
+ (top-cell-flag (zerop (prefix-numeric-value
+ current-prefix-arg)))
attribute)
(barf-if-buffer-read-only)
;; Remove attribute values leaving only attribute symbols in
existing-attributes.
@@ -2490,7 +2492,9 @@ ATTRIBUTE and ignore any value of POS."
(while (zerop (length (setq attribute
(completing-read
(format "Name of attribute to remove from
cell <%s>: "
- (kcell-view:label))
+ (if top-cell-flag
+ "0"
+ (kcell-view:label)))
(mapcar 'list
(mapcar 'symbol-name
existing-attributes))))))
@@ -2520,6 +2524,8 @@ confirmation."
(interactive
(let* ((plist (copy-sequence (kcell-view:plist)))
(existing-attributes plist)
+ (top-cell-flag (zerop (prefix-numeric-value
+ current-prefix-arg)))
attribute value)
(barf-if-buffer-read-only)
;; Remove attribute values leaving only attribute symbols in
existing-attributes.
@@ -2535,19 +2541,23 @@ confirmation."
(while (zerop (length (setq attribute
(completing-read
(format "Name of attribute to set in cell
<%s>: "
- (kcell-view:label))
+ (if top-cell-flag
+ "0"
+ (kcell-view:label)))
(mapcar 'list
(mapcar 'symbol-name
existing-attributes))))))
(beep))
(setq attribute (intern attribute)
- value (kcell-view:get-attr attribute))
+ value (if top-cell-flag
+ (kcell:get-attr (kview:top-cell kview) attribute)
+ (kcell-view:get-attr attribute)))
(if value
(setq value (read-minibuffer
- (format "Change the value of `%s' to: " attribute)
- (prin1-to-string value t)))
+ (format "Change the value of `%s' to (use double quotes
around a string): " attribute)
+ (prin1-to-string value)))
(setq value (read-minibuffer
- (format "Set property `%s' to (use double quotes around a
string): " attribute))))
+ (format "Set attribute `%s' to (use double quotes around a
string): " attribute))))
(list attribute value nil current-prefix-arg)))
(barf-if-buffer-read-only)
(if top-cell-flag