+2004-11-08 Kenichi Handa <handa@m17n.org>
+
+ * fontset.c (fontset_pattern_regexp): Cancel my previous change;
+ don't pay attention to '\' before '*'.
+ (fontset_pattern_regexp): Change the meaning of the second arg.
+ (Fnew_fontset): Call fs_query_fontset, not Fquery_fontset.
+ (check_fontset_name): Try NAME as literal at first, and if it
+ failes, try NAME as pattern.
+
2004-11-07 Jan Dj\e,Ad\e(Brv <jan.h.d@swipnet.se>
* emacs.c (Fdump_emacs): Only output warning on GNU/Linux.
{
if (*p0 == '-')
ndashes++;
- else if (*p0 == '*' && p0 > SDATA (pattern) && p0[-1] != '\\')
+ else if (*p0 == '*')
nstars++;
}
*p1++ = '^';
for (p0 = SDATA (pattern); *p0; p0++)
{
- if (*p0 == '*' && p0 > SDATA (pattern) && p0[-1] != '\\')
+ if (*p0 == '*')
{
if (ndashes < 14)
*p1++ = '.';
}
/* Return ID of the base fontset named NAME. If there's no such
- fontset, return -1. */
+ fontset, return -1. NAME_PATTERN specifies how to treat NAME as this:
+ 0: pattern containing '*' and '?' as wildcards
+ 1: regular expression
+ 2: literal fontset name
+*/
int
-fs_query_fontset (name, regexpp)
+fs_query_fontset (name, name_pattern)
Lisp_Object name;
- int regexpp;
+ int name_pattern;
{
Lisp_Object tem;
int i;
name = Fdowncase (name);
- if (!regexpp)
+ if (name_pattern != 1)
{
tem = Frassoc (name, Vfontset_alias_alist);
if (CONSP (tem) && STRINGP (XCAR (tem)))
name = XCAR (tem);
- else
+ else if (name_pattern == 0)
{
tem = fontset_pattern_regexp (name);
if (STRINGP (tem))
{
name = tem;
- regexpp = 1;
+ name_pattern = 1;
}
}
}
continue;
this_name = FONTSET_NAME (fontset);
- if (regexpp
+ if (name_pattern == 1
? fast_string_match (name, this_name) >= 0
: !strcmp (SDATA (name), SDATA (this_name)))
return i;
{
Lisp_Object fontset, elements, ascii_font;
Lisp_Object tem, tail, elt;
+ int id;
(*check_window_system_func) ();
CHECK_LIST (fontlist);
name = Fdowncase (name);
- tem = Fquery_fontset (name, Qnil);
- if (!NILP (tem))
- error ("Fontset `%s' matches the existing fontset `%s'",
- SDATA (name), SDATA (tem));
+ id = fs_query_fontset (name, 2);
+ if (id >= 0)
+ {
+ fontset = FONTSET_FROM_ID (id);
+ tem = FONTSET_NAME (fontset);
+ error ("Fontset `%s' matches the existing fontset `%s'",
+ SDATA (name), SDATA (tem));
+ }
/* Check the validity of FONTLIST while creating a template for
fontset elements. */
return Vdefault_fontset;
CHECK_STRING (name);
- id = fs_query_fontset (name, 0);
+ /* First try NAME as literal. */
+ id = fs_query_fontset (name, 2);
+ if (id < 0)
+ /* For backward compatibility, try again NAME as pattern. */
+ id = fs_query_fontset (name, 0);
if (id < 0)
error ("Fontset `%s' does not exist", SDATA (name));
return FONTSET_FROM_ID (id);