[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org-modern 83ee897ac1 63/65: Update face when org-moder
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org-modern 83ee897ac1 63/65: Update face when org-modern-variable-pitch is changed |
Date: |
Mon, 7 Mar 2022 12:57:49 -0500 (EST) |
branch: externals/org-modern
commit 83ee897ac18bfada7396eabe1220909d87dc1236
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Update face when org-modern-variable-pitch is changed
---
org-modern.el | 47 +++++++++++++++++++++++++----------------------
1 file changed, 25 insertions(+), 22 deletions(-)
diff --git a/org-modern.el b/org-modern.el
index 7fdfecfdf7..99cc8a207c 100644
--- a/org-modern.el
+++ b/org-modern.el
@@ -42,33 +42,38 @@
:prefix "org-modern-")
(defvar org-modern-label-border)
+(defvar org-modern-variable-pitch)
(defun org-modern--update-label-face ()
"Update border of the `org-modern-label' face."
(when (facep 'org-modern-label)
(set-face-attribute
- 'org-modern-label nil :box
- (when org-modern-label-border
- (let ((border (if (eq org-modern-label-border 'auto)
- (max 3 (cond
- ((integerp line-spacing) line-spacing)
- ((floatp line-spacing) (ceiling (*
line-spacing (frame-char-height))))
- (t (/ (frame-char-height) 10))))
- org-modern-label-border)))
- (list :color (face-attribute 'default :background nil t)
- :line-width
- ;; Emacs 28 supports different line horizontal and vertical
line widths
- (if (>= emacs-major-version 28)
- (cons 0 (- border))
- (- border))))))))
+ 'org-modern-label nil
+ :inherit (and org-modern-variable-pitch 'variable-pitch)
+ :box (when org-modern-label-border
+ (let ((border (if (eq org-modern-label-border 'auto)
+ (max 3 (cond
+ ((integerp line-spacing) line-spacing)
+ ((floatp line-spacing) (ceiling (*
line-spacing (frame-char-height))))
+ (t (/ (frame-char-height) 10))))
+ org-modern-label-border)))
+ (list :color (face-attribute 'default :background nil t)
+ :line-width
+ ;; Emacs 28 supports different line horizontal and
vertical line widths
+ (if (>= emacs-major-version 28)
+ (cons 0 (- border))
+ (- border))))))))
+
+(defun org-modern--setter (sym val)
+ "Set SYM to VAL and update faces."
+ (set sym val)
+ (org-modern--update-label-face))
(defcustom org-modern-label-border 'auto
"Line width used for tag label borders.
If set to `auto' the border width is computed based on the `line-spacing'.
A value between 0.1 and 0.4 of `line-spacing' is recommended."
:type '(choice (const nil) (const auto) integer)
- :set (lambda (sym val)
- (set sym val)
- (org-modern--update-label-face)))
+ :set #'org-modern--setter)
(defcustom org-modern-star ["◉""○""◈""◇""⁕"]
"Replacement strings for headline stars for each level.
@@ -154,7 +159,8 @@ Set to nil to disable the indicator."
(defcustom org-modern-variable-pitch t
"Prefer variable pitch for modern style."
- :type 'boolean)
+ :type 'boolean
+ :set #'org-modern--setter)
(defgroup org-modern-faces nil
"Faces used by `org-modern'."
@@ -163,10 +169,7 @@ Set to nil to disable the indicator."
:group 'faces)
(defface org-modern-label
- `((t ,@(and org-modern-variable-pitch '(:inherit variable-pitch))
- :height 0.9
- :width condensed :weight regular
- :underline nil))
+ `((t :height 0.9 :width condensed :weight regular :underline nil))
"Parent face for labels.")
(defface org-modern-block-keyword
- [elpa] externals/org-modern 6b13500969 38/65: Improve docstring, (continued)
- [elpa] externals/org-modern 6b13500969 38/65: Improve docstring, ELPA Syncer, 2022/03/07
- [elpa] externals/org-modern f45be59ff5 46/65: org-modern-keyword: Configurable replacement, ELPA Syncer, 2022/03/07
- [elpa] externals/org-modern b4d6b37eba 47/65: README: Expand on the current limitations, ELPA Syncer, 2022/03/07
- [elpa] externals/org-modern 5f132cd720 54/65: Fix statistics face, ELPA Syncer, 2022/03/07
- [elpa] externals/org-modern 7d741dba51 60/65: Take advantage of more flexible boxes on Emacs 28, ELPA Syncer, 2022/03/07
- [elpa] externals/org-modern e13be0f433 40/65: Preserve line-prefix and wrap-prefix if org-indent-mode is enabled (Fix #7), ELPA Syncer, 2022/03/07
- [elpa] externals/org-modern 4f5d010a9f 42/65: Use en-dash for list bullets, ELPA Syncer, 2022/03/07
- [elpa] externals/org-modern 394460be40 50/65: Document minimal setup (Fix #13), ELPA Syncer, 2022/03/07
- [elpa] externals/org-modern 37bbac24a0 55/65: Increase font sizes by default (See #19), ELPA Syncer, 2022/03/07
- [elpa] externals/org-modern a15d8353ed 61/65: Fix :type, ELPA Syncer, 2022/03/07
- [elpa] externals/org-modern 83ee897ac1 63/65: Update face when org-modern-variable-pitch is changed,
ELPA Syncer <=
- [elpa] externals/org-modern 7bce289ac6 62/65: Improve timestamp handling, ELPA Syncer, 2022/03/07
- [elpa] externals/org-modern 3baf87f80e 09/65: README: Mention manual installation, ELPA Syncer, 2022/03/07
- [elpa] externals/org-modern 5278d9787c 01/65: Initial commit, ELPA Syncer, 2022/03/07
- [elpa] externals/org-modern 8c4bc6a320 12/65: Ensure that todo keywords stay editable (See #2), ELPA Syncer, 2022/03/07
- [elpa] externals/org-modern 664f57ae12 10/65: Add option org-modern-hide-stars, ELPA Syncer, 2022/03/07
- [elpa] externals/org-modern 1f0db02412 17/65: README reorganization, ELPA Syncer, 2022/03/07
- [elpa] externals/org-modern dbbb6c297c 18/65: Add license, ELPA Syncer, 2022/03/07
- [elpa] externals/org-modern 7a245a435d 24/65: Update example, ELPA Syncer, 2022/03/07
- [elpa] externals/org-modern 9510fa1550 25/65: Update example, ELPA Syncer, 2022/03/07
- [elpa] externals/org-modern 34b36df5b7 30/65: Use two different space objects, ELPA Syncer, 2022/03/07