[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org-modern f60c7a4f2c 3/4: Fix org-modern-keyword repla
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org-modern f60c7a4f2c 3/4: Fix org-modern-keyword replacement |
Date: |
Fri, 3 Jun 2022 10:57:55 -0400 (EDT) |
branch: externals/org-modern
commit f60c7a4f2c552fd042c93ea0ba2fd6322131a0ad
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Fix org-modern-keyword replacement
---
org-modern.el | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/org-modern.el b/org-modern.el
index a7ca6fc9ff..205f225086 100644
--- a/org-modern.el
+++ b/org-modern.el
@@ -291,12 +291,16 @@ You can specify a font `:family'. The font families
`Iosevka', `Hack' and
(defun org-modern--keyword ()
"Prettify keywords according to `org-modern-keyword'."
- (when-let (rep (cdr (or (assoc (match-string 2) org-modern-keyword)
- (assq t org-modern-keyword))))
- (if (stringp rep)
- (put-text-property (match-beginning 0) (1+ (match-end 0)) 'display
- (propertize rep 'face 'org-modern-symbol))
- (put-text-property (match-beginning 1) (match-end 1) 'invisible t))))
+ (let ((beg (match-beginning 0))
+ (end (1+ (match-end 0)))
+ (rep (assoc (match-string 2) org-modern-keyword)))
+ (unless rep
+ (setq rep (assq t org-modern-keyword) end (match-end 1)))
+ (pcase (cdr rep)
+ ('t (put-text-property beg (match-end 1) 'invisible t))
+ ((pred stringp)
+ (put-text-property beg end 'display
+ (propertize (cdr rep) 'face 'org-modern-symbol))))))
(defun org-modern--statistics ()
"Prettify headline todo statistics."