aboutsummaryrefslogtreecommitdiffstats
path: root/src/macterm.c
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu <[email protected]>2005-03-16 08:08:06 +0000
committerYAMAMOTO Mitsuharu <[email protected]>2005-03-16 08:08:06 +0000
commitb298e813e5b7bcfb33b0dcbe5ec03f28fbdc107b (patch)
treefc6d8e8966fb2f9042d0091cf2b2ce9a8d7aa061 /src/macterm.c
parente7474cdda81b597b32ddffe6e20040c08e3abadf (diff)
(x_list_fonts): FONT-LIST-CACHE is now cadr part of name_list_element.
(mac_make_rdb): Create resource database from preferences and argument string. (mac_term_init): Save resource database to cddr part of name_list_element.
Diffstat (limited to 'src/macterm.c')
-rw-r--r--src/macterm.c73
1 files changed, 18 insertions, 55 deletions
diff --git a/src/macterm.c b/src/macterm.c
index 9af39dcb1f..67a3f1e010 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -129,9 +129,12 @@ int x_use_underline_position_properties;
struct x_display_info *x_display_list;
/* This is a list of cons cells, each of the form (NAME
- . FONT-LIST-CACHE), one for each element of x_display_list and in
- the same order. NAME is the name of the frame. FONT-LIST-CACHE
- records previous values returned by x-list-fonts. */
+ FONT-LIST-CACHE . RESOURCE-DATABASE), one for each element of
+ x_display_list and in the same order. NAME is the name of the
+ frame. FONT-LIST-CACHE records previous values returned by
+ x-list-fonts. RESOURCE-DATABASE preserves the X Resource Database
+ equivalent, which is implemented with a Lisp object, for the
+ display. */
Lisp_Object x_display_name_list;
@@ -6447,7 +6450,7 @@ x_list_fonts (struct frame *f,
if (dpyinfo)
{
- tem = XCDR (dpyinfo->name_list_element);
+ tem = XCAR (XCDR (dpyinfo->name_list_element));
key = Fcons (pattern, make_number (maxnames));
newlist = Fassoc (key, tem);
@@ -6466,9 +6469,9 @@ x_list_fonts (struct frame *f,
if (dpyinfo)
{
- XSETCDR (dpyinfo->name_list_element,
+ XSETCAR (XCDR (dpyinfo->name_list_element),
Fcons (Fcons (key, newlist),
- XCDR (dpyinfo->name_list_element)));
+ XCAR (XCDR (dpyinfo->name_list_element))));
}
label_cached:
@@ -9371,59 +9374,18 @@ mac_initialize_display_info ()
dpyinfo->mouse_face_hidden = 0;
}
-/* Create an xrdb-style database of resources to supercede registry settings.
- The database is just a concatenation of C strings, finished by an additional
- \0. The string are submitted to some basic normalization, so
- [ *]option[ *]:[ *]value...
-
- becomes
-
- option:value...
-
- but any whitespace following value is not removed. */
-
-static char *
+static XrmDatabase
mac_make_rdb (xrm_option)
char *xrm_option;
{
- char *buffer = xmalloc (strlen (xrm_option) + 2);
- char *current = buffer;
- char ch;
- int in_option = 1;
- int before_value = 0;
-
- do {
- ch = *xrm_option++;
-
- if (ch == '\n')
- {
- *current++ = '\0';
- in_option = 1;
- before_value = 0;
- }
- else if (ch != ' ')
- {
- *current++ = ch;
- if (in_option && (ch == ':'))
- {
- in_option = 0;
- before_value = 1;
- }
- else if (before_value)
- {
- before_value = 0;
- }
- }
- else if (!(in_option || before_value))
- {
- *current++ = ch;
- }
- } while (ch);
+ XrmDatabase database;
- *current = '\0';
+ database = xrm_get_preference_database (NULL);
+ if (xrm_option)
+ xrm_merge_string_database (database, xrm_option);
- return buffer;
+ return database;
}
struct mac_display_info *
@@ -9449,14 +9411,15 @@ mac_term_init (display_name, xrm_option, resource_name)
dpyinfo = &one_mac_display_info;
- dpyinfo->xrdb = xrm_option ? mac_make_rdb (xrm_option) : NULL;
+ dpyinfo->xrdb = mac_make_rdb (xrm_option);
/* Put this display on the chain. */
dpyinfo->next = x_display_list;
x_display_list = dpyinfo;
/* Put it on x_display_name_list. */
- x_display_name_list = Fcons (Fcons (display_name, Qnil),
+ x_display_name_list = Fcons (Fcons (display_name,
+ Fcons (Qnil, dpyinfo->xrdb)),
x_display_name_list);
dpyinfo->name_list_element = XCAR (x_display_name_list);