aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDmitry Antipov2013-10-18 16:57:44 +0400
committerDmitry Antipov2013-10-18 16:57:44 +0400
commitd141d7011296265b0c2a6432bed9317614abf019 (patch)
treeeffac9c22d9391c5527e5d9990b1fdbe4647e556 /src
parentf0ff1cd5762b2485add7b2e5a1da52eab733a873 (diff)
downloademacs-d141d7011296265b0c2a6432bed9317614abf019.tar.gz
emacs-d141d7011296265b0c2a6432bed9317614abf019.zip
Remove port-specific display name lists to avoid extra
complexity and data duplication with display info lists. * xterm.h (x_display_name_list): Remove declaration. * xterm.c (x_display_name_list): Remove. (x_term_init, x_delete_display, syms_of_xterm): Adjust users. * xfns.c (x_display_info_for_name, Fx_display_list): Likewise. Use x_display_list where appropriate. * w32term.h (w32_display_name_list): Remove declaration. * w32term.c (w32_display_name_list): Remove. (w32_initialize_display_info, x_delete_display, syms_of_w32term): Adjust users. * w32fns.c (x_display_info_for_name, Fx_display_list): Likewise. Use x_display_list where appropriate. * nsterm.h (ns_display_name_list): Remove declaration. * nsterm.m (ns_display_name_list): Remove. (ns_term_init, syms_of_nsterm): Adjust users. * nsfns.m (ns_display_info_for_name, Fx_display_list): Likewise. Use x_display_list where appropriate. * termhooks.h (TERMINAL_FONT_CACHE): New macro. * alloc.c (toplevel) [HAVE_WINDOW_SYSTEM]: Include TERM_HEADER. (mark_terminals): Mark per-terminal font cache.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog24
-rw-r--r--src/alloc.c6
-rw-r--r--src/nsfns.m21
-rw-r--r--src/nsterm.h4
-rw-r--r--src/nsterm.m9
-rw-r--r--src/termhooks.h13
-rw-r--r--src/w32fns.c21
-rw-r--r--src/w32term.c38
-rw-r--r--src/w32term.h9
-rw-r--r--src/xfns.c21
-rw-r--r--src/xterm.c43
-rw-r--r--src/xterm.h9
12 files changed, 73 insertions, 145 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 0dae87bd69a..53b9188dba9 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,27 @@
12013-10-18 Dmitry Antipov <dmantipov@yandex.ru>
2
3 Remove port-specific display name lists to avoid extra
4 complexity and data duplication with display info lists.
5 * xterm.h (x_display_name_list): Remove declaration.
6 * xterm.c (x_display_name_list): Remove.
7 (x_term_init, x_delete_display, syms_of_xterm): Adjust users.
8 * xfns.c (x_display_info_for_name, Fx_display_list):
9 Likewise. Use x_display_list where appropriate.
10 * w32term.h (w32_display_name_list): Remove declaration.
11 * w32term.c (w32_display_name_list): Remove.
12 (w32_initialize_display_info, x_delete_display, syms_of_w32term):
13 Adjust users.
14 * w32fns.c (x_display_info_for_name, Fx_display_list):
15 Likewise. Use x_display_list where appropriate.
16 * nsterm.h (ns_display_name_list): Remove declaration.
17 * nsterm.m (ns_display_name_list): Remove.
18 (ns_term_init, syms_of_nsterm): Adjust users.
19 * nsfns.m (ns_display_info_for_name, Fx_display_list):
20 Likewise. Use x_display_list where appropriate.
21 * termhooks.h (TERMINAL_FONT_CACHE): New macro.
22 * alloc.c (toplevel) [HAVE_WINDOW_SYSTEM]: Include TERM_HEADER.
23 (mark_terminals): Mark per-terminal font cache.
24
12013-10-17 Barry O'Reilly <gundaetiapo@gmail.com> 252013-10-17 Barry O'Reilly <gundaetiapo@gmail.com>
2 26
3 Don't run timers in input-pending-p. Its new check-timers param 27 Don't run timers in input-pending-p. Its new check-timers param
diff --git a/src/alloc.c b/src/alloc.c
index 0667353c1a8..02deaa94af1 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -42,6 +42,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
42#include "frame.h" 42#include "frame.h"
43#include "blockinput.h" 43#include "blockinput.h"
44#include "termhooks.h" /* For struct terminal. */ 44#include "termhooks.h" /* For struct terminal. */
45#ifdef HAVE_WINDOW_SYSTEM
46#include TERM_HEADER
47#endif /* HAVE_WINDOW_SYSTEM */
45 48
46#include <verify.h> 49#include <verify.h>
47 50
@@ -6115,6 +6118,9 @@ mark_terminals (void)
6115 it might have been marked already. Make sure the image cache 6118 it might have been marked already. Make sure the image cache
6116 gets marked. */ 6119 gets marked. */
6117 mark_image_cache (t->image_cache); 6120 mark_image_cache (t->image_cache);
6121 /* FIXME: currently font cache may grow too large
6122 and probably needs special finalization. */
6123 mark_object (TERMINAL_FONT_CACHE (t));
6118#endif /* HAVE_WINDOW_SYSTEM */ 6124#endif /* HAVE_WINDOW_SYSTEM */
6119 if (!VECTOR_MARKED_P (t)) 6125 if (!VECTOR_MARKED_P (t))
6120 mark_vectorlike ((struct Lisp_Vector *)t); 6126 mark_vectorlike ((struct Lisp_Vector *)t);
diff --git a/src/nsfns.m b/src/nsfns.m
index 24edd4366ce..011edf38cef 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -175,20 +175,13 @@ ns_get_window (Lisp_Object maybeFrame)
175struct ns_display_info * 175struct ns_display_info *
176ns_display_info_for_name (Lisp_Object name) 176ns_display_info_for_name (Lisp_Object name)
177{ 177{
178 Lisp_Object names;
179 struct ns_display_info *dpyinfo; 178 struct ns_display_info *dpyinfo;
180 179
181 CHECK_STRING (name); 180 CHECK_STRING (name);
182 181
183 for (dpyinfo = x_display_list, names = ns_display_name_list; 182 for (dpyinfo = x_display_list; dpyinfo; dpyinfo = dpyinfo->next)
184 dpyinfo; 183 if (!NILP (Fstring_equal (XCAR (dpyinfo->name_list_element), name)))
185 dpyinfo = dpyinfo->next, names = XCDR (names)) 184 return dpyinfo;
186 {
187 Lisp_Object tem;
188 tem = Fstring_equal (XCAR (XCAR (names)), name);
189 if (!NILP (tem))
190 return dpyinfo;
191 }
192 185
193 error ("Emacs for OpenStep does not yet support multi-display."); 186 error ("Emacs for OpenStep does not yet support multi-display.");
194 187
@@ -1843,11 +1836,11 @@ DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0,
1843 doc: /* Return the list of display names that Emacs has connections to. */) 1836 doc: /* Return the list of display names that Emacs has connections to. */)
1844 (void) 1837 (void)
1845{ 1838{
1846 Lisp_Object tail, result; 1839 Lisp_Object result = Qnil;
1840 struct ns_display_info *ndi;
1847 1841
1848 result = Qnil; 1842 for (ndi = x_display_list; ndi; ndi = ndi->next)
1849 for (tail = ns_display_name_list; CONSP (tail); tail = XCDR (tail)) 1843 result = Fcons (XCAR (ndi->name_list_element), result);
1850 result = Fcons (XCAR (XCAR (tail)), result);
1851 1844
1852 return result; 1845 return result;
1853} 1846}
diff --git a/src/nsterm.h b/src/nsterm.h
index a4e9519daae..71faa075f32 100644
--- a/src/nsterm.h
+++ b/src/nsterm.h
@@ -552,8 +552,7 @@ struct ns_display_info
552 /* The generic display parameters corresponding to this NS display. */ 552 /* The generic display parameters corresponding to this NS display. */
553 struct terminal *terminal; 553 struct terminal *terminal;
554 554
555 /* This is a cons cell of the form (NAME . FONT-LIST-CACHE). 555 /* This is a cons cell of the form (NAME . FONT-LIST-CACHE). */
556 The same cons cell also appears in ns_display_name_list. */
557 Lisp_Object name_list_element; 556 Lisp_Object name_list_element;
558 557
559 /* The number of fonts loaded. */ 558 /* The number of fonts loaded. */
@@ -624,7 +623,6 @@ struct ns_display_info
624/* This is a chain of structures for all the NS displays currently in use. */ 623/* This is a chain of structures for all the NS displays currently in use. */
625extern struct ns_display_info *x_display_list; 624extern struct ns_display_info *x_display_list;
626 625
627extern Lisp_Object ns_display_name_list;
628extern struct ns_display_info *ns_display_info_for_name (Lisp_Object name); 626extern struct ns_display_info *ns_display_info_for_name (Lisp_Object name);
629 627
630struct ns_output 628struct ns_output
diff --git a/src/nsterm.m b/src/nsterm.m
index 5b48ff2cee6..5b2c6a3f686 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -184,7 +184,6 @@ NSString *ns_app_name = @"Emacs"; /* default changed later */
184 184
185/* Display variables */ 185/* Display variables */
186struct ns_display_info *x_display_list; /* Chain of existing displays */ 186struct ns_display_info *x_display_list; /* Chain of existing displays */
187Lisp_Object ns_display_name_list;
188long context_menu_value = 0; 187long context_menu_value = 0;
189 188
190/* display update */ 189/* display update */
@@ -4173,10 +4172,7 @@ ns_term_init (Lisp_Object display_name)
4173 dpyinfo->next = x_display_list; 4172 dpyinfo->next = x_display_list;
4174 x_display_list = dpyinfo; 4173 x_display_list = dpyinfo;
4175 4174
4176 /* Put it on ns_display_name_list */ 4175 dpyinfo->name_list_element = Fcons (display_name, Qnil);
4177 ns_display_name_list = Fcons (Fcons (display_name, Qnil),
4178 ns_display_name_list);
4179 dpyinfo->name_list_element = XCAR (ns_display_name_list);
4180 4176
4181 terminal->name = xstrdup (SSDATA (display_name)); 4177 terminal->name = xstrdup (SSDATA (display_name));
4182 4178
@@ -7460,9 +7456,6 @@ allowing it to be used at a lower level for accented character entry.");
7460 "Whether to confirm application quit using dialog."); 7456 "Whether to confirm application quit using dialog.");
7461 ns_confirm_quit = Qnil; 7457 ns_confirm_quit = Qnil;
7462 7458
7463 staticpro (&ns_display_name_list);
7464 ns_display_name_list = Qnil;
7465
7466 DEFVAR_LISP ("ns-auto-hide-menu-bar", ns_auto_hide_menu_bar, 7459 DEFVAR_LISP ("ns-auto-hide-menu-bar", ns_auto_hide_menu_bar,
7467 doc: /* Non-nil means that the menu bar is hidden, but appears when the mouse is near. 7460 doc: /* Non-nil means that the menu bar is hidden, but appears when the mouse is near.
7468Only works on OSX 10.6 or later. */); 7461Only works on OSX 10.6 or later. */);
diff --git a/src/termhooks.h b/src/termhooks.h
index 31825a4c95d..042a493882b 100644
--- a/src/termhooks.h
+++ b/src/termhooks.h
@@ -623,6 +623,19 @@ extern struct terminal *terminal_list;
623 (((d)->type != output_termcap && (d)->type != output_msdos_raw) \ 623 (((d)->type != output_termcap && (d)->type != output_msdos_raw) \
624 || (d)->display_info.tty->input) 624 || (d)->display_info.tty->input)
625 625
626/* Return font cache data for the specified terminal. The historical
627 name is grossly misleading, actually it is (NAME . FONT-LIST-CACHE). */
628#if defined (HAVE_X_WINDOWS)
629#define TERMINAL_FONT_CACHE(t) \
630 (t->type == output_x_window ? t->display_info.x->name_list_element : Qnil)
631#elif defined (HAVE_NTGUI)
632#define TERMINAL_FONT_CACHE(t) \
633 (t->type == output_w32 ? t->display_info.w32->name_list_element : Qnil)
634#elif defined (HAVE_NS)
635#define TERMINAL_FONT_CACHE(t) \
636 (t->type == output_ns ? t->display_info.ns->name_list_element : Qnil)
637#endif
638
626extern struct terminal *get_terminal (Lisp_Object terminal, bool); 639extern struct terminal *get_terminal (Lisp_Object terminal, bool);
627extern struct terminal *create_terminal (void); 640extern struct terminal *create_terminal (void);
628extern void delete_terminal (struct terminal *); 641extern void delete_terminal (struct terminal *);
diff --git a/src/w32fns.c b/src/w32fns.c
index 6e52453caea..c98c84c8542 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -5126,20 +5126,13 @@ x_screen_planes (register struct frame *f)
5126struct w32_display_info * 5126struct w32_display_info *
5127x_display_info_for_name (Lisp_Object name) 5127x_display_info_for_name (Lisp_Object name)
5128{ 5128{
5129 Lisp_Object names;
5130 struct w32_display_info *dpyinfo; 5129 struct w32_display_info *dpyinfo;
5131 5130
5132 CHECK_STRING (name); 5131 CHECK_STRING (name);
5133 5132
5134 for (dpyinfo = &one_w32_display_info, names = w32_display_name_list; 5133 for (dpyinfo = &one_w32_display_info; dpyinfo; dpyinfo = dpyinfo->next)
5135 dpyinfo && !NILP (w32_display_name_list); 5134 if (!NILP (Fstring_equal (XCAR (dpyinfo->name_list_element), name)))
5136 dpyinfo = dpyinfo->next, names = XCDR (names)) 5135 return dpyinfo;
5137 {
5138 Lisp_Object tem;
5139 tem = Fstring_equal (XCAR (XCAR (names)), name);
5140 if (!NILP (tem))
5141 return dpyinfo;
5142 }
5143 5136
5144 /* Use this general default value to start with. */ 5137 /* Use this general default value to start with. */
5145 Vx_resource_name = Vinvocation_name; 5138 Vx_resource_name = Vinvocation_name;
@@ -5274,11 +5267,11 @@ DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0,
5274 doc: /* Return the list of display names that Emacs has connections to. */) 5267 doc: /* Return the list of display names that Emacs has connections to. */)
5275 (void) 5268 (void)
5276{ 5269{
5277 Lisp_Object tail, result; 5270 Lisp_Object result = Qnil;
5271 struct w32_display_info *wdi;
5278 5272
5279 result = Qnil; 5273 for (wdi = x_display_list; wdi; wdi = wdi->next)
5280 for (tail = w32_display_name_list; CONSP (tail); tail = XCDR (tail)) 5274 result = Fcons (XCAR (wdi->name_list_element), result);
5281 result = Fcons (XCAR (XCAR (tail)), result);
5282 5275
5283 return result; 5276 return result;
5284} 5277}
diff --git a/src/w32term.c b/src/w32term.c
index b128fbeaa9c..8bc46734b7d 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -99,13 +99,6 @@ extern Cursor w32_load_cursor (LPCTSTR name);
99struct w32_display_info one_w32_display_info; 99struct w32_display_info one_w32_display_info;
100struct w32_display_info *x_display_list; 100struct w32_display_info *x_display_list;
101 101
102/* This is a list of cons cells, each of the form (NAME . FONT-LIST-CACHE),
103 one for each element of w32_display_list and in the same order.
104 NAME is the name of the frame.
105 FONT-LIST-CACHE records previous values returned by x-list-fonts. */
106Lisp_Object w32_display_name_list;
107
108
109#if _WIN32_WINNT < 0x0500 && !defined(_W64) 102#if _WIN32_WINNT < 0x0500 && !defined(_W64)
110/* Pre Windows 2000, this was not available, but define it here so 103/* Pre Windows 2000, this was not available, but define it here so
111 that Emacs compiled on such a platform will run on newer versions. 104 that Emacs compiled on such a platform will run on newer versions.
@@ -6105,11 +6098,7 @@ w32_initialize_display_info (Lisp_Object display_name)
6105 6098
6106 memset (dpyinfo, 0, sizeof (*dpyinfo)); 6099 memset (dpyinfo, 0, sizeof (*dpyinfo));
6107 6100
6108 /* Put it on w32_display_name_list. */ 6101 dpyinfo->name_list_element = Fcons (display_name, Qnil);
6109 w32_display_name_list = Fcons (Fcons (display_name, Qnil),
6110 w32_display_name_list);
6111 dpyinfo->name_list_element = XCAR (w32_display_name_list);
6112
6113 dpyinfo->w32_id_name = xmalloc (SCHARS (Vinvocation_name) 6102 dpyinfo->w32_id_name = xmalloc (SCHARS (Vinvocation_name)
6114 + SCHARS (Vsystem_name) + 2); 6103 + SCHARS (Vsystem_name) + 2);
6115 sprintf (dpyinfo->w32_id_name, "%s@%s", 6104 sprintf (dpyinfo->w32_id_name, "%s@%s",
@@ -6357,27 +6346,7 @@ w32_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
6357void 6346void
6358x_delete_display (struct w32_display_info *dpyinfo) 6347x_delete_display (struct w32_display_info *dpyinfo)
6359{ 6348{
6360 /* Discard this display from w32_display_name_list and w32_display_list. 6349 /* FIXME: the only display info apparently can't be deleted. */
6361 We can't use Fdelq because that can quit. */
6362 if (! NILP (w32_display_name_list)
6363 && EQ (XCAR (w32_display_name_list), dpyinfo->name_list_element))
6364 w32_display_name_list = XCDR (w32_display_name_list);
6365 else
6366 {
6367 Lisp_Object tail;
6368
6369 tail = w32_display_name_list;
6370 while (CONSP (tail) && CONSP (XCDR (tail)))
6371 {
6372 if (EQ (XCAR (XCDR (tail)), dpyinfo->name_list_element))
6373 {
6374 XSETCDR (tail, XCDR (XCDR (tail)));
6375 break;
6376 }
6377 tail = XCDR (tail);
6378 }
6379 }
6380
6381 /* free palette table */ 6350 /* free palette table */
6382 { 6351 {
6383 struct w32_palette_entry * plist; 6352 struct w32_palette_entry * plist;
@@ -6515,9 +6484,6 @@ w32_initialize (void)
6515void 6484void
6516syms_of_w32term (void) 6485syms_of_w32term (void)
6517{ 6486{
6518 staticpro (&w32_display_name_list);
6519 w32_display_name_list = Qnil;
6520
6521 DEFSYM (Qvendor_specific_keysyms, "vendor-specific-keysyms"); 6487 DEFSYM (Qvendor_specific_keysyms, "vendor-specific-keysyms");
6522 6488
6523 DEFSYM (Qadded, "added"); 6489 DEFSYM (Qadded, "added");
diff --git a/src/w32term.h b/src/w32term.h
index 8244487dfc7..956e03d336c 100644
--- a/src/w32term.h
+++ b/src/w32term.h
@@ -86,8 +86,7 @@ struct w32_display_info
86 /* The generic display parameters corresponding to this w32 display. */ 86 /* The generic display parameters corresponding to this w32 display. */
87 struct terminal *terminal; 87 struct terminal *terminal;
88 88
89 /* This is a cons cell of the form (NAME . FONT-LIST-CACHE). 89 /* This is a cons cell of the form (NAME . FONT-LIST-CACHE). */
90 The same cons cell also appears in x_display_name_list. */
91 Lisp_Object name_list_element; 90 Lisp_Object name_list_element;
92 91
93 /* Number of frames that are on this display. */ 92 /* Number of frames that are on this display. */
@@ -216,12 +215,6 @@ struct w32_display_info
216extern struct w32_display_info *x_display_list; 215extern struct w32_display_info *x_display_list;
217extern struct w32_display_info one_w32_display_info; 216extern struct w32_display_info one_w32_display_info;
218 217
219/* This is a list of cons cells, each of the form (NAME . FONT-LIST-CACHE),
220 one for each element of w32_display_list and in the same order.
221 NAME is the name of the frame.
222 FONT-LIST-CACHE records previous values returned by x-list-fonts. */
223extern Lisp_Object w32_display_name_list;
224
225extern struct frame *x_window_to_frame (struct w32_display_info *, HWND); 218extern struct frame *x_window_to_frame (struct w32_display_info *, HWND);
226 219
227struct w32_display_info *x_display_info_for_name (Lisp_Object); 220struct w32_display_info *x_display_info_for_name (Lisp_Object);
diff --git a/src/xfns.c b/src/xfns.c
index 2b895642942..9cd7d3e6627 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -4242,20 +4242,13 @@ select_visual (struct x_display_info *dpyinfo)
4242static struct x_display_info * 4242static struct x_display_info *
4243x_display_info_for_name (Lisp_Object name) 4243x_display_info_for_name (Lisp_Object name)
4244{ 4244{
4245 Lisp_Object names;
4246 struct x_display_info *dpyinfo; 4245 struct x_display_info *dpyinfo;
4247 4246
4248 CHECK_STRING (name); 4247 CHECK_STRING (name);
4249 4248
4250 for (dpyinfo = x_display_list, names = x_display_name_list; 4249 for (dpyinfo = x_display_list; dpyinfo; dpyinfo = dpyinfo->next)
4251 dpyinfo; 4250 if (!NILP (Fstring_equal (XCAR (dpyinfo->name_list_element), name)))
4252 dpyinfo = dpyinfo->next, names = XCDR (names)) 4251 return dpyinfo;
4253 {
4254 Lisp_Object tem;
4255 tem = Fstring_equal (XCAR (XCAR (names)), name);
4256 if (!NILP (tem))
4257 return dpyinfo;
4258 }
4259 4252
4260 /* Use this general default value to start with. */ 4253 /* Use this general default value to start with. */
4261 Vx_resource_name = Vinvocation_name; 4254 Vx_resource_name = Vinvocation_name;
@@ -4338,11 +4331,11 @@ DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0,
4338 doc: /* Return the list of display names that Emacs has connections to. */) 4331 doc: /* Return the list of display names that Emacs has connections to. */)
4339 (void) 4332 (void)
4340{ 4333{
4341 Lisp_Object tail, result; 4334 Lisp_Object result = Qnil;
4335 struct x_display_info *xdi;
4342 4336
4343 result = Qnil; 4337 for (xdi = x_display_list; xdi; xdi = xdi->next)
4344 for (tail = x_display_name_list; CONSP (tail); tail = XCDR (tail)) 4338 result = Fcons (XCAR (xdi->name_list_element), result);
4345 result = Fcons (XCAR (XCAR (tail)), result);
4346 4339
4347 return result; 4340 return result;
4348} 4341}
diff --git a/src/xterm.c b/src/xterm.c
index 9d1107e10bd..26ad5267625 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -148,13 +148,6 @@ static bool any_help_event_p;
148 148
149struct x_display_info *x_display_list; 149struct x_display_info *x_display_list;
150 150
151/* This is a list of cons cells, each of the form (NAME
152 . FONT-LIST-CACHE), one for each element of x_display_list and in
153 the same order. NAME is the name of the frame. FONT-LIST-CACHE
154 records previous values returned by x-list-fonts. */
155
156Lisp_Object x_display_name_list;
157
158#ifdef USE_X_TOOLKIT 151#ifdef USE_X_TOOLKIT
159 152
160/* The application context for Xt use. */ 153/* The application context for Xt use. */
@@ -9894,11 +9887,9 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
9894 9887
9895 { 9888 {
9896 struct x_display_info *share; 9889 struct x_display_info *share;
9897 Lisp_Object tail;
9898 9890
9899 for (share = x_display_list, tail = x_display_name_list; share; 9891 for (share = x_display_list; share; share = share->next)
9900 share = share->next, tail = XCDR (tail)) 9892 if (same_x_server (SSDATA (XCAR (share->name_list_element)),
9901 if (same_x_server (SSDATA (XCAR (XCAR (tail))),
9902 SSDATA (display_name))) 9893 SSDATA (display_name)))
9903 break; 9894 break;
9904 if (share) 9895 if (share)
@@ -9944,11 +9935,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
9944 dpyinfo->next = x_display_list; 9935 dpyinfo->next = x_display_list;
9945 x_display_list = dpyinfo; 9936 x_display_list = dpyinfo;
9946 9937
9947 /* Put it on x_display_name_list as well, to keep them parallel. */ 9938 dpyinfo->name_list_element = Fcons (display_name, Qnil);
9948 x_display_name_list = Fcons (Fcons (display_name, Qnil),
9949 x_display_name_list);
9950 dpyinfo->name_list_element = XCAR (x_display_name_list);
9951
9952 dpyinfo->display = dpy; 9939 dpyinfo->display = dpy;
9953 9940
9954 /* Set the name of the terminal. */ 9941 /* Set the name of the terminal. */
@@ -10275,27 +10262,6 @@ x_delete_display (struct x_display_info *dpyinfo)
10275 break; 10262 break;
10276 } 10263 }
10277 10264
10278 /* Discard this display from x_display_name_list and x_display_list.
10279 We can't use Fdelq because that can quit. */
10280 if (! NILP (x_display_name_list)
10281 && EQ (XCAR (x_display_name_list), dpyinfo->name_list_element))
10282 x_display_name_list = XCDR (x_display_name_list);
10283 else
10284 {
10285 Lisp_Object tail;
10286
10287 tail = x_display_name_list;
10288 while (CONSP (tail) && CONSP (XCDR (tail)))
10289 {
10290 if (EQ (XCAR (XCDR (tail)), dpyinfo->name_list_element))
10291 {
10292 XSETCDR (tail, XCDR (XCDR (tail)));
10293 break;
10294 }
10295 tail = XCDR (tail);
10296 }
10297 }
10298
10299 if (next_noop_dpyinfo == dpyinfo) 10265 if (next_noop_dpyinfo == dpyinfo)
10300 next_noop_dpyinfo = dpyinfo->next; 10266 next_noop_dpyinfo = dpyinfo->next;
10301 10267
@@ -10565,9 +10531,6 @@ syms_of_xterm (void)
10565{ 10531{
10566 x_error_message = NULL; 10532 x_error_message = NULL;
10567 10533
10568 staticpro (&x_display_name_list);
10569 x_display_name_list = Qnil;
10570
10571 DEFSYM (Qvendor_specific_keysyms, "vendor-specific-keysyms"); 10534 DEFSYM (Qvendor_specific_keysyms, "vendor-specific-keysyms");
10572 DEFSYM (Qlatin_1, "latin-1"); 10535 DEFSYM (Qlatin_1, "latin-1");
10573 10536
diff --git a/src/xterm.h b/src/xterm.h
index 5ec4851a0e1..06c0d4882b8 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -142,8 +142,7 @@ struct x_display_info
142 /* This says how to access this display in Xlib. */ 142 /* This says how to access this display in Xlib. */
143 Display *display; 143 Display *display;
144 144
145 /* This is a cons cell of the form (NAME . FONT-LIST-CACHE). 145 /* This is a cons cell of the form (NAME . FONT-LIST-CACHE). */
146 The same cons cell also appears in x_display_name_list. */
147 Lisp_Object name_list_element; 146 Lisp_Object name_list_element;
148 147
149 /* Number of frames that are on this display. */ 148 /* Number of frames that are on this display. */
@@ -412,12 +411,6 @@ extern int use_xim;
412/* This is a chain of structures for all the X displays currently in use. */ 411/* This is a chain of structures for all the X displays currently in use. */
413extern struct x_display_info *x_display_list; 412extern struct x_display_info *x_display_list;
414 413
415/* This is a list of cons cells, each of the form (NAME . FONT-LIST-CACHE),
416 one for each element of x_display_list and in the same order.
417 NAME is the name of the frame.
418 FONT-LIST-CACHE records previous values returned by x-list-fonts. */
419extern Lisp_Object x_display_name_list;
420
421extern struct x_display_info *x_display_info_for_display (Display *); 414extern struct x_display_info *x_display_info_for_display (Display *);
422extern struct frame *x_top_window_to_frame (struct x_display_info *, int); 415extern struct frame *x_top_window_to_frame (struct x_display_info *, int);
423extern struct x_display_info *x_term_init (Lisp_Object, char *, char *); 416extern struct x_display_info *x_term_init (Lisp_Object, char *, char *);