From 87baf1242e9c0130148e5547804db6f1fbfb8c55 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 10 Dec 2017 19:45:25 +0200 Subject: [PATCH] Fix 'fontset-name-p' * lisp/international/fontset.el (fontset-name-p): Make the function work with full fontset names and fontset alias names. --- lisp/international/fontset.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lisp/international/fontset.el b/lisp/international/fontset.el index c6c62ef0a0c..b7511d90b41 100644 --- a/lisp/international/fontset.el +++ b/lisp/international/fontset.el @@ -1147,10 +1147,14 @@ given from DEFAULT-SPEC." (defun fontset-name-p (fontset) "Return non-nil if FONTSET is valid as fontset name. A valid fontset name should conform to XLFD (X Logical Font Description) -with \"fontset\" in `' field." - (and (string-match xlfd-tight-regexp fontset) - (string= (match-string (1+ xlfd-regexp-registry-subnum) fontset) - "fontset"))) +with \"fontset-SOMETHING\" in `' field. +A fontset alias name recorded in `fontset-alias-alist' is also a valid +fontset name." + (or (and (string-match xlfd-tight-regexp fontset) + (let ((registry + (match-string (1+ xlfd-regexp-registry-subnum) fontset))) + (= 0 (string-match "\\`fontset-" registry)))) + (consp (rassoc fontset fontset-alias-alist)))) (declare-function fontset-list "fontset.c" ()) -- 2.39.2