comparison src/fontset.c @ 24585:6810d6fb639f

(Fquery_fontset): Don't check for fontset aliases here. (Fnew_fontset, Fset_fontset_font): Check for them here. (Ffontset_info, Fnew_fontset, Fset_fontset_font): Fix error message syntax.
author Richard M. Stallman <rms@gnu.org>
date Wed, 07 Apr 1999 23:35:12 +0000
parents 73f09e7bc96e
children a16dadaa425d
comparison
equal deleted inserted replaced
24584:244e710f3134 24585:6810d6fb639f
445 445
446 return CACHED_FONTSET_REGEX; 446 return CACHED_FONTSET_REGEX;
447 } 447 }
448 448
449 DEFUN ("query-fontset", Fquery_fontset, Squery_fontset, 1, 2, 0, 449 DEFUN ("query-fontset", Fquery_fontset, Squery_fontset, 1, 2, 0,
450 "Return a fontset name which matches PATTERN, nil if no matching fontset.\n\ 450 "Return the name of an existing fontset which matches PATTERN.\n\
451 PATTERN can contain `*' or `?' as a wild card\n\ 451 The value is nil if there is no matching fontset.\n\
452 just like X's font name matching algorithm allows.\n\ 452 PATTERN can contain `*' or `?' as a wildcard\n\
453 If REGEXPP is non-nil, pattern is regexp;\n\ 453 just as X font name matching algorithm allows.\n\
454 so PATTERN is considered as regular expression.") 454 If REGEXPP is non-nil, PATTERN is a regular expression.")
455 (pattern, regexpp) 455 (pattern, regexpp)
456 Lisp_Object pattern, regexpp; 456 Lisp_Object pattern, regexpp;
457 { 457 {
458 Lisp_Object regexp, tem; 458 Lisp_Object regexp, tem;
459 459
461 461
462 CHECK_STRING (pattern, 0); 462 CHECK_STRING (pattern, 0);
463 463
464 if (XSTRING (pattern)->size == 0) 464 if (XSTRING (pattern)->size == 0)
465 return Qnil; 465 return Qnil;
466
467 tem = Frassoc (pattern, Vfontset_alias_alist);
468 if (!NILP (tem))
469 return Fcar (tem);
470 466
471 if (NILP (regexpp)) 467 if (NILP (regexpp))
472 regexp = fontset_pattern_regexp (pattern); 468 regexp = fontset_pattern_regexp (pattern);
473 else 469 else
474 regexp = pattern; 470 regexp = pattern;
559 FONTLIST is an alist of charsets vs corresponding font names.") 555 FONTLIST is an alist of charsets vs corresponding font names.")
560 (name, fontlist) 556 (name, fontlist)
561 Lisp_Object name, fontlist; 557 Lisp_Object name, fontlist;
562 { 558 {
563 Lisp_Object fullname, fontset_info; 559 Lisp_Object fullname, fontset_info;
564 Lisp_Object tail; 560 Lisp_Object tail, tem;
565 561
566 (*check_window_system_func) (); 562 (*check_window_system_func) ();
567 563
568 CHECK_STRING (name, 0); 564 CHECK_STRING (name, 0);
569 CHECK_LIST (fontlist, 1); 565 CHECK_LIST (fontlist, 1);
570 566
567 tem = Frassoc (name, Vfontset_alias_alist);
571 fullname = Fquery_fontset (name, Qnil); 568 fullname = Fquery_fontset (name, Qnil);
572 if (!NILP (fullname)) 569 if (!NILP (tem) || !NILP (fullname))
573 error ("Fontset \"%s\" matches the existing fontset \"%s\"", 570 error ("Fontset `%s' matches the existing fontset `%s'",
574 XSTRING (name)->data, XSTRING (fullname)->data); 571 XSTRING (name)->data, XSTRING (fullname)->data);
575 572
576 /* Check the validity of FONTLIST. */ 573 /* Check the validity of FONTLIST. */
577 for (tail = fontlist; CONSP (tail); tail = XCONS (tail)->cdr) 574 for (tail = fontlist; CONSP (tail); tail = XCONS (tail)->cdr)
578 { 575 {
609 (name, charset_symbol, fontname, frame) 606 (name, charset_symbol, fontname, frame)
610 Lisp_Object name, charset_symbol, fontname, frame; 607 Lisp_Object name, charset_symbol, fontname, frame;
611 { 608 {
612 int charset; 609 int charset;
613 Lisp_Object fullname, fontlist; 610 Lisp_Object fullname, fontlist;
611 Lisp_Object tem;
614 612
615 (*check_window_system_func) (); 613 (*check_window_system_func) ();
616 614
617 CHECK_STRING (name, 0); 615 CHECK_STRING (name, 0);
618 CHECK_SYMBOL (charset_symbol, 1); 616 CHECK_SYMBOL (charset_symbol, 1);
621 CHECK_LIVE_FRAME (frame, 3); 619 CHECK_LIVE_FRAME (frame, 3);
622 620
623 if ((charset = get_charset_id (charset_symbol)) < 0) 621 if ((charset = get_charset_id (charset_symbol)) < 0)
624 error ("Invalid charset: %s", XSYMBOL (charset_symbol)->name->data); 622 error ("Invalid charset: %s", XSYMBOL (charset_symbol)->name->data);
625 623
624 tem = Frassoc (name, Vfontset_alias_alist);
626 fullname = Fquery_fontset (name, Qnil); 625 fullname = Fquery_fontset (name, Qnil);
627 if (NILP (fullname)) 626 if (!NILP (tem) || !NILP (fullname))
628 error ("Fontset \"%s\" does not exist", XSTRING (name)->data); 627 error ("Fontset `%s' does not exist", XSTRING (name)->data);
629 628
630 /* If FRAME is not specified, we must, at first, update contents of 629 /* If FRAME is not specified, we must, at first, update contents of
631 `global-fontset-alist' for a frame created in the future. */ 630 `global-fontset-alist' for a frame created in the future. */
632 if (NILP (frame)) 631 if (NILP (frame))
633 { 632 {
768 f = XFRAME (frame); 767 f = XFRAME (frame);
769 } 768 }
770 769
771 fontset = fs_query_fontset (f, XSTRING (name)->data); 770 fontset = fs_query_fontset (f, XSTRING (name)->data);
772 if (fontset < 0) 771 if (fontset < 0)
773 error ("Fontset \"%s\" does not exist", XSTRING (name)->data); 772 error ("Fontset `%s' does not exist", XSTRING (name)->data);
774 773
775 info = Fmake_vector (make_number (3), Qnil); 774 info = Fmake_vector (make_number (3), Qnil);
776 775
777 fontsetp = FRAME_FONTSET_DATA (f)->fontset_table[fontset]; 776 fontsetp = FRAME_FONTSET_DATA (f)->fontset_table[fontset];
778 777