[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org-real f94678b0b4 138/188: Refactoring
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org-real f94678b0b4 138/188: Refactoring |
Date: |
Sun, 5 May 2024 22:56:03 -0400 (EDT) |
branch: externals/org-real
commit f94678b0b4724fabf2f0fc7fdc9379c847340455
Author: Amy Grinn <grinn.amy@gmail.com>
Commit: Amy Grinn <grinn.amy@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 9cef1434a7..ca2c5544eb 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 0dd0b57ef6..c6f6f1b981 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 c82d557eb4 066/188: v0.2.0, (continued)
- [elpa] externals/org-real c82d557eb4 066/188: v0.2.0, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 3b123018dd 078/188: Reuse window if org real diagram already visible, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real f24300e466 077/188: Complete redesign, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 199a3d2618 091/188: Auto-fill description when inserting link, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 5164b5eb0a 081/188: Org real headlines switched to add-next, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 3fb7433610 110/188: Updated customizations; color scheme, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real eec4aca3e8 127/188: Merge branch 'next' into 'main', ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 2d6e5e169a 132/188: Fixed hiding of rel-box border, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 3071147c1e 130/188: Allow boxes to not have location markers, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 2c716d3e54 134/188: Merge branch 'main' into next, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real f94678b0b4 138/188: Refactoring,
ELPA Syncer <=
- [elpa] externals/org-real 8c032c1b9f 141/188: Updated readme, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real db9f38f413 142/188: Draw selected box last, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 760925984e 156/188: Changed cl-defmethod to defun; linting, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 668a60cb43 139/188: Merge display-rel-box, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real e7c6fb4c14 148/188: Add submodules during ci/cd pipeline, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real f93714689a 149/188: Regression: primary boxes should be highlighted, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 0eb43ca002 115/188: Redesigned tooltips, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 89a03be54a 119/188: Use original relationship for tooltip if changed, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real a325418d4a 122/188: Merge branch 'next' into 'main', ELPA Syncer, 2024/05/05
- [elpa] externals/org-real b9af670298 129/188: Added is-plural, ELPA Syncer, 2024/05/05