diff options
| author | Eli Zaretskii | 2017-12-10 19:45:25 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2017-12-10 19:45:25 +0200 |
| commit | 87baf1242e9c0130148e5547804db6f1fbfb8c55 (patch) | |
| tree | d92c106ae560805f32793ed71f4084dc2fda66ba | |
| parent | d23158777de46dd23444d00ffa05f46a3597c0e3 (diff) | |
| download | emacs-87baf1242e9c0130148e5547804db6f1fbfb8c55.tar.gz emacs-87baf1242e9c0130148e5547804db6f1fbfb8c55.zip | |
Fix 'fontset-name-p'
* lisp/international/fontset.el (fontset-name-p): Make the
function work with full fontset names and fontset alias names.
| -rw-r--r-- | lisp/international/fontset.el | 12 |
1 files 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." | |||
| 1147 | (defun fontset-name-p (fontset) | 1147 | (defun fontset-name-p (fontset) |
| 1148 | "Return non-nil if FONTSET is valid as fontset name. | 1148 | "Return non-nil if FONTSET is valid as fontset name. |
| 1149 | A valid fontset name should conform to XLFD (X Logical Font Description) | 1149 | A valid fontset name should conform to XLFD (X Logical Font Description) |
| 1150 | with \"fontset\" in `<CHARSET_REGISTRY>' field." | 1150 | with \"fontset-SOMETHING\" in `<CHARSET_REGISTRY>' field. |
| 1151 | (and (string-match xlfd-tight-regexp fontset) | 1151 | A fontset alias name recorded in `fontset-alias-alist' is also a valid |
| 1152 | (string= (match-string (1+ xlfd-regexp-registry-subnum) fontset) | 1152 | fontset name." |
| 1153 | "fontset"))) | 1153 | (or (and (string-match xlfd-tight-regexp fontset) |
| 1154 | (let ((registry | ||
| 1155 | (match-string (1+ xlfd-regexp-registry-subnum) fontset))) | ||
| 1156 | (= 0 (string-match "\\`fontset-" registry)))) | ||
| 1157 | (consp (rassoc fontset fontset-alias-alist)))) | ||
| 1154 | 1158 | ||
| 1155 | (declare-function fontset-list "fontset.c" ()) | 1159 | (declare-function fontset-list "fontset.c" ()) |
| 1156 | 1160 | ||