emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/hyperbole c9d7505629 1/3: Finish Koutline 0 root cell h


From: ELPA Syncer
Subject: [elpa] externals/hyperbole c9d7505629 1/3: Finish Koutline 0 root cell handling updates
Date: Sun, 23 Jan 2022 03:57:45 -0500 (EST)

branch: externals/hyperbole
commit c9d7505629ff2a2809431c3f1ebe3e152fe91166
Author: Robert Weiner <rsw@gnu.org>
Commit: Robert Weiner <rsw@gnu.org>

    Finish Koutline 0 root cell handling updates
---
 ChangeLog         |  13 +++++
 HY-NEWS           |  11 +++++
 hargs.el          |   5 +-
 kotl/EXAMPLE.kotl | 139 ++++++++++++++++++++++++++++--------------------------
 kotl/kotl-mode.el |  88 ++++++++++++++++++----------------
 5 files changed, 146 insertions(+), 110 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6e2d47cd2b..4556312712 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+* kotl/kotl-mode.el (kotl-mode:set-or-remove-cell-attribute): Change to support
+    0 root cell attribute set or remove via prefix arg.
+  kotl/EXAMPLE.kotl: Update 'Cell Attributes' description with the above 
change.
+  HY-NEWS: Add Koutlines 0 cell attribute handling description.
+  man/hyperbole.texi (Cell Attributes): Document above change.
+
+2022-01-21  Bob Weiner  <rsw@gnu.org>
+
+* kotl/kotl-mode.el (kotl-mode:cell-attributes): Assume parent has set stdout
+    buffer; stop clearing this buffer before printing to it.
+                    (kotl-mode:cell-help): Fix to handle 0 top-level cell
+    properly.
+
 2022-01-20  Bob Weiner  <rsw@gnu.org>
 
 * kotl/kview.el (kview:create): Ensure top-level 0 cell file attribute is 
always updated
diff --git a/HY-NEWS b/HY-NEWS
index 4971302874..3ad223f923 100644
--- a/HY-NEWS
+++ b/HY-NEWS
@@ -206,6 +206,17 @@
     - Koutlines have a hidden top-level root cell 0 that allows referring
       to the whole outline as a tree.  Now attributes of this cell can be
       set or retrieved like any other cell.
+      set, retrieved or removed like any other cell.
+
+      {C-c h} prompts for a kcell id and displays its attributes.
+      {C-u C-c h} prompts for a kcell id and displays the attributes for it
+      and its subtree; use 0 as the kcell id to see attributes for all visible
+      cells in the outline.
+
+      {C-c C-i} sets an attribute of the cell at point.
+      {C-u C-c C-i} removes an attribute of the cell at point.
+      {C-0 C-c C-i} sets an attribute of the invisible 0 root cell.
+      {C--1 C-c C-i} removes an attribute of the invisible 0 root cell.
 
     - Modes to Ignore Klinks: C-style languages use <includes> that can be
       mistaken for klinks.  New customizations 'klink:ignore-modes' and
diff --git a/hargs.el b/hargs.el
index 12dbe163e8..da5fc25f25 100644
--- a/hargs.el
+++ b/hargs.el
@@ -801,8 +801,9 @@ help when appropriate."
          ;; Get kcell from koutline.
          (?K . (kcell . (hargs:read-match
                          prompt
-                         ;; Match to visible cell labels only
-                         (kview:map-tree (lambda (view) (kcell-view:label)) 
kview t t)
+                         ;; Match to "0" and visible cell labels only
+                         (cons "0"
+                               (kview:map-tree (lambda (view) 
(kcell-view:label)) kview t t))
                          nil t (kcell-view:visible-label) 'kcell)))
          ;; Get kcell or path reference for use in a link.
          (?L . (klink . (hargs:read prompt nil default nil 'klink)))
diff --git a/kotl/EXAMPLE.kotl b/kotl/EXAMPLE.kotl
index ec0803f5db..4862d759ba 100644
--- a/kotl/EXAMPLE.kotl
+++ b/kotl/EXAMPLE.kotl
@@ -197,10 +197,13 @@
            id and displays its attributes.  {C-u C-c h} prompts for a kcell
            id and displays the attributes for it and its subtree; use 0 as
            the kcell id to see attributes for all visible cells in the
-           outline.
+           outline, including the invisible 0 cell that is the root of
+           all first-level cells.
            
-           Use {C-c C-i} to add an attribute to or to modify an existing
-           attribute of the cell at point.
+           {C-c C-i} sets an attribute of the cell at point.
+           {C-u C-c C-i} removes an attribute of the cell at point.
+           {C-0 C-c C-i} sets an attribute of the invisible 0 root cell.
+           {C--1 C-c C-i} removes an attribute of the invisible 0 root cell.
 
      3b15. File Insertion: The elements of another buffer or file may be
            inserted into a koutline as a set of cells by using the {C-x i}
@@ -399,133 +402,133 @@ alpha ;; label-type
 
 ;; depth-first kcell attributes
 [[0
-  (idstamp 0 creator "rsw@gnu.org" create-time "20220117:22:23:52" id-counter 
81 file "/c/Users/bob.weiner/Dropbox/emacs/hyperbole/kotl/EXAMPLE.kotl")]
+  (idstamp 0 creator "rsw@gnu.org" create-time "20220117:22:23:52" id-counter 
81 file "/home/bob.weiner/Dropbox/emacs/hyperbole/kotl/EXAMPLE.kotl")]
  [20
-  (creator "rsw@gnu.org" create-time "19940104:17:38:28" no-fill t 
rear-nonsticky t idstamp 20 kcell t)]
+  (kcell t idstamp 20 rear-nonsticky t no-fill t create-time 
"19940104:17:38:28" creator "rsw@gnu.org")]
  [2
-  (creator "rsw@gnu.org" create-time "19940104:17:38:28" no-fill t 
rear-nonsticky t idstamp 2 kcell t)]
+  (kcell t idstamp 2 rear-nonsticky t no-fill t create-time 
"19940104:17:38:28" creator "rsw@gnu.org")]
  [34
-  (creator "rsw@gnu.org" create-time "19940610:16:43:55" rear-nonsticky t 
idstamp 34 kcell t)]
+  (kcell t idstamp 34 rear-nonsticky t create-time "19940610:16:43:55" creator 
"rsw@gnu.org")]
  [35
-  (creator "rsw@gnu.org" create-time "19940610:16:44:03" rear-nonsticky t 
idstamp 35 kcell t)]
+  (kcell t idstamp 35 rear-nonsticky t create-time "19940610:16:44:03" creator 
"rsw@gnu.org")]
  [4
-  (creator "rsw@gnu.org" create-time "19940104:17:38:29" rear-nonsticky t 
idstamp 4 kcell t)]
+  (kcell t idstamp 4 rear-nonsticky t create-time "19940104:17:38:29" creator 
"rsw@gnu.org")]
  [5
-  (creator "rsw@gnu.org" create-time "19940104:17:38:29" rear-nonsticky t 
idstamp 5 kcell t)]
+  (kcell t idstamp 5 rear-nonsticky t create-time "19940104:17:38:29" creator 
"rsw@gnu.org")]
  [6
-  (creator "rsw@gnu.org" create-time "19940104:17:38:29" rear-nonsticky t 
idstamp 6 kcell t)]
+  (kcell t idstamp 6 rear-nonsticky t create-time "19940104:17:38:29" creator 
"rsw@gnu.org")]
  [14
-  (creator "rsw@gnu.org" create-time "19940104:17:38:29" rear-nonsticky t 
idstamp 14 kcell t)]
+  (kcell t idstamp 14 rear-nonsticky t create-time "19940104:17:38:29" creator 
"rsw@gnu.org")]
  [67
-  (creator "rsw@gnu.org" create-time "19951028:04:29:13" no-fill t 
rear-nonsticky t idstamp 67 kcell t)]
+  (kcell t idstamp 67 rear-nonsticky t no-fill t create-time 
"19951028:04:29:13" creator "rsw@gnu.org")]
  [15
-  (creator "rsw@gnu.org" create-time "19940104:17:38:29" rear-nonsticky t 
idstamp 15 kcell t)]
+  (kcell t idstamp 15 rear-nonsticky t create-time "19940104:17:38:29" creator 
"rsw@gnu.org")]
  [31
-  (creator "rsw@gnu.org" create-time "19940306:18:11:43" rear-nonsticky t 
idstamp 31 kcell t)]
+  (kcell t idstamp 31 rear-nonsticky t create-time "19940306:18:11:43" creator 
"rsw@gnu.org")]
  [7
-  (creator "rsw@gnu.org" create-time "19940104:17:38:29" rear-nonsticky t 
idstamp 7 kcell t)]
+  (kcell t idstamp 7 rear-nonsticky t create-time "19940104:17:38:29" creator 
"rsw@gnu.org")]
  [46
-  (creator "rsw@gnu.org" create-time "19950614:21:35:17" rear-nonsticky t 
idstamp 46 kcell t)]
+  (kcell t idstamp 46 rear-nonsticky t create-time "19950614:21:35:17" creator 
"rsw@gnu.org")]
  [43
-  (creator "rsw@gnu.org" create-time "19940610:22:00:46" rear-nonsticky t 
idstamp 43 kcell t)]
+  (kcell t idstamp 43 rear-nonsticky t create-time "19940610:22:00:46" creator 
"rsw@gnu.org")]
  [22
-  (creator "rsw@gnu.org" create-time "19940127:22:41:42" rear-nonsticky t 
idstamp 22 kcell t)]
+  (kcell t idstamp 22 rear-nonsticky t create-time "19940127:22:41:42" creator 
"rsw@gnu.org")]
  [32
-  (creator "rsw@gnu.org" create-time "19940610:16:31:28" rear-nonsticky t 
idstamp 32 kcell t)]
+  (kcell t idstamp 32 rear-nonsticky t create-time "19940610:16:31:28" creator 
"rsw@gnu.org")]
  [41
-  (creator "rsw@gnu.org" create-time "19940610:18:55:09" rear-nonsticky t 
idstamp 41 kcell t)]
+  (kcell t idstamp 41 rear-nonsticky t create-time "19940610:18:55:09" creator 
"rsw@gnu.org")]
  [42
-  (creator "rsw@gnu.org" create-time "19940610:18:55:57" rear-nonsticky t 
idstamp 42 kcell t)]
+  (kcell t idstamp 42 rear-nonsticky t create-time "19940610:18:55:57" creator 
"rsw@gnu.org")]
  [33
-  (creator "rsw@gnu.org" create-time "19940610:16:31:29" rear-nonsticky t 
idstamp 33 kcell t)]
+  (kcell t idstamp 33 rear-nonsticky t create-time "19940610:16:31:29" creator 
"rsw@gnu.org")]
  [47
-  (creator "rsw@gnu.org" create-time "19951022:22:59:26" no-fill t 
rear-nonsticky t idstamp 47 kcell t)]
+  (kcell t idstamp 47 rear-nonsticky t no-fill t create-time 
"19951022:22:59:26" creator "rsw@gnu.org")]
  [8
-  (creator "rsw@gnu.org" create-time "19940104:17:38:29" rear-nonsticky t 
idstamp 8 kcell t)]
+  (kcell t idstamp 8 rear-nonsticky t create-time "19940104:17:38:29" creator 
"rsw@gnu.org")]
  [28
-  (creator "rsw@gnu.org" create-time "19940128:22:50:44" rear-nonsticky t 
idstamp 28 kcell t)]
+  (kcell t idstamp 28 rear-nonsticky t create-time "19940128:22:50:44" creator 
"rsw@gnu.org")]
  [29
-  (creator "rsw@gnu.org" create-time "19940128:22:50:54" rear-nonsticky t 
idstamp 29 kcell t)]
+  (kcell t idstamp 29 rear-nonsticky t create-time "19940128:22:50:54" creator 
"rsw@gnu.org")]
  [10
-  (creator "rsw@gnu.org" create-time "19940104:17:38:29" rear-nonsticky t 
idstamp 10 kcell t)]
+  (kcell t idstamp 10 rear-nonsticky t create-time "19940104:17:38:29" creator 
"rsw@gnu.org")]
  [30
-  (creator "rsw@gnu.org" create-time "19940129:00:27:59" rear-nonsticky t 
idstamp 30 kcell t)]
+  (kcell t idstamp 30 rear-nonsticky t create-time "19940129:00:27:59" creator 
"rsw@gnu.org")]
  [62
-  (creator "rsw@gnu.org" create-time "19951026:08:32:57" no-fill t 
rear-nonsticky t idstamp 62 kcell t)]
+  (kcell t idstamp 62 rear-nonsticky t no-fill t create-time 
"19951026:08:32:57" creator "rsw@gnu.org")]
  [70
-  (creator "rsw@gnu.org" create-time "19951030:19:18:49" no-fill t 
rear-nonsticky t idstamp 70 kcell t)]
+  (kcell t idstamp 70 rear-nonsticky t no-fill t create-time 
"19951030:19:18:49" creator "rsw@gnu.org")]
  [71
-  (creator "rsw@gnu.org" create-time "19951030:19:19:40" no-fill t 
rear-nonsticky t idstamp 71 kcell t)]
+  (kcell t idstamp 71 rear-nonsticky t no-fill t create-time 
"19951030:19:19:40" creator "rsw@gnu.org")]
  [73
-  (creator "rsw@gnu.org" create-time "19951030:19:23:09" no-fill t 
rear-nonsticky t idstamp 73 kcell t)]
+  (kcell t idstamp 73 rear-nonsticky t no-fill t create-time 
"19951030:19:23:09" creator "rsw@gnu.org")]
  [63
-  (creator "rsw@gnu.org" create-time "19951026:19:31:34" no-fill t 
rear-nonsticky t idstamp 63 kcell t)]
+  (kcell t idstamp 63 rear-nonsticky t no-fill t create-time 
"19951026:19:31:34" creator "rsw@gnu.org")]
  [64
-  (creator "rsw@gnu.org" create-time "19951026:19:33:01" no-fill t 
rear-nonsticky t idstamp 64 kcell t)]
+  (kcell t idstamp 64 rear-nonsticky t no-fill t create-time 
"19951026:19:33:01" creator "rsw@gnu.org")]
  [69
-  (creator "rsw@gnu.org" create-time "19951029:06:24:35" no-fill t 
rear-nonsticky t idstamp 69 kcell t)]
+  (kcell t idstamp 69 rear-nonsticky t no-fill t create-time 
"19951029:06:24:35" creator "rsw@gnu.org")]
  [68
-  (creator "rsw@gnu.org" create-time "19951029:06:24:27" no-fill t 
rear-nonsticky t idstamp 68 kcell t)]
+  (kcell t idstamp 68 rear-nonsticky t no-fill t create-time 
"19951029:06:24:27" creator "rsw@gnu.org")]
  [65
-  (creator "rsw@gnu.org" create-time "19951026:19:33:08" no-fill t 
rear-nonsticky t idstamp 65 kcell t)]
+  (kcell t idstamp 65 rear-nonsticky t no-fill t create-time 
"19951026:19:33:08" creator "rsw@gnu.org")]
  [66
-  (creator "rsw@gnu.org" create-time "19951026:19:33:15" no-fill t 
rear-nonsticky t idstamp 66 kcell t)]
+  (kcell t idstamp 66 rear-nonsticky t no-fill t create-time 
"19951026:19:33:15" creator "rsw@gnu.org")]
  [77
-  (creator "rsw@gnu.org" create-time "19980226:19:54:44" no-fill t 
rear-nonsticky t idstamp 77 kcell t)]
+  (kcell t idstamp 77 rear-nonsticky t no-fill t create-time 
"19980226:19:54:44" creator "rsw@gnu.org")]
  [48
-  (creator "rsw@gnu.org" create-time "19951023:05:55:19" no-fill t 
rear-nonsticky t idstamp 48 kcell t)]
+  (kcell t idstamp 48 rear-nonsticky t no-fill t create-time 
"19951023:05:55:19" creator "rsw@gnu.org")]
  [57
-  (creator "rsw@gnu.org" create-time "19951023:10:07:06" no-fill t 
rear-nonsticky t idstamp 57 kcell t)]
+  (kcell t idstamp 57 rear-nonsticky t no-fill t create-time 
"19951023:10:07:06" creator "rsw@gnu.org")]
  [58
-  (creator "rsw@gnu.org" create-time "19951023:10:07:26" no-fill t 
rear-nonsticky t idstamp 58 kcell t)]
+  (kcell t idstamp 58 rear-nonsticky t no-fill t create-time 
"19951023:10:07:26" creator "rsw@gnu.org")]
  [49
-  (creator "rsw@gnu.org" create-time "19951023:05:55:55" no-fill t 
rear-nonsticky t idstamp 49 kcell t)]
+  (kcell t idstamp 49 rear-nonsticky t no-fill t create-time 
"19951023:05:55:55" creator "rsw@gnu.org")]
  [55
-  (creator "rsw@gnu.org" create-time "19951023:08:56:41" no-fill t 
rear-nonsticky t idstamp 55 kcell t)]
+  (kcell t idstamp 55 rear-nonsticky t no-fill t create-time 
"19951023:08:56:41" creator "rsw@gnu.org")]
  [50
-  (creator "rsw@gnu.org" create-time "19951023:05:57:26" no-fill t 
rear-nonsticky t idstamp 50 kcell t)]
+  (kcell t idstamp 50 rear-nonsticky t no-fill t create-time 
"19951023:05:57:26" creator "rsw@gnu.org")]
  [51
-  (creator "rsw@gnu.org" create-time "19951023:05:58:31" no-fill t 
rear-nonsticky t idstamp 51 kcell t)]
+  (kcell t idstamp 51 rear-nonsticky t no-fill t create-time 
"19951023:05:58:31" creator "rsw@gnu.org")]
  [56
-  (creator "rsw@gnu.org" create-time "19951023:08:57:09" no-fill t 
rear-nonsticky t idstamp 56 kcell t)]
+  (kcell t idstamp 56 rear-nonsticky t no-fill t create-time 
"19951023:08:57:09" creator "rsw@gnu.org")]
  [52
-  (creator "rsw@gnu.org" create-time "19951023:05:59:59" no-fill t 
rear-nonsticky t idstamp 52 kcell t)]
+  (kcell t idstamp 52 rear-nonsticky t no-fill t create-time 
"19951023:05:59:59" creator "rsw@gnu.org")]
  [53
-  (creator "rsw@gnu.org" create-time "19951023:06:00:48" no-fill t 
rear-nonsticky t idstamp 53 kcell t)]
+  (kcell t idstamp 53 rear-nonsticky t no-fill t create-time 
"19951023:06:00:48" creator "rsw@gnu.org")]
  [54
-  (creator "rsw@gnu.org" create-time "19951023:06:05:50" no-fill t 
rear-nonsticky t idstamp 54 kcell t)]
+  (kcell t idstamp 54 rear-nonsticky t no-fill t create-time 
"19951023:06:05:50" creator "rsw@gnu.org")]
  [26
-  (creator "rsw@gnu.org" create-time "19940128:03:56:23" rear-nonsticky t 
idstamp 26 kcell t)]
+  (kcell t idstamp 26 rear-nonsticky t create-time "19940128:03:56:23" creator 
"rsw@gnu.org")]
  [27
-  (creator "rsw@gnu.org" create-time "19940128:22:36:54" rear-nonsticky t 
idstamp 27 kcell t)]
+  (kcell t idstamp 27 rear-nonsticky t create-time "19940128:22:36:54" creator 
"rsw@gnu.org")]
  [59
-  (creator "rsw@gnu.org" create-time "19951024:03:40:05" no-fill t 
rear-nonsticky t idstamp 59 kcell t)]
+  (kcell t idstamp 59 rear-nonsticky t no-fill t create-time 
"19951024:03:40:05" creator "rsw@gnu.org")]
  [60
-  (creator "rsw@gnu.org" create-time "19951024:03:40:13" no-fill t 
rear-nonsticky t idstamp 60 kcell t)]
+  (kcell t idstamp 60 rear-nonsticky t no-fill t create-time 
"19951024:03:40:13" creator "rsw@gnu.org")]
  [61
-  (creator "rsw@gnu.org" create-time "19951024:03:40:42" no-fill t 
rear-nonsticky t idstamp 61 kcell t)]
+  (kcell t idstamp 61 rear-nonsticky t no-fill t create-time 
"19951024:03:40:42" creator "rsw@gnu.org")]
  [1
-  (creator "rsw@gnu.org" create-time "19940104:17:38:29" rear-nonsticky t 
idstamp 1 kcell t)]
+  (kcell t idstamp 1 rear-nonsticky t create-time "19940104:17:38:29" creator 
"rsw@gnu.org")]
  [11
-  (creator "rsw@gnu.org" create-time "19940104:17:38:29" rear-nonsticky t 
idstamp 11 kcell t)]
+  (kcell t idstamp 11 rear-nonsticky t create-time "19940104:17:38:29" creator 
"rsw@gnu.org")]
  [80
-  (no-fill t create-time "20220117:22:26:40" creator "rsw@gnu.org" idstamp 80 
kcell t fontified t)]
+  (fontified nil kcell t idstamp 80 creator "rsw@gnu.org" create-time 
"20220117:22:26:40" no-fill t)]
  [81
-  (no-fill t create-time "20220117:22:26:47" creator "rsw@gnu.org" idstamp 81 
kcell t fontified t)]
+  (fontified nil kcell t idstamp 81 creator "rsw@gnu.org" create-time 
"20220117:22:26:47" no-fill t)]
  [78
-  (no-fill t create-time "20220117:22:26:33" creator "rsw@gnu.org" idstamp 78 
kcell t fontified t)]
+  (fontified nil kcell t idstamp 78 creator "rsw@gnu.org" create-time 
"20220117:22:26:33" no-fill t)]
  [12
-  (creator "rsw@gnu.org" create-time "19940104:17:38:29" rear-nonsticky t 
idstamp 12 kcell t)]
+  (kcell t idstamp 12 rear-nonsticky t create-time "19940104:17:38:29" creator 
"rsw@gnu.org")]
  [44
-  (creator "rsw@gnu.org" create-time "19940728:21:56:49" rear-nonsticky t 
idstamp 44 kcell t)]
+  (kcell t idstamp 44 rear-nonsticky t create-time "19940728:21:56:49" creator 
"rsw@gnu.org")]
  [36
-  (creator "rsw@gnu.org" create-time "19940610:16:49:34" rear-nonsticky t 
idstamp 36 kcell t)]
+  (kcell t idstamp 36 rear-nonsticky t create-time "19940610:16:49:34" creator 
"rsw@gnu.org")]
  [37
-  (creator "rsw@gnu.org" create-time "19940610:16:50:02" rear-nonsticky t 
idstamp 37 kcell t)]
+  (kcell t idstamp 37 rear-nonsticky t create-time "19940610:16:50:02" creator 
"rsw@gnu.org")]
  [38
-  (creator "rsw@gnu.org" create-time "19940610:16:50:13" rear-nonsticky t 
idstamp 38 kcell t)]
+  (kcell t idstamp 38 rear-nonsticky t create-time "19940610:16:50:13" creator 
"rsw@gnu.org")]
  [13
-  (creator "rsw@gnu.org" create-time "19940104:17:38:29" rear-nonsticky t 
idstamp 13 kcell t)]
+  (kcell t idstamp 13 rear-nonsticky t create-time "19940104:17:38:29" creator 
"rsw@gnu.org")]
  [16
-  (creator "rsw@gnu.org" create-time "19940104:17:38:29" rear-nonsticky t 
idstamp 16 kcell t)]
+  (kcell t idstamp 16 rear-nonsticky t create-time "19940104:17:38:29" creator 
"rsw@gnu.org")]
  nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil]
diff --git a/kotl/kotl-mode.el b/kotl/kotl-mode.el
index 20d6f80414..34df70cb43 100644
--- a/kotl/kotl-mode.el
+++ b/kotl/kotl-mode.el
@@ -2572,10 +2572,24 @@ confirmation."
                                 (kcell-view:label pos)))))
 
 (defun kotl-mode:set-or-remove-cell-attribute (arg)
-  "With prefix ARG, interactively run kotl-mode:remove-cell-attribute; 
otherwise, run kotl-mode:set-cell-attribute."
-  (interactive "P")
-  (call-interactively
-   (if arg #'kotl-mode:remove-cell-attribute #'kotl-mode:set-cell-attribute)))
+  "With numeric prefix ARG, interactively run kotl-mode:remove-cell-attribute; 
otherwise, run kotl-mode:set-cell-attribute.
+Prefix ARG selects the cells whose attributes are removed or set:
+  If =  0, set one of the attributes of the invisible root cell;
+  If <  0, remove one of the attributes of the invisible root cell;
+  If =  1, set one of the attributes of the current cell;
+  If >  1, remove one of the attributes of the current cell."
+  (interactive "p")
+  (cond ((not (integerp arg))
+        (error "(kotl-mode:set-or-remove-cell-attribute): ARG must be an 
integer, not '%s'" arg))
+       ((= arg 0)
+        (call-interactively #'kotl-mode:set-cell-attribute))
+       ((< arg 0)
+        (setq current-prefix-arg 0)
+        (call-interactively #'kotl-mode:remove-cell-attribute))
+       ((= arg 1)
+        (call-interactively #'kotl-mode:set-cell-attribute))
+       ((> arg 1)
+        (call-interactively #'kotl-mode:remove-cell-attribute))))
 
 (defun kotl-mode:split-cell (&optional arg)
   "Split the current cell into two cells and move to the new cell.
@@ -2859,46 +2873,41 @@ With optional SHOW-FLAG, expand the tree instead."
   (kotl-mode:hide-tree cell-ref t))
 
 (defun kotl-mode:cell-attributes (all-flag)
-  "Display a temporary buffer with the attributes of the current kcell.
-With prefix arg ALL-FLAG non-nil, display the attributes of all visible
-kcells in the current buffer.
+  "Print attributes of the current kcell to standard output.
+With prefix arg ALL-FLAG non-nil, print the attributes of all visible
+kcells from the current buffer to standard output.
 
 See also the documentation for `kotl-mode:cell-help'."
   (interactive "P")
-  ;; Ensure these do not invoke with-output-to-temp-buffer a second time.
-  (let ((temp-buffer-show-hook)
-       (temp-buffer-show-function))
-    (with-help-window (hypb:help-buf-name "Koutliner")
-      (save-excursion
-       (if (not all-flag)
-           (kotl-mode:print-attributes kview)
-         (let ((label-sep-len (kview:label-separator-length kview)))
-           (kotl-mode:beginning-of-buffer)
-           (while (progn (kotl-mode:print-attributes kview)
-                         (kcell-view:next t label-sep-len)))))))))
+  (save-excursion
+    (if (not all-flag)
+       (kotl-mode:print-attributes kview)
+      (let ((label-sep-len (kview:label-separator-length kview)))
+       (kotl-mode:beginning-of-buffer)
+       (while (progn (kotl-mode:print-attributes kview)
+                     (kcell-view:next t label-sep-len)))))))
 
 (defun kotl-mode:cell-help (&optional cell-ref cells-flag)
   "Display a temporary buffer with CELL-REF's attributes.
 CELL-REF defaults to current cell.
-Optional prefix arg CELLS-FLAG selects the cells to print:
-  If = 1, print CELL-REF's cell only;
-  If > 1, print CELL-REF's visible tree (the tree rooted at CELL-REF);
-  If < 1, print all visible cells in current view (CELL-REF is not used).
+Optional prefix arg CELLS-FLAG selects the cells whose attributes are printed:
+  If =  1, print CELL-REF's cell only;
+  If >  1, print CELL-REF's visible tree (the tree rooted at CELL-REF);
+  If <= 0, print all visible cells in current view (CELL-REF is not used).
 
 See also the documentation for `kotl-mode:cell-attributes'."
   (interactive
-   (let* ((label (kcell-view:label)))
-     (append
-      (let ((arg (prefix-numeric-value current-prefix-arg)))
-       (if (< arg 1)
-           0
-         (hargs:iform-read
-          (list 'interactive
-                (format "+KDisplay properties of koutline %s: "
-                        (if (= arg 1) "cell" "tree")))
-         (list label label))))
-      (list current-prefix-arg))))
+   (append
+    (let ((arg (prefix-numeric-value current-prefix-arg)))
+      (if (< arg 1)
+         '("0")
+       (hargs:iform-read
+        (list 'interactive
+              (format "+KDisplay properties of koutline %s: "
+                      (if (= arg 1) "cell" "tree"))))))
+    (list current-prefix-arg)))
   (unless (integerp cells-flag)
+    ;; If cells-flag is nil, this sets it to 1
     (setq cells-flag (prefix-numeric-value cells-flag)))
   (unless (stringp cell-ref)
     (setq cell-ref (kcell-view:label)))
@@ -2907,23 +2916,22 @@ See also the documentation for 
`kotl-mode:cell-attributes'."
        (temp-buffer-show-function))
     (with-help-window (hypb:help-buf-name "Koutliner")
       (save-excursion
-       (if (equal cell-ref "0")
+       (if (or (member cell-ref '("0" 0))
+               (<= cells-flag 0))
            (progn
              (hattr:report (kcell:plist (kview:top-cell kview)))
              (terpri)
              (cond ((= cells-flag 1) nil)
                    ((> cells-flag 1)
                     (kview:map-tree #'kotl-mode:print-attributes kview t t))
-                   ;; (< cells-flag 1)
+                   ;; (<= cells-flag 0)
                    (t (kotl-mode:cell-attributes t))))
          (cond ((= cells-flag 1)
                 (kotl-mode:goto-cell cell-ref)
                 (kotl-mode:print-attributes kview))
                ((> cells-flag 1)
                 (kotl-mode:goto-cell cell-ref)
-                (kview:map-tree #'kotl-mode:print-attributes kview nil t))
-               ;; (< cells-flag 1)
-               (t (kotl-mode:cell-attributes t))))))))
+                (kview:map-tree #'kotl-mode:print-attributes kview nil 
t))))))))
 
 (defun kotl-mode:get-cell-attribute (attribute &optional pos top-cell-flag)
   "Return ATTRIBUTE's value for the current cell or the cell at optional POS.
@@ -3167,8 +3175,8 @@ this function to `pre-command-hook'."
 
 (defun kotl-mode:print-attributes (_kview)
   "Print to the `standard-output' stream the attributes of the current visible 
kcell.
-Takes argument KVIEW (so it can be used with `kview:map-tree' and so that
-KVIEW is bound correctly) but always operates upon the current view."
+Takes argument _KVIEW (so it can be used with `kview:map-tree') but always 
operates
+upon the current view."
   ;; Move to start of visible cell to avoid printing attributes for an
   ;; invisible kcell which point may be over.
   ;; Print first line of cell for reference.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]