[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org-real 35c3857 106/160: Added metadata slot
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org-real 35c3857 106/160: Added metadata slot |
Date: |
Wed, 6 Oct 2021 16:58:26 -0400 (EDT) |
branch: externals/org-real
commit 35c3857cf4e3609cfe5d2338cec216954680b755
Author: Tyler Grinn <tylergrinn@gmail.com>
Commit: Tyler Grinn <tylergrinn@gmail.com>
Added metadata slot
---
org-real.el | 54 +++++++++++++++++++++++++++++++++++++++++-------------
1 file changed, 41 insertions(+), 13 deletions(-)
diff --git a/org-real.el b/org-real.el
index 1459813..a175aed 100644
--- a/org-real.el
+++ b/org-real.el
@@ -634,6 +634,14 @@ ORIG is `org-insert-link', ARGS are the arguments passed
to it."
:type string)
(rel :initarg :rel
:type string)
+ (primary :initarg :primary
+ :initform nil
+ :type boolean)
+ (locations :initarg :locations
+ :initform '()
+ :type list)
+ (metadata :initarg :metadata
+ :type string)
(rel-box :initarg :rel-box
:type org-real-box)
(x-order :initarg :x-order
@@ -677,16 +685,9 @@ ORIG is `org-insert-link', ARGS are the arguments passed
to it."
:type number)
(flex :initarg :flex
:initform nil
- :type boolean)
- (primary :initarg :primary
- :initform nil
- :type boolean)
- (locations :initarg :locations
- :initform '()
- :type list))
+ :type boolean))
"A representation of a box in 3D space.")
-
(cl-defmethod org-real--get-all ((collection org-real-box-collection))
"Get all boxes in COLLECTION as a sequence."
(with-slots (box next) collection
@@ -1065,7 +1066,7 @@ If INCLUDE-ON-TOP is non-nil, also include height on top
of box."
;;;; Org real mode buttons
(cl-defmethod org-real--create-cursor-functions ((box org-real-box))
- (with-slots (rel-box) box
+ (with-slots (rel rel-box name metadata) box
(lambda (_window _oldpos dir)
(let ((inhibit-read-only t)
(top (org-real--get-top box))
@@ -1073,6 +1074,13 @@ If INCLUDE-ON-TOP is non-nil, also include height on top
of box."
(save-excursion
(if (eq dir 'entered)
(progn
+ (if (slot-boundp box :metadata)
+ (message metadata)
+ (if (slot-boundp box :name)
+ (if (slot-boundp box :rel)
+ (with-slots ((rel-name name)) rel-box
+ (message "The %s is %s the %s." name rel rel-name))
+ (message "The %s." name))))
(if (slot-boundp box :rel-box)
(org-real--draw rel-box 'rel))
(org-real--draw box 'selected))
@@ -1617,23 +1625,41 @@ characters if possible."
(with-current-buffer (marker-buffer (car locations))
(let* ((partitioned (seq-group-by
(lambda (h)
- (let ((child-rel (or (org-entry-get
(org-element-property :begin h) "REL") "in")))
+ (let ((child-rel (or (org-entry-get
+ (org-element-property
:begin h)
+ "REL")
+ "in")))
(if (member child-rel
org-real-children-prepositions)
'children
'siblings)))
(cddr headline)))
(children (alist-get 'children partitioned))
(siblings (alist-get 'siblings partitioned))
- (pos (org-element-property :begin headline))
- (rel (or (org-entry-get pos "REL") "in"))
+ (pos (goto-char (org-element-property :begin headline)))
+ (columns (org-columns--collect-values org-columns-current-fmt))
+ (max-column-length (apply 'max 0
+ (mapcar
+ (lambda (column)
+ (length (cadr (car column))))
+ columns)))
+ (rel (or (org-entry-get nil "REL") "in"))
(level (if (member rel org-real-children-prepositions)
(+ 1 parent-level)
parent-level))
- (box (org-real-box :name (org-element-property :title headline)
+ (name (org-element-property :title headline))
+ (box (org-real-box :name name
:rel rel
:level level
:rel-box parent
:parent parent
+ :metadata (mapconcat
+ (lambda (column)
+ (format
+ (concat "%-" (number-to-string
max-column-length) "s : %s")
+ (cadr (car column))
+ (cadr column)))
+ columns
+ "\n")
:locations (list (set-marker (point-marker)
pos))
:in-front (string= rel "in front of")
:on-top (string= rel "on top of")
@@ -1763,12 +1789,14 @@ set to the :loc slot of each box."
(defun org-real--parse-headlines ()
"Create an org real box from the current buffer's headlines."
+ (org-columns-get-format)
(let* ((headlines (cddr (org-element-parse-buffer 'headline)))
(filename (buffer-file-name))
(title (or (concat (file-name-base filename) "." (file-name-extension
filename))
"Document"))
(world (org-real-box))
(document (org-real-box :name title
+ :metadata title
:locations (list (point-min-marker)))))
(org-real--flex-add document world)
(mapc
- [elpa] externals/org-real 44e82f9 120/160: Added calculate functionality to is-visible, (continued)
- [elpa] externals/org-real 44e82f9 120/160: Added calculate functionality to is-visible, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real c916d88 142/160: Draw selected box last, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real 3618967 137/160: Merge branch 'next' into 'main', ELPA Syncer, 2021/10/06
- [elpa] externals/org-real f933ebc 055/160: More edge cases, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real b32309c 056/160: Don't highlight children when following link, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real 52f3d15 063/160: Satisfy elc compiler, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real cbadc3a 065/160: Merge branch 'next' into 'main', ELPA Syncer, 2021/10/06
- [elpa] externals/org-real c32c714 074/160: Org real headlines takes over current window, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real 4e903f9 090/160: Draw without canvas: no more whitespace around box diagram, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real 61eea2d 091/160: Auto-fill description when inserting link, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real 35c3857 106/160: Added metadata slot,
ELPA Syncer <=
- [elpa] externals/org-real e9f758a 102/160: Fully expand siblings when toggling global visibility, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real 7d5574d 126/160: Adding margin and padding tests, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real da816c2 122/160: Merge branch 'next' into 'main', ELPA Syncer, 2021/10/06
- [elpa] externals/org-real b4373e7 123/160: Only flex adjusting necessary boxes, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real c5fc5a2 127/160: Merge branch 'next' into 'main', ELPA Syncer, 2021/10/06
- [elpa] externals/org-real 58989c3 121/160: Use cartesian distance for cycle up/down, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real e4abd0e 118/160: Reworked flexible layout, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real 93cb91e 133/160: Linting/elc, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real eb796dd 149/160: Regression: primary boxes should be highlighted, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real 9ab2ad0 158/160: Merge branch 'next' into 'main', ELPA Syncer, 2021/10/06