aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/international/fontset.el17
1 files changed, 12 insertions, 5 deletions
diff --git a/lisp/international/fontset.el b/lisp/international/fontset.el
index aaa53d88fe5..1d53cad219b 100644
--- a/lisp/international/fontset.el
+++ b/lisp/international/fontset.el
@@ -282,6 +282,9 @@ Emacs tries to open fonts in this order."
282 (cons (list fontname style-ignored size-ignored both-ignored) 282 (cons (list fontname style-ignored size-ignored both-ignored)
283 alternate-fontname-alist)))))) 283 alternate-fontname-alist))))))
284 284
285;; Just to avoid compiler waring. The gloval value is never used.
286(defvar resolved-ascii-font nil)
287
285(defun x-complement-fontset-spec (xlfd-fields fontlist) 288(defun x-complement-fontset-spec (xlfd-fields fontlist)
286 "Complement FONTLIST for all charsets based on XLFD-FIELDS and return it. 289 "Complement FONTLIST for all charsets based on XLFD-FIELDS and return it.
287XLFD-FIELDS is a vector of XLFD (X Logical Font Description) fields. 290XLFD-FIELDS is a vector of XLFD (X Logical Font Description) fields.
@@ -289,7 +292,10 @@ FONTLIST is an alist of charsets vs the corresponding font names.
289 292
290Font names for charsets not listed in FONTLIST are generated from 293Font names for charsets not listed in FONTLIST are generated from
291XLFD-FIELDS and a property of x-charset-registry of each charset 294XLFD-FIELDS and a property of x-charset-registry of each charset
292automatically." 295automatically.
296
297By side effect, this sets `resolved-ascii-font' to the resolved name
298of ASCII font."
293 (let ((charsets charset-list) 299 (let ((charsets charset-list)
294 (xlfd-fields-non-ascii (copy-sequence xlfd-fields)) 300 (xlfd-fields-non-ascii (copy-sequence xlfd-fields))
295 (new-fontlist nil)) 301 (new-fontlist nil))
@@ -330,14 +336,16 @@ automatically."
330 ;; on x-charset-registry in the previous code. 336 ;; on x-charset-registry in the previous code.
331 (while l 337 (while l
332 (if (string-match (car (car l)) ascii-font) 338 (if (string-match (car (car l)) ascii-font)
333 (let ((charsets (cdr (car l)))) 339 (let ((charsets (cdr (car l)))
340 slot2)
334 (while charsets 341 (while charsets
335 (if (and (not (eq (car charsets) 'ascii)) 342 (if (and (not (eq (car charsets) 'ascii))
336 (setq slot (assq (car charsets) new-fontlist))) 343 (setq slot2 (assq (car charsets) new-fontlist)))
337 (setcdr slot ascii-font)) 344 (setcdr slot2 (cdr slot)))
338 (setq charsets (cdr charsets))) 345 (setq charsets (cdr charsets)))
339 (setq l nil)) 346 (setq l nil))
340 (setq l (cdr l)))) 347 (setq l (cdr l))))
348 (setq resolved-ascii-font ascii-font)
341 (append fontlist new-fontlist)))))) 349 (append fontlist new-fontlist))))))
342 350
343(defun fontset-name-p (fontset) 351(defun fontset-name-p (fontset)
@@ -494,7 +502,6 @@ It returns a name of the created fontset."
494 (or (rassoc alias fontset-alias-alist) 502 (or (rassoc alias fontset-alias-alist)
495 (setq fontset-alias-alist 503 (setq fontset-alias-alist
496 (cons (cons name alias) fontset-alias-alist))))) 504 (cons (cons name alias) fontset-alias-alist)))))
497 (setq resolved-ascii-font (cdr (assq 'ascii full-fontlist)))
498 (setq fontset-alias-alist 505 (setq fontset-alias-alist
499 (cons (cons name resolved-ascii-font) 506 (cons (cons name resolved-ascii-font)
500 fontset-alias-alist)) 507 fontset-alias-alist))