[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org-modern 5749fb7c8f 1/2: Add support for radio links
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org-modern 5749fb7c8f 1/2: Add support for radio links |
Date: |
Sat, 4 Jun 2022 02:57:43 -0400 (EDT) |
branch: externals/org-modern
commit 5749fb7c8f25fc5975934b448e8c63437ffb0f4e
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Add support for radio links
---
example.org | 4 ++++
org-modern.el | 23 +++++++++++++++++++----
2 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/example.org b/example.org
index a7da047753..1f2bb8a8f0 100644
--- a/example.org
+++ b/example.org
@@ -98,4 +98,8 @@ TREPEATED: <2022-02-26 Sat 10:00 .+1d/2d>
<<This is an internal link>>
+<<<radio link>>>
+
[[This is an internal link]]
+
+radio link
diff --git a/org-modern.el b/org-modern.el
index 80332f5a06..e17ea3d2bc 100644
--- a/org-modern.el
+++ b/org-modern.el
@@ -175,7 +175,11 @@ used as replacement for \"#+keyword:\", with t the default
key."
(const :tag "Hide prefix" t)))))
(defcustom org-modern-internal-link '(" ↪ " t " ")
- "Prettify internal links, e.g., <<introduction>>."
+ "Prettify internal link targets, e.g., <<introduction>>."
+ :type '(choice (const nil) (list string boolean string)))
+
+(defcustom org-modern-radio-link '(" ⛯ " t " ")
+ "Prettify radio link targets, e.g., <<<radio>>>."
:type '(choice (const nil) (list string boolean string)))
(defcustom org-modern-statistics t
@@ -219,7 +223,11 @@ You can specify a font `:family'. The font families
`Iosevka', `Hack' and
(defface org-modern-internal-link
'((t :inherit org-modern-done))
- "Face used for internal link.")
+ "Face used for internal link targets.")
+
+(defface org-modern-radio-link
+ '((t :inherit org-modern-done))
+ "Face used for radio link targets.")
(defface org-modern-done
'((default :inherit org-modern-label)
@@ -559,12 +567,19 @@ You can specify a font `:family'. The font families
`Iosevka', `Hack' and
`((,(concat "^\\*+.*?\\( \\)\\(:\\(?:" org-tag-re ":\\)+\\)[ \t]*$")
(0 (org-modern--tag)))))
(when org-modern-internal-link
- `(("\\(<<\\)\\(.+?\\)\\(>>\\)"
+ `(("\\(<<\\)\\([^<].*?\\)\\(>>\\)"
(0 '(face org-modern-internal-link) t)
(1 '(face nil display ,(car org-modern-internal-link)))
(3 '(face nil display ,(caddr org-modern-internal-link)))
,@(unless (cadr org-modern-internal-link)
- '((2 '(face nil invisible t)))))))
+ '((2 '(face nil invisible t)))))))
+ (when org-modern-radio-link
+ `(("\\(<<<\\)\\(.+?\\)\\(>>>\\)"
+ (0 '(face org-modern-radio-link) t)
+ (1 '(face nil display ,(car org-modern-radio-link)))
+ (3 '(face nil display ,(caddr org-modern-radio-link)))
+ ,@(unless (cadr org-modern-radio-link)
+ '((2 '(face nil invisible t)))))))
(when org-modern-timestamp
'(("\\(?:<\\|\\[\\)\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}\\(?:
[[:word:]]+\\)?\\(?: [.+-]+[0-9ymwdh/]+\\)*\\)\\(\\(?: [0-9:-]+\\)?\\(?:
[.+-]+[0-9ymwdh/]+\\)*\\)\\(?:>\\|\\]\\)"
(0 (org-modern--timestamp)))