[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org-real 193f14d 138/160: Refactoring
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org-real 193f14d 138/160: Refactoring |
Date: |
Wed, 6 Oct 2021 16:58:32 -0400 (EDT) |
branch: externals/org-real
commit 193f14d1e02f36e893e9e07fe765aa9faa9c9931
Author: Tyler Grinn <tylergrinn@gmail.com>
Commit: Tyler Grinn <tylergrinn@gmail.com>
Refactoring
---
demo/garage.org | 2 +-
org-real.el | 85 +++++++++++++++++++++++++++++----------------------------
2 files changed, 44 insertions(+), 43 deletions(-)
diff --git a/demo/garage.org b/demo/garage.org
index 9cef143..ca2c554 100644
--- a/demo/garage.org
+++ b/demo/garage.org
@@ -12,6 +12,6 @@
- [[real://garage/workbench/nails?rel=on top of][nails]]
- [[real://garage/east wall][East wall]]
- [[real://garage/east wall/rake?rel=on/hoe?rel=to the left
of/snowblower?rel=above][snowblower]]
- - [[real://garage/workbench/hammer?rel=on/screws?rel=to the right
of][screws]]
+ - [[real://garage/workbench/nails?rel=on top of/screws?rel=above][screws]]
- [[real://garage/saw?rel=on][saw]]
- [[real://garage/workbench/paintbrush?rel=in front of/wrench?rel=to the
left of/pliers?rel=below][pliers]]
diff --git a/org-real.el b/org-real.el
index 0dd0b57..c6f6f1b 100644
--- a/org-real.el
+++ b/org-real.el
@@ -1213,50 +1213,51 @@ If INCLUDE-ON-TOP is non-nil, also include height on
top of box."
(cl-defmethod org-real--create-cursor-function ((box org-real-box))
"Create cursor functions for entering and leaving BOX."
- (with-slots (rel rel-box display-rel-box display-rel name metadata
help-echo) box
+ (with-slots
+ ((actual-rel rel)
+ (actual-rel-box rel-box)
+ display-rel-box
+ display-rel
+ name
+ metadata
+ help-echo)
+ box
(let (tooltip-timer)
(lambda (_window _oldpos dir)
- (let ((inhibit-read-only t))
- (save-excursion
- (if (eq dir 'entered)
- (progn
- (if (slot-boundp box :help-echo)
- (message help-echo))
- (if (slot-boundp box :metadata)
- (setq tooltip-timer (org-real--tooltip metadata))
- (if (and (slot-boundp box :name) (slot-boundp box :rel))
- (with-slots ((rel-name name)) (if (slot-boundp box
:display-rel-box)
- display-rel-box
- rel-box)
- (setq tooltip-timer
- (org-real--tooltip
- (with-temp-buffer
- (insert (format (concat "The %s "
- (if
(org-real--is-plural name) "are" "is")
- " %s the %s.")
- name
- (if (slot-boundp box
:display-rel)
- display-rel
- rel)
- rel-name))
- (let ((fill-column
org-real-tooltip-max-width))
- (fill-paragraph t))
- (buffer-string)))))))
- (if (slot-boundp box :display-rel-box)
- (if (org-real--is-visible display-rel-box t)
- (org-real--draw display-rel-box 'rel))
- (if (and (slot-boundp box :rel-box)
- (org-real--is-visible rel-box t))
- (org-real--draw rel-box 'rel)))
- (org-real--draw box 'selected))
- (if tooltip-timer (cancel-timer tooltip-timer))
- (if (slot-boundp box :display-rel-box)
- (if (org-real--is-visible display-rel-box t)
- (org-real--draw display-rel-box t))
- (if (and (slot-boundp box :rel-box)
- (org-real--is-visible rel-box t))
- (org-real--draw rel-box t)))
- (org-real--draw box t))))))))
+ (let* ((rel-box (and (slot-boundp box :rel-box)
+ (if (slot-boundp box :display-rel-box)
+ display-rel-box
+ actual-rel-box)))
+ (visible-rel-box rel-box))
+ (while (and visible-rel-box (not (org-real--is-visible
visible-rel-box t)))
+ (setq visible-rel-box (with-slots (parent) visible-rel-box
parent)))
+ (when (eq dir 'entered)
+ (save-excursion
+ (let ((inhibit-read-only t))
+ (org-real--draw box 'selected)
+ (if visible-rel-box (org-real--draw visible-rel-box 'rel))))
+ (if (slot-boundp box :help-echo) (message help-echo))
+ (if (slot-boundp box :metadata)
+ (setq tooltip-timer (org-real--tooltip metadata))
+ (if (and (slot-boundp box :name) rel-box)
+ (let ((rel-name (with-slots (name) rel-box name))
+ (rel (if (slot-boundp box :display-rel) display-rel
actual-rel)))
+ (setq tooltip-timer
+ (org-real--tooltip
+ (with-temp-buffer
+ (insert (format (concat "The %s "
+ (if (org-real--is-plural
name) "are" "is")
+ " %s the %s.")
+ name rel rel-name))
+ (let ((fill-column org-real-tooltip-max-width))
+ (fill-paragraph t))
+ (buffer-string))))))))
+ (when (eq dir 'left)
+ (save-excursion
+ (let ((inhibit-read-only t))
+ (org-real--draw box t)
+ (if visible-rel-box (org-real--draw visible-rel-box t))))
+ (if tooltip-timer (cancel-timer tooltip-timer))))))))
(cl-defmethod org-real--jump-other-window ((box org-real-box))
"Jump to location of link for BOX in other window."
- [elpa] externals/org-real 0d25274 084/160: Passing edge cases, (continued)
- [elpa] externals/org-real 0d25274 084/160: Passing edge cases, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real 8f7ef62 085/160: Updated readme, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real 87dfecc 081/160: Org real headlines switched to add-next, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real e0d81ab 098/160: Bump version, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real a8e336d 095/160: Typo in flex-adjust, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real 5fb78c3 108/160: Skip adding box if it already exists, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real 900f96a 129/160: Added is-plural, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real fb056dc 078/160: Reuse window if org real diagram already visible, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real 4cc110c 086/160: Added document container to org-real-headlines, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real 4246089 096/160: Rotate locations of box when cycling, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real 193f14d 138/160: Refactoring,
ELPA Syncer <=
- [elpa] externals/org-real 7e51167 128/160: Linting/documentation, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real 0c93bd8 141/160: Updated readme, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real 186830b 060/160: Detect return and backspace without gui, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real f80251e 116/160: Merge branch 'next' into 'main', ELPA Syncer, 2021/10/06
- [elpa] externals/org-real 20d9631 147/160: Added boxy dependency, ELPA Syncer, 2021/10/06
- [elpa] externals/org-real 639ee73 069/160: Using save-excursion when applying changes, ELPA Syncer, 2021/10/06