branch: externals/show-font
commit 3695bfb838728dad1ac67087998175516a7ad936
Author: Protesilaos Stavrou <[email protected]>
Commit: Protesilaos Stavrou <[email protected]>
Add error condition to show-font-select-preview
---
show-font.el | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/show-font.el b/show-font.el
index e03bd664e8..759ddf4a3d 100644
--- a/show-font.el
+++ b/show-font.el
@@ -380,13 +380,14 @@ FAMILY is a string that satisfies
`show-font-installed-p'."
(interactive
(list
(show-font--select-preview-prompt)))
- (when (show-font-installed-p family)
- (show-font-with-preview-buffer (format "*show-font preview of `%s'*"
family)
- (save-excursion
- (insert (show-font--prepare-text family)))
- (setq-local revert-buffer-function
- (lambda (_ignore-auto _noconfirm)
- (show-font-select-preview family))))))
+ (if (show-font-installed-p family)
+ (show-font-with-preview-buffer (format "*show-font preview of `%s'*"
family)
+ (save-excursion
+ (insert (show-font--prepare-text family)))
+ (setq-local revert-buffer-function
+ (lambda (_ignore-auto _noconfirm)
+ (show-font-select-preview family))))
+ (error "The font family `%s' does not seem to be installed" family)))
;;;; Preview fonts in a list