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

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

[elpa] externals/org-real a909323 017/160: Shift other things to the rig


From: ELPA Syncer
Subject: [elpa] externals/org-real a909323 017/160: Shift other things to the right or below when merging
Date: Wed, 6 Oct 2021 16:58:06 -0400 (EDT)

branch: externals/org-real
commit a90932310491bf7a4608cbc4341fc8a8c9301cfb
Author: Tyler Grinn <tylergrinn@gmail.com>
Commit: Tyler Grinn <tylergrinn@gmail.com>

    Shift other things to the right or below when merging
---
 garage.org  |  2 ++
 org-real.el | 14 ++++++++++++--
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/garage.org b/garage.org
index b8ebb4b..f7d1775 100644
--- a/garage.org
+++ b/garage.org
@@ -6,3 +6,5 @@
   - [[real://garage/east wall?rel=in/rake?rel=on/shovel?rel=to the left 
of][shovel]]
   - [[real://garage/east wall?rel=in/rake?rel=on/hoe?rel=to the left of][hoe]]
   - 
[[real://garage/workbench?rel=in/wrench?rel=on/paintbrush?rel=above][paintbrush]]
+  - [[real://garage/workbench?rel=in/ratchet?rel=on/hammer?rel=to the right 
of][hammer]]
+  - [[real://garage/workbench?rel=in/ratchet?rel=on/nails?rel=to the right 
of][nails]]
diff --git a/org-real.el b/org-real.el
index ff858f1..be394f6 100644
--- a/org-real.el
+++ b/org-real.el
@@ -274,11 +274,21 @@ of BOX."
            (oset next :x-order (oref match :x-order))
            (oset next :behind (oref match :behind)))
           ((string= rel "below")
+           (let ((y-order (oref match :y-order)))
+             (oset next :y-order (+ 1 y-order))
+             (org-real--map-immediate
+              (lambda (box) (when (> (oref box :y-order) y-order)
+                              (oset box :y-order (+ 1 (oref box :y-order)))))
+              match))
            (oset next :x-order (oref match :x-order))
-           (oset next :y-order (+ 1 (oref match :y-order)))
            (oset next :behind (oref match :behind)))
           ((string= rel "to the right of")
-           (oset next :x-order (+ 1 (oref match :x-order)))
+           (let ((x-order (oref match :x-order)))
+             (oset next :x-order (+ 1 x-order))
+             (org-real--map-immediate
+              (lambda (box) (when (> (oref box :x-order) x-order)
+                              (oset box :x-order (+ 1 (oref box :x-order)))))
+              match))
            (oset next :y-order (oref match :y-order))
            (oset next :behind (oref match :behind))
            (oset next :in-front (oref match :in-front)))



reply via email to

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