From 705e8d4b7b3dfc0e70fe634d223ceea81661de1e Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 22 Dec 2020 00:14:58 -0600 Subject: Correct set-face-from-alternatives function --- README.md | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index a35da41..9e0e26d 100644 --- a/README.md +++ b/README.md @@ -398,18 +398,14 @@ from [link0ff](https://github.com/link0ff/emacs-init). 1. Define fonts - (defun font-candidate (&rest fonts) - (catch :font - (dolist (font fonts) - (if (find-font (font-spec :name font)) - (throw :font font))))) - (defun set-face-from-alternatives (face fonts) - (dolist (font fonts) - (if (find-font (font-spec :family (car font))) + (catch :return + (dolist (font fonts) + (when (find-font (font-spec :family (car font))) (apply #'set-face-attribute `(,face nil :family ,(car font) - ,@(cdr font)))))) + ,@(cdr font))) + (throw :return font))))) (defun acdw/setup-fonts () "Setup fonts. This has to happen after the frame is setup for -- cgit 1.4.1-21-gabe81