[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org-real ea82c415f2 003/188: Added primary slot to colo
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org-real ea82c415f2 003/188: Added primary slot to color last element in url |
Date: |
Sun, 5 May 2024 22:55:48 -0400 (EDT) |
branch: externals/org-real
commit ea82c415f2aebc0161aa7f8b88d12f20c14da53d
Author: Amy Grinn <grinn.amy@gmail.com>
Commit: Amy Grinn <grinn.amy@gmail.com>
Added primary slot to color last element in url
---
org-real.el | 35 +++++++++++++++++++++++++++--------
1 file changed, 27 insertions(+), 8 deletions(-)
diff --git a/org-real.el b/org-real.el
index edeeca633d..13b08def57 100644
--- a/org-real.el
+++ b/org-real.el
@@ -26,7 +26,10 @@
:type org-real--box)
(children :initarg :children
:initform '()
- :type list)))
+ :type list)
+ (primary :initarg :primary
+ :initform nil
+ :type boolean)))
(defvar org-real-prepositions
'("in" "behind" "in front of" "above" "below" "to the left of" "to the right
of"))
@@ -81,11 +84,13 @@
(oset box :parent prev)
(object-add-to-list prev :children box)
(if containers
- (org-real--create-box containers prev box)))
+ (org-real--create-box containers prev box)
+ (oset box :primary t)))
(oset box :parent parent)
(object-add-to-list parent :children box)
(if containers
- (org-real--create-box containers parent box))))))
+ (org-real--create-box containers parent box)
+ (oset box :primary t))))))
(defun org-real--parse-url (str)
"Parse URL into an org real object"
@@ -131,13 +136,22 @@
(org-real--draw box offset)
(special-mode)))))
+(defface org-real-primary
+ '((t :background "aquamarine"
+ :foreground "black"))
+ "Face for the last thing in a url"
+ :group 'org-real)
+
(defun org-real--pp-text (containers)
(let* ((reversed (reverse containers))
- (container (pop reversed)))
+ (container (pop reversed))
+ (primary-name (plist-get container :name)))
(dotimes (_ (cdr org-real--padding)) (insert "\n"))
(insert (make-string (car org-real--padding) ?\s))
(insert "The ")
- (insert (plist-get container :name))
+ (put-text-property 0 (length primary-name) 'face 'org-real-primary
+ primary-name)
+ (insert primary-name)
(if reversed (insert " is"))
(while reversed
(insert " ")
@@ -158,10 +172,14 @@
(name (oref box :name))
(children (oref box :children))
(dashed (oref box :behind))
- (align-bottom (oref box :in-front)))
- (cl-flet ((draw (coords str)
+ (align-bottom (oref box :in-front))
+ (primary (oref box :primary)))
+ (cl-flet ((draw (coords str &optional primary)
(goto-line (car coords))
(move-to-column (cdr coords) t)
+ (if primary
+ (put-text-property 0 (length str) 'face
'org-real-primary
+ str))
(insert str)
(delete-char (length str))))
(draw (cons top left)
@@ -173,7 +191,8 @@
(concat "└" (make-string (- width 2) (if dashed #x254c
#x2500)) "┘")))
(draw (cons (+ top 1 (cdr org-real--padding))
(+ left 1 (car org-real--padding)))
- name)
+ name
+ primary)
(let ((r (+ top 1))
(c1 left)
(c2 (+ left width -1)))
- [elpa] externals/org-real d9ec07c0e3 182/188: Updated version, (continued)
- [elpa] externals/org-real d9ec07c0e3 182/188: Updated version, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 2883415acc 185/188: Updated documentation, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 07215e49e7 015/188: Updated README, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 594cbce6d5 092/188: Improved efficiency, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 33b69e62e0 152/188: Added license, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real e7bf6e5089 157/188: Added url-parse, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 4d86ca8c44 160/188: Merge branch 'next' into 'main', ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 1fa40be2c7 006/188: More edge cases, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 13502c70e2 018/188: Modified logic to allow multiple children, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real e5b21825e3 019/188: Updated preposition list, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real ea82c415f2 003/188: Added primary slot to color last element in url,
ELPA Syncer <=
- [elpa] externals/org-real 5ae3174c55 001/188: initial commit, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 51bbcc313a 028/188: Cleaned up hooks, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 101d6c9899 034/188: Added org-real-pkg for multifile package, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real d84a2a83f8 046/188: Updated readme, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real b0f741198d 044/188: Rearranging, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 6edfdeca01 049/188: Whitespace cleanup, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real c49cce501d 037/188: Check for compiler warnings in CI/CD pipeline, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real de8dc5a6c9 051/188: Added children when following a link, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 38dff3d9fe 055/188: More edge cases, ELPA Syncer, 2024/05/05
- [elpa] externals/org-real 68f4ecfc29 071/188: org-real-headlines; Added more keys to Org Real mode, ELPA Syncer, 2024/05/05