aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa1997-05-10 03:37:01 +0000
committerKenichi Handa1997-05-10 03:37:01 +0000
commit1c283e35bcf31d344681b86c1282b0ca4f05cbc6 (patch)
treee1884e8edf4efab311b3ce443f76bb810786556a /src
parent69445b3bd47565ce54c5725ab1a74ca3943f2de4 (diff)
downloademacs-1c283e35bcf31d344681b86c1282b0ca4f05cbc6.tar.gz
emacs-1c283e35bcf31d344681b86c1282b0ca4f05cbc6.zip
(Vfontset_alias_alist): New variable.
(fontset_pattern_regexp): Delete code for handling nickname of a fonset. It is now handled in Fquery_fontset by consulting Vfontset_alias_alist. (Fquery_fontset): Handle Vfontset_alias_alist. (syms_of_fontset): Terminate each line by `\n\' in doc-string of alternate-fontname-alist. Declare Lisp valiable fontset-alias-alist. Doc-string of highlight-wrong-size-font and clip-large-size-font modified.
Diffstat (limited to 'src')
-rw-r--r--src/fontset.c71
1 files changed, 35 insertions, 36 deletions
diff --git a/src/fontset.c b/src/fontset.c
index 082a148ac8e..840555b427d 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -34,6 +34,7 @@ Lisp_Object Vglobal_fontset_alist;
34Lisp_Object Vfont_encoding_alist; 34Lisp_Object Vfont_encoding_alist;
35Lisp_Object Vuse_default_ascent; 35Lisp_Object Vuse_default_ascent;
36Lisp_Object Valternative_fontname_alist; 36Lisp_Object Valternative_fontname_alist;
37Lisp_Object Vfontset_alias_alist;
37Lisp_Object Vhighlight_wrong_size_font; 38Lisp_Object Vhighlight_wrong_size_font;
38Lisp_Object Vclip_large_size_font; 39Lisp_Object Vclip_large_size_font;
39 40
@@ -384,50 +385,31 @@ Lisp_Object
384fontset_pattern_regexp (pattern) 385fontset_pattern_regexp (pattern)
385 Lisp_Object pattern; 386 Lisp_Object pattern;
386{ 387{
387 int nickname = 0;
388
389 if (!index (XSTRING (pattern)->data, '*') 388 if (!index (XSTRING (pattern)->data, '*')
390 && !index (XSTRING (pattern)->data, '?')) 389 && !index (XSTRING (pattern)->data, '?'))
391 /* PATTERN does not contain any wild cards. */ 390 /* PATTERN does not contain any wild cards. */
392 { 391 return Qnil;
393 if (XSTRING (pattern)->size > 8
394 && ! bcmp (XSTRING (pattern)->data, "fontset-", 8))
395 /* Just a nickname of a fontset is specified. */
396 nickname = 1;
397 else
398 return Qnil;
399 }
400 392
401 if (!CONSP (Vcached_fontset_data) 393 if (!CONSP (Vcached_fontset_data)
402 || strcmp (XSTRING (pattern)->data, CACHED_FONTSET_NAME)) 394 || strcmp (XSTRING (pattern)->data, CACHED_FONTSET_NAME))
403 { 395 {
404 /* We must at first update the cached data. */ 396 /* We must at first update the cached data. */
405 char *regex = (char *) alloca (XSTRING (pattern)->size * 2 + 3); 397 char *regex = (char *) alloca (XSTRING (pattern)->size * 2);
406 char *p0, *p1 = regex; 398 char *p0, *p1 = regex;
407 399
408 if (nickname) 400 /* Convert "*" to ".*", "?" to ".". */
409 { 401 *p1++ = '^';
410 /* Just prepend ".*-" to PATTERN. */ 402 for (p0 = XSTRING (pattern)->data; *p0; p0++)
411 *p1++= '.'; *p1++= '*', *p1++= '-';
412 bcopy (XSTRING (pattern)->data, p1, XSTRING (pattern)->size);
413 p1 += XSTRING (pattern)->size;
414 }
415 else
416 { 403 {
417 /* Convert "*" to ".*", "?" to ".". */ 404 if (*p0 == '*')
418 *p1++ = '^';
419 for (p0 = XSTRING (pattern)->data; *p0; p0++)
420 { 405 {
421 if (*p0 == '*') 406 *p1++ = '.';
422 { 407 *p1++ = '*';
423 *p1++ = '.';
424 *p1++ = '*';
425 }
426 else if (*p0 == '?')
427 *p1++ == '.';
428 else
429 *p1++ = *p0;
430 } 408 }
409 else if (*p0 == '?')
410 *p1++ == '.';
411 else
412 *p1++ = *p0;
431 } 413 }
432 *p1++ = '$'; 414 *p1++ = '$';
433 *p1++ = 0; 415 *p1++ = 0;
@@ -455,6 +437,10 @@ just like X's font name matching algorithm allows.")
455 if (XSTRING (pattern)->size == 0) 437 if (XSTRING (pattern)->size == 0)
456 return Qnil; 438 return Qnil;
457 439
440 tem = Frassoc (pattern, Vfontset_alias_alist);
441 if (!NILP (tem))
442 return Fcar (tem);
443
458 regexp = fontset_pattern_regexp (pattern); 444 regexp = fontset_pattern_regexp (pattern);
459 445
460 for (tem = Vglobal_fontset_alist; CONSP (tem); tem = XCONS (tem)->cdr) 446 for (tem = Vglobal_fontset_alist; CONSP (tem); tem = XCONS (tem)->cdr)
@@ -830,20 +816,33 @@ is assumed to be what specified by _MULE_DEFAULT_ASCENT property of a font.");
830 Vuse_default_ascent = Qnil; 816 Vuse_default_ascent = Qnil;
831 817
832 DEFVAR_LISP ("alternative-fontname-alist", &Valternative_fontname_alist, 818 DEFVAR_LISP ("alternative-fontname-alist", &Valternative_fontname_alist,
833 "Alist of fontname vs list of the alternative fontnames. 819 "Alist of fontname vs list of the alternative fontnames.\n\
834When no font can be opened by a fontname, the corresponding 820When no font can be opened by a fontname, the corresponding\n\
835alternative fontnames are tried."); 821alternative fontnames are tried.");
836 Valternative_fontname_alist = Qnil; 822 Valternative_fontname_alist = Qnil;
837 823
824 DEFVAR_LISP ("fontset-alias-alist", &Vfontset_alias_alist,
825 "Alist of fontset names vs the aliases.");
826 Vfontset_alias_alist = Qnil;
827
838 DEFVAR_LISP ("highlight-wrong-size-font", &Vhighlight_wrong_size_font, 828 DEFVAR_LISP ("highlight-wrong-size-font", &Vhighlight_wrong_size_font,
839 "*Non-nil means highlight characters shown in wrong size fonts somehow.\n\ 829 "*Non-nil means highlight characters shown in wrong size fonts somehow.\n\
840The way to highlight them depends on window system on which Emacs runs.\n\ 830The way to highlight them depends on window system on which Emacs runs.\n\
841On X window, rectangle is shown around each such characters."); 831On X window, a rectangle is shown around each such character.");
842 Vhighlight_wrong_size_font = Qt; 832 Vhighlight_wrong_size_font = Qt;
843 833
844 DEFVAR_LISP ("clip-large-size-font", &Vclip_large_size_font, 834 DEFVAR_LISP ("clip-large-size-font", &Vclip_large_size_font,
845 "*Non-nil means clip glyphs shown in large size fonts.\n\ 835 "*Non-nil means characters shown in large size fonts are clipped.\n\
846The hight of clipping area is the same as the hight of ASCII characters."); 836The height of clipping area is the same as that of an ASCII character.\n\
837The width of the area is the same as that of an ASCII character or\n\
838twice wider than that of an ASCII character depending on\n\
839the width (i.e. column numbers occupied on screen) of the character set\n\
840of the character.\n\
841\n\
842In the case that you only have too large size font for a specific\n\
843charscter set, and clipping characters of the character set makes them\n\
844almost unreadable, you can set this variable to t to see the\n\
845characters in exchage for garbage dots left on your screen.");
847 Vclip_large_size_font = Qt; 846 Vclip_large_size_font = Qt;
848 847
849 defsubr (&Squery_fontset); 848 defsubr (&Squery_fontset);