branch: externals/fontaine
commit 656efead2a69ec183900c6522066727914888cb0
Author: Protesilaos Stavrou <i...@protesilaos.com>
Commit: Protesilaos Stavrou <i...@protesilaos.com>

    Simplify sample config for setting a preset
    
    Thanks to Christopher League for proposing an elegant expression over at
    the fontaine mailing list:
    
<https://lists.sr.ht/~protesilaos/fontaine/%3c87sfpop0dm....@contrapunctus.net%3E#%3c87pmksoyv6....@contrapunctus.net%3E>
---
 README.org | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/README.org b/README.org
index 956ef6e7b9..77611d4e0a 100644
--- a/README.org
+++ b/README.org
@@ -254,13 +254,9 @@ Remember to read the relevant doc strings.
          :italic-slant italic
          :line-spacing 1)))
 
-(fontaine-restore-latest-preset)
-
-;; Use `fontaine-recovered-preset' if available, else fall back to the
-;; desired style from `fontaine-presets'.
-(if-let ((state fontaine-recovered-preset))
-    (fontaine-set-preset state)
-  (fontaine-set-preset 'regular))
+;; Recover last preset or fall back to desired style from
+;; `fontaine-presets'.
+(fontaine-set-preset (or (fontaine-restore-latest-preset) 'regular))
 
 ;; The other side of `fontaine-restore-latest-preset'.
 (add-hook 'kill-emacs-hook #'fontaine-store-latest-preset)
@@ -283,7 +279,7 @@ Fontaine is meant to be a collective effort.  Every bit of 
help matters.
 
 + Author/maintainer :: Protesilaos Stavrou.
 
-+ Contributions to the code or manual :: Eli Zaretskii.
++ Contributions to the code or manual :: Christopher League, Eli Zaretskii.
 
 * GNU Free Documentation License
 :PROPERTIES:

Reply via email to