aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog97
-rw-r--r--src/alloc.c14
-rw-r--r--src/chartab.c47
-rw-r--r--src/dispextern.h2
-rw-r--r--src/dispnew.c52
-rw-r--r--src/font.c55
-rw-r--r--src/font.h32
-rw-r--r--src/frame.c16
-rw-r--r--src/frame.h8
-rw-r--r--src/ftfont.c2
-rw-r--r--src/ftxfont.c24
-rw-r--r--src/keymap.c42
-rw-r--r--src/lisp.h47
-rw-r--r--src/lread.c41
-rw-r--r--src/macfont.m2
-rw-r--r--src/menu.c5
-rw-r--r--src/nsfont.m2
-rw-r--r--src/print.c14
-rw-r--r--src/w32fns.c107
-rw-r--r--src/w32font.c15
-rw-r--r--src/w32uniscribe.c4
-rw-r--r--src/window.h6
-rw-r--r--src/xdisp.c11
-rw-r--r--src/xfaces.c16
-rw-r--r--src/xfont.c2
-rw-r--r--src/xftfont.c8
-rw-r--r--src/xselect.c16
27 files changed, 347 insertions, 340 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 1db9e8768e3..61ada3aa0d5 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,9 +1,101 @@
12014-07-01 K. Handa <handa@gnu.org> 12014-07-04 K. Handa <handa@gnu.org>
2 2
3 * coding.c (MIN_CHARBUF_SIZE): Delete it. 3 * coding.c (MIN_CHARBUF_SIZE): Delete it.
4 (MAX_CHARBUF_EXTRA_SIZE): New macro. 4 (MAX_CHARBUF_EXTRA_SIZE): New macro.
5 (ALLOC_CONVERSION_WORK_AREA): Use MAX_CHARBUF_EXTRA_SIZE. 5 (ALLOC_CONVERSION_WORK_AREA): Use MAX_CHARBUF_EXTRA_SIZE.
6 6
72014-07-04 Dmitry Antipov <dmantipov@yandex.ru>
8
9 * font.h (struct font_driver): Remove get_outline and free_outline;
10 not used by any font driver.
11 * ftfont.c (ftfont_driver):
12 * macfont.m (macfont_driver):
13 * nsfont.m (nsfont_driver):
14 * w32font.c (w32font_driver):
15 * w32uniscribe.c (uniscribe_font_driver):
16 * xfont.c (xfont_driver): Related users changed.
17 * xselect.c (x_get_window_property): Use convenient xmalloc.
18 Call to xfree only if some data was really allocated.
19
202014-07-03 Dmitry Antipov <dmantipov@yandex.ru>
21
22 On MS-Windows, display busy cursor on all GUI frames.
23 This is similar to what we have on X. Quickly tested by Dani Moncayo.
24 * w32fns.c (toplevel): Remove hourglass_hwnd; no longer used.
25 (w32_show_hourglass, w32_hide_hourglass, w32_note_current_window):
26 Likewise.
27 (hide_hourglass, show_hourglass): Redesign to match X counterparts.
28 * xdisp.c (start_hourglass): Remove Windows-specific bits.
29
302014-07-03 Dmitry Antipov <dmantipov@yandex.ru>
31
32 Use convenient alists to manage per-frame font driver-specific data.
33 * frame.h (struct frame): Rename font_data_list to...
34 [HAVE_XFT || HAVE_FREETYPE]: ... font_data, which is a Lisp_Object now.
35 * font.h (struct font_data_list): Remove; no longer need a special
36 data type.
37 (font_put_frame_data, font_get_frame_data) [HAVE_XFT || HAVE_FREETYPE]:
38 Adjust prototypes.
39 * font.c (font_put_frame_data, font_get_frame_data)
40 [HAVE_XFT || HAVE_FREETYPE]: Prefer alist functions to ad-hoc list
41 management.
42 * xftfont.c (xftfont_get_xft_draw, xftfont_end_for_frame):
43 Related users changed.
44 * ftxfont.c (ftxfont_get_gcs, ftxfont_end_for_frame): Likewise.
45 Prefer convenient xmalloc and xfree.
46
472014-07-03 Eli Zaretskii <eliz@gnu.org>
48
49 * dispnew.c (prepare_desired_row): Accept 2 additional arguments:
50 the window whose glyph row is being prepared and a flag whether it
51 is for mode/header line. Make sure the glyph row's marginal areas
52 are in sync with what the window wants.
53 (Bug#17892)
54
55 * xdisp.c (display_line, display_mode_line): Call
56 prepare_desired_row with additional arguments, as appropriate.
57
58 * dispextern.h (prepare_desired_row): Adjust prototype.
59
602014-07-03 Dmitry Antipov <dmantipov@yandex.ru>
61
62 * xfaces.c (init_frame_faces): Always realize basic faces (Bug#17889).
63 * menu.c (Fx_popup_dialog): Set Vmenu_updating_frame to avoid crash
64 caused by xw_popup_dialog in daemon mode (Bug#17891).
65
662014-07-03 Eli Zaretskii <eliz@gnu.org>
67
68 * frame.c (do_switch_frame): When switching to another TTY frame,
69 make sure FrameCols and FrameRows are in sync with the new frame's
70 data. (Bug#17875)
71
722014-07-02 Dmitry Antipov <dmantipov@yandex.ru>
73
74 Shrink Lisp_Sub_Char_Table by preferring C integers to Lisp_Objects.
75 * lisp.h (struct Lisp_Sub_Char_Table): Use C integers for depth and
76 min_char slots. Adjust comment.
77 (enum char_table_specials): Rename from CHAR_TABLE_STANDARD_SLOTS.
78 Add SUB_CHAR_TABLE_OFFSET member.
79 (make_uninit_sub_char_table): New function.
80 (toplevel): Add compile-time assert to verify suitable member layout
81 in Lisp_Sub_Char_Table.
82 * alloc.c (mark_char_table): Add extra argument to denote char table
83 subtype. Adjust to match new layout of sub char-table.
84 (mark_object): Always mark sub char-tables with mark_char_table.
85 * chartab.c (make_sub_char_table, copy_sub_char_table)
86 (sub_char_table_ref, sub_char_table_ref_and_range, sub_char_table_set)
87 (sub_char_table_set_range, optimize_sub_char_table, map_sub_char_table)
88 (map_sub_char_table_for_charset, uniprop_table_uncompress):
89 All related users changed.
90 * lread.c (read1): Adjust to match new layout of sub char-table.
91 * print.c (print_object): Likewise (Bug#17898).
92
932014-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
94
95 * keymap.c (get_keyelt): Simplify.
96 (copy_keymap_item): Remove left-over code for when we had
97 key-shortcut caches.
98
72014-06-30 Jan Djärv <jan.h.d@swipnet.se> 992014-06-30 Jan Djärv <jan.h.d@swipnet.se>
8 100
9 * nsterm.m (judge): EmacsScroller: Move dealloc code here. 101 * nsterm.m (judge): EmacsScroller: Move dealloc code here.
@@ -25,8 +117,7 @@
25 (mouseMoved:): Set any_help_event_p to YES if help event is 117 (mouseMoved:): Set any_help_event_p to YES if help event is
26 generated. Remove else with empty help event that triggered redisplay 118 generated. Remove else with empty help event that triggered redisplay
27 for every mouse move. 119 for every mouse move.
28 (windowDidResignKey:): If any_help_event_p, generate empty help 120 (windowDidResignKey:): If any_help_event_p, generate empty help event.
29 event.
30 121
312014-06-29 Dmitry Antipov <dmantipov@yandex.ru> 1222014-06-29 Dmitry Antipov <dmantipov@yandex.ru>
32 123
diff --git a/src/alloc.c b/src/alloc.c
index e2213db853d..6eb2e756ed1 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -5958,14 +5958,15 @@ mark_vectorlike (struct Lisp_Vector *ptr)
5958 symbols. */ 5958 symbols. */
5959 5959
5960static void 5960static void
5961mark_char_table (struct Lisp_Vector *ptr) 5961mark_char_table (struct Lisp_Vector *ptr, enum pvec_type pvectype)
5962{ 5962{
5963 int size = ptr->header.size & PSEUDOVECTOR_SIZE_MASK; 5963 int size = ptr->header.size & PSEUDOVECTOR_SIZE_MASK;
5964 int i; 5964 /* Consult the Lisp_Sub_Char_Table layout before changing this. */
5965 int i, idx = (pvectype == PVEC_SUB_CHAR_TABLE ? SUB_CHAR_TABLE_OFFSET : 0);
5965 5966
5966 eassert (!VECTOR_MARKED_P (ptr)); 5967 eassert (!VECTOR_MARKED_P (ptr));
5967 VECTOR_MARK (ptr); 5968 VECTOR_MARK (ptr);
5968 for (i = 0; i < size; i++) 5969 for (i = idx; i < size; i++)
5969 { 5970 {
5970 Lisp_Object val = ptr->contents[i]; 5971 Lisp_Object val = ptr->contents[i];
5971 5972
@@ -5974,7 +5975,7 @@ mark_char_table (struct Lisp_Vector *ptr)
5974 if (SUB_CHAR_TABLE_P (val)) 5975 if (SUB_CHAR_TABLE_P (val))
5975 { 5976 {
5976 if (! VECTOR_MARKED_P (XVECTOR (val))) 5977 if (! VECTOR_MARKED_P (XVECTOR (val)))
5977 mark_char_table (XVECTOR (val)); 5978 mark_char_table (XVECTOR (val), PVEC_SUB_CHAR_TABLE);
5978 } 5979 }
5979 else 5980 else
5980 mark_object (val); 5981 mark_object (val);
@@ -6320,7 +6321,8 @@ mark_object (Lisp_Object arg)
6320 break; 6321 break;
6321 6322
6322 case PVEC_CHAR_TABLE: 6323 case PVEC_CHAR_TABLE:
6323 mark_char_table (ptr); 6324 case PVEC_SUB_CHAR_TABLE:
6325 mark_char_table (ptr, (enum pvec_type) pvectype);
6324 break; 6326 break;
6325 6327
6326 case PVEC_BOOL_VECTOR: 6328 case PVEC_BOOL_VECTOR:
@@ -7218,7 +7220,7 @@ The time is in seconds as a floating point value. */);
7218union 7220union
7219{ 7221{
7220 enum CHARTAB_SIZE_BITS CHARTAB_SIZE_BITS; 7222 enum CHARTAB_SIZE_BITS CHARTAB_SIZE_BITS;
7221 enum CHAR_TABLE_STANDARD_SLOTS CHAR_TABLE_STANDARD_SLOTS; 7223 enum char_table_specials char_table_specials;
7222 enum char_bits char_bits; 7224 enum char_bits char_bits;
7223 enum CHECK_LISP_OBJECT_TYPE CHECK_LISP_OBJECT_TYPE; 7225 enum CHECK_LISP_OBJECT_TYPE CHECK_LISP_OBJECT_TYPE;
7224 enum DEFAULT_HASH_SIZE DEFAULT_HASH_SIZE; 7226 enum DEFAULT_HASH_SIZE DEFAULT_HASH_SIZE;
diff --git a/src/chartab.c b/src/chartab.c
index 4d4e6381b19..3906ad30b37 100644
--- a/src/chartab.c
+++ b/src/chartab.c
@@ -140,15 +140,11 @@ the char-table has no extra slot. */)
140static Lisp_Object 140static Lisp_Object
141make_sub_char_table (int depth, int min_char, Lisp_Object defalt) 141make_sub_char_table (int depth, int min_char, Lisp_Object defalt)
142{ 142{
143 Lisp_Object table; 143 int i;
144 int size = (PSEUDOVECSIZE (struct Lisp_Sub_Char_Table, contents) 144 Lisp_Object table = make_uninit_sub_char_table (depth, min_char);
145 + chartab_size[depth]);
146
147 table = Fmake_vector (make_number (size), defalt);
148 XSETPVECTYPE (XVECTOR (table), PVEC_SUB_CHAR_TABLE);
149 XSUB_CHAR_TABLE (table)->depth = make_number (depth);
150 XSUB_CHAR_TABLE (table)->min_char = make_number (min_char);
151 145
146 for (i = 0; i < chartab_size[depth]; i++)
147 XSUB_CHAR_TABLE (table)->contents[i] = defalt;
152 return table; 148 return table;
153} 149}
154 150
@@ -172,8 +168,8 @@ char_table_ascii (Lisp_Object table)
172static Lisp_Object 168static Lisp_Object
173copy_sub_char_table (Lisp_Object table) 169copy_sub_char_table (Lisp_Object table)
174{ 170{
175 int depth = XINT (XSUB_CHAR_TABLE (table)->depth); 171 int depth = XSUB_CHAR_TABLE (table)->depth;
176 int min_char = XINT (XSUB_CHAR_TABLE (table)->min_char); 172 int min_char = XSUB_CHAR_TABLE (table)->min_char;
177 Lisp_Object copy = make_sub_char_table (depth, min_char, Qnil); 173 Lisp_Object copy = make_sub_char_table (depth, min_char, Qnil);
178 int i; 174 int i;
179 175
@@ -220,10 +216,8 @@ static Lisp_Object
220sub_char_table_ref (Lisp_Object table, int c, bool is_uniprop) 216sub_char_table_ref (Lisp_Object table, int c, bool is_uniprop)
221{ 217{
222 struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); 218 struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table);
223 int depth = XINT (tbl->depth);
224 int min_char = XINT (tbl->min_char);
225 Lisp_Object val; 219 Lisp_Object val;
226 int idx = CHARTAB_IDX (c, depth, min_char); 220 int idx = CHARTAB_IDX (c, tbl->depth, tbl->min_char);
227 221
228 val = tbl->contents[idx]; 222 val = tbl->contents[idx];
229 if (is_uniprop && UNIPROP_COMPRESSED_FORM_P (val)) 223 if (is_uniprop && UNIPROP_COMPRESSED_FORM_P (val))
@@ -265,8 +259,7 @@ sub_char_table_ref_and_range (Lisp_Object table, int c, int *from, int *to,
265 Lisp_Object defalt, bool is_uniprop) 259 Lisp_Object defalt, bool is_uniprop)
266{ 260{
267 struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); 261 struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table);
268 int depth = XINT (tbl->depth); 262 int depth = tbl->depth, min_char = tbl->min_char;
269 int min_char = XINT (tbl->min_char);
270 int chartab_idx = CHARTAB_IDX (c, depth, min_char), idx; 263 int chartab_idx = CHARTAB_IDX (c, depth, min_char), idx;
271 Lisp_Object val; 264 Lisp_Object val;
272 265
@@ -402,8 +395,7 @@ static void
402sub_char_table_set (Lisp_Object table, int c, Lisp_Object val, bool is_uniprop) 395sub_char_table_set (Lisp_Object table, int c, Lisp_Object val, bool is_uniprop)
403{ 396{
404 struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); 397 struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table);
405 int depth = XINT ((tbl)->depth); 398 int depth = tbl->depth, min_char = tbl->min_char;
406 int min_char = XINT ((tbl)->min_char);
407 int i = CHARTAB_IDX (c, depth, min_char); 399 int i = CHARTAB_IDX (c, depth, min_char);
408 Lisp_Object sub; 400 Lisp_Object sub;
409 401
@@ -458,8 +450,7 @@ sub_char_table_set_range (Lisp_Object table, int from, int to, Lisp_Object val,
458 bool is_uniprop) 450 bool is_uniprop)
459{ 451{
460 struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); 452 struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table);
461 int depth = XINT ((tbl)->depth); 453 int depth = tbl->depth, min_char = tbl->min_char;
462 int min_char = XINT ((tbl)->min_char);
463 int chars_in_block = chartab_chars[depth]; 454 int chars_in_block = chartab_chars[depth];
464 int i, c, lim = chartab_size[depth]; 455 int i, c, lim = chartab_size[depth];
465 456
@@ -689,9 +680,8 @@ static Lisp_Object
689optimize_sub_char_table (Lisp_Object table, Lisp_Object test) 680optimize_sub_char_table (Lisp_Object table, Lisp_Object test)
690{ 681{
691 struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); 682 struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table);
692 int depth = XINT (tbl->depth); 683 int i, depth = tbl->depth;
693 Lisp_Object elt, this; 684 Lisp_Object elt, this;
694 int i;
695 bool optimizable; 685 bool optimizable;
696 686
697 elt = XSUB_CHAR_TABLE (table)->contents[0]; 687 elt = XSUB_CHAR_TABLE (table)->contents[0];
@@ -778,8 +768,8 @@ map_sub_char_table (void (*c_function) (Lisp_Object, Lisp_Object, Lisp_Object),
778 { 768 {
779 struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); 769 struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table);
780 770
781 depth = XINT (tbl->depth); 771 depth = tbl->depth;
782 min_char = XINT (tbl->min_char); 772 min_char = tbl->min_char;
783 max_char = min_char + chartab_chars[depth - 1] - 1; 773 max_char = min_char + chartab_chars[depth - 1] - 1;
784 } 774 }
785 else 775 else
@@ -973,12 +963,10 @@ map_sub_char_table_for_charset (void (*c_function) (Lisp_Object, Lisp_Object),
973 unsigned from, unsigned to) 963 unsigned from, unsigned to)
974{ 964{
975 struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); 965 struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table);
976 int depth = XINT (tbl->depth); 966 int i, c = tbl->min_char, depth = tbl->depth;
977 int c, i;
978 967
979 if (depth < 3) 968 if (depth < 3)
980 for (i = 0, c = XINT (tbl->min_char); i < chartab_size[depth]; 969 for (i = 0; i < chartab_size[depth]; i++, c += chartab_chars[depth])
981 i++, c += chartab_chars[depth])
982 { 970 {
983 Lisp_Object this; 971 Lisp_Object this;
984 972
@@ -1000,7 +988,7 @@ map_sub_char_table_for_charset (void (*c_function) (Lisp_Object, Lisp_Object),
1000 } 988 }
1001 } 989 }
1002 else 990 else
1003 for (i = 0, c = XINT (tbl->min_char); i < chartab_size[depth]; i++, c ++) 991 for (i = 0; i < chartab_size[depth]; i++, c++)
1004 { 992 {
1005 Lisp_Object this; 993 Lisp_Object this;
1006 unsigned code; 994 unsigned code;
@@ -1147,8 +1135,7 @@ static Lisp_Object
1147uniprop_table_uncompress (Lisp_Object table, int idx) 1135uniprop_table_uncompress (Lisp_Object table, int idx)
1148{ 1136{
1149 Lisp_Object val = XSUB_CHAR_TABLE (table)->contents[idx]; 1137 Lisp_Object val = XSUB_CHAR_TABLE (table)->contents[idx];
1150 int min_char = (XINT (XSUB_CHAR_TABLE (table)->min_char) 1138 int min_char = XSUB_CHAR_TABLE (table)->min_char + chartab_chars[2] * idx;
1151 + chartab_chars[2] * idx);
1152 Lisp_Object sub = make_sub_char_table (3, min_char, Qnil); 1139 Lisp_Object sub = make_sub_char_table (3, min_char, Qnil);
1153 const unsigned char *p, *pend; 1140 const unsigned char *p, *pend;
1154 1141
diff --git a/src/dispextern.h b/src/dispextern.h
index 5396aeb6c8e..0e04cc466d3 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -3460,7 +3460,7 @@ void increment_matrix_positions (struct glyph_matrix *,
3460void blank_row (struct window *, struct glyph_row *, int); 3460void blank_row (struct window *, struct glyph_row *, int);
3461void clear_glyph_matrix_rows (struct glyph_matrix *, int, int); 3461void clear_glyph_matrix_rows (struct glyph_matrix *, int, int);
3462void clear_glyph_row (struct glyph_row *); 3462void clear_glyph_row (struct glyph_row *);
3463void prepare_desired_row (struct glyph_row *); 3463void prepare_desired_row (struct window *, struct glyph_row *, bool);
3464void update_single_window (struct window *, bool); 3464void update_single_window (struct window *, bool);
3465void do_pending_window_change (bool); 3465void do_pending_window_change (bool);
3466void change_frame_size (struct frame *, int, int, bool, bool, bool, bool); 3466void change_frame_size (struct frame *, int, int, bool, bool, bool, bool);
diff --git a/src/dispnew.c b/src/dispnew.c
index 163780952a6..2d137b4abbd 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -449,7 +449,8 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y
449 + x); 449 + x);
450 450
451 if (w == NULL 451 if (w == NULL
452 || row == matrix->rows + dim.height - 1 452 || (row == matrix->rows + dim.height - 1
453 && WINDOW_WANTS_MODELINE_P (w))
453 || (row == matrix->rows && matrix->header_line_p)) 454 || (row == matrix->rows && matrix->header_line_p))
454 { 455 {
455 row->glyphs[TEXT_AREA] 456 row->glyphs[TEXT_AREA]
@@ -492,8 +493,9 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y
492 = xnrealloc (row->glyphs[LEFT_MARGIN_AREA], 493 = xnrealloc (row->glyphs[LEFT_MARGIN_AREA],
493 dim.width, sizeof (struct glyph)); 494 dim.width, sizeof (struct glyph));
494 495
495 /* The mode line never has marginal areas. */ 496 /* The mode line, if displayed, never has marginal areas. */
496 if (row == matrix->rows + dim.height - 1 497 if ((row == matrix->rows + dim.height - 1
498 && !(w && WINDOW_WANTS_MODELINE_P (w)))
497 || (row == matrix->rows && matrix->header_line_p)) 499 || (row == matrix->rows && matrix->header_line_p))
498 { 500 {
499 row->glyphs[TEXT_AREA] 501 row->glyphs[TEXT_AREA]
@@ -1049,13 +1051,16 @@ find_glyph_row_slice (struct glyph_matrix *window_matrix,
1049 1051
1050#endif /* 0 */ 1052#endif /* 0 */
1051 1053
1052/* Prepare ROW for display. Desired rows are cleared lazily, 1054/* Prepare ROW for display in windows W. Desired rows are cleared
1053 i.e. they are only marked as to be cleared by setting their 1055 lazily, i.e. they are only marked as to be cleared by setting their
1054 enabled_p flag to zero. When a row is to be displayed, a prior 1056 enabled_p flag to zero. When a row is to be displayed, a prior
1055 call to this function really clears it. */ 1057 call to this function really clears it. In addition, this function
1058 makes sure the marginal areas of ROW are in sync with the window's
1059 display margins. MODE_LINE_P non-zero means we are preparing a
1060 glyph row for header line or mode line. */
1056 1061
1057void 1062void
1058prepare_desired_row (struct glyph_row *row) 1063prepare_desired_row (struct window *w, struct glyph_row *row, bool mode_line_p)
1059{ 1064{
1060 if (!row->enabled_p) 1065 if (!row->enabled_p)
1061 { 1066 {
@@ -1065,6 +1070,39 @@ prepare_desired_row (struct glyph_row *row)
1065 row->enabled_p = true; 1070 row->enabled_p = true;
1066 row->reversed_p = rp; 1071 row->reversed_p = rp;
1067 } 1072 }
1073 if (mode_line_p)
1074 {
1075 /* Mode and header lines, if displayed, never have marginal
1076 areas. If we are called with MODE_LINE_P non-zero, we are
1077 displaying the mode/header line in this window, and so the
1078 marginal areas of this glyph row should be eliminated. This
1079 is needed when the mode/header line is switched on in a
1080 window that has display margins. */
1081 if (w->left_margin_cols > 0)
1082 row->glyphs[TEXT_AREA] = row->glyphs[LEFT_MARGIN_AREA];
1083 if (w->right_margin_cols > 0)
1084 row->glyphs[RIGHT_MARGIN_AREA] = row->glyphs[LAST_AREA];
1085 }
1086 else if (row == MATRIX_MODE_LINE_ROW (w->desired_matrix)
1087 || row == MATRIX_HEADER_LINE_ROW (w->desired_matrix))
1088 {
1089 /* The real number of glyphs reserved for the margins is
1090 recorded in the glyph matrix, and can be different from
1091 window's left_margin_cols and right_margin_cols; see
1092 margin_glyphs_to_reserve for when that happens. */
1093 int left = w->desired_matrix->left_margin_glyphs;
1094 int right = w->desired_matrix->right_margin_glyphs;
1095
1096 /* Make sure the marginal areas of this row are in sync with
1097 what the window wants, when the 1st/last row of the matrix
1098 actually displays text and not header/mode line. */
1099 if (w->left_margin_cols > 0
1100 && (left != row->glyphs[TEXT_AREA] - row->glyphs[LEFT_MARGIN_AREA]))
1101 row->glyphs[TEXT_AREA] = row->glyphs[LEFT_MARGIN_AREA] + left;
1102 if (w->right_margin_cols > 0
1103 && (right != row->glyphs[LAST_AREA] - row->glyphs[RIGHT_MARGIN_AREA]))
1104 row->glyphs[RIGHT_MARGIN_AREA] = row->glyphs[LAST_AREA] - right;
1105 }
1068} 1106}
1069 1107
1070 1108
diff --git a/src/font.c b/src/font.c
index 251d43ba8b2..7b9edcd3fb8 100644
--- a/src/font.c
+++ b/src/font.c
@@ -3539,53 +3539,34 @@ font_update_drivers (struct frame *f, Lisp_Object new_drivers)
3539 return active_drivers; 3539 return active_drivers;
3540} 3540}
3541 3541
3542int 3542#if defined (HAVE_XFT) || defined (HAVE_FREETYPE)
3543font_put_frame_data (struct frame *f, struct font_driver *driver, void *data)
3544{
3545 struct font_data_list *list, *prev;
3546 3543
3547 for (prev = NULL, list = f->font_data_list; list; 3544void
3548 prev = list, list = list->next) 3545font_put_frame_data (struct frame *f, Lisp_Object driver, void *data)
3549 if (list->driver == driver) 3546{
3550 break; 3547 Lisp_Object val = assq_no_quit (driver, f->font_data);
3551 if (! data)
3552 {
3553 if (list)
3554 {
3555 if (prev)
3556 prev->next = list->next;
3557 else
3558 f->font_data_list = list->next;
3559 xfree (list);
3560 }
3561 return 0;
3562 }
3563 3548
3564 if (! list) 3549 if (!data)
3550 f->font_data = Fdelq (val, f->font_data);
3551 else
3565 { 3552 {
3566 list = xmalloc (sizeof *list); 3553 if (NILP (val))
3567 list->driver = driver; 3554 f->font_data = Fcons (Fcons (driver, make_save_ptr (data)),
3568 list->next = f->font_data_list; 3555 f->font_data);
3569 f->font_data_list = list; 3556 else
3557 XSETCDR (val, make_save_ptr (data));
3570 } 3558 }
3571 list->data = data;
3572 return 0;
3573} 3559}
3574 3560
3575
3576void * 3561void *
3577font_get_frame_data (struct frame *f, struct font_driver *driver) 3562font_get_frame_data (struct frame *f, Lisp_Object driver)
3578{ 3563{
3579 struct font_data_list *list; 3564 Lisp_Object val = assq_no_quit (driver, f->font_data);
3580 3565
3581 for (list = f->font_data_list; list; list = list->next) 3566 return NILP (val) ? NULL : XSAVE_POINTER (XCDR (val), 0);
3582 if (list->driver == driver)
3583 break;
3584 if (! list)
3585 return NULL;
3586 return list->data;
3587} 3567}
3588 3568
3569#endif /* HAVE_XFT || HAVE_FREETYPE */
3589 3570
3590/* Sets attributes on a font. Any properties that appear in ALIST and 3571/* Sets attributes on a font. Any properties that appear in ALIST and
3591 BOOLEAN_PROPERTIES or NON_BOOLEAN_PROPERTIES are set on the font. 3572 BOOLEAN_PROPERTIES or NON_BOOLEAN_PROPERTIES are set on the font.
diff --git a/src/font.h b/src/font.h
index 42137deeaa4..c23b826bd46 100644
--- a/src/font.h
+++ b/src/font.h
@@ -614,15 +614,6 @@ struct font_driver
614#endif /* HAVE_WINDOW_SYSTEM */ 614#endif /* HAVE_WINDOW_SYSTEM */
615 615
616 /* Optional. 616 /* Optional.
617 Return an outline data for glyph-code CODE of FONT. The format
618 of the outline data depends on the font-driver. */
619 void *(*get_outline) (struct font *font, unsigned code);
620
621 /* Optional.
622 Free OUTLINE (that is obtained by the above method). */
623 void (*free_outline) (struct font *font, void *outline);
624
625 /* Optional.
626 Get coordinates of the INDEXth anchor point of the glyph whose 617 Get coordinates of the INDEXth anchor point of the glyph whose
627 code is CODE. Store the coordinates in *X and *Y. Return 0 if 618 code is CODE. Store the coordinates in *X and *Y. Return 0 if
628 the operations was successful. Otherwise return -1. */ 619 the operations was successful. Otherwise return -1. */
@@ -723,20 +714,6 @@ struct font_driver_list
723 struct font_driver_list *next; 714 struct font_driver_list *next;
724}; 715};
725 716
726
727/* Chain of arbitrary data specific to each font driver.
728 Each frame has its own font data list at F->font_data_list. */
729
730struct font_data_list
731{
732 /* Pointer to the font driver. */
733 struct font_driver *driver;
734 /* Data specific to the font driver. */
735 void *data;
736 /* Pointer to the next element of the chain. */
737 struct font_data_list *next;
738};
739
740extern Lisp_Object copy_font_spec (Lisp_Object); 717extern Lisp_Object copy_font_spec (Lisp_Object);
741extern Lisp_Object merge_font_spec (Lisp_Object, Lisp_Object); 718extern Lisp_Object merge_font_spec (Lisp_Object, Lisp_Object);
742 719
@@ -809,11 +786,10 @@ extern void font_fill_lglyph_metrics (Lisp_Object, Lisp_Object);
809extern Lisp_Object font_put_extra (Lisp_Object font, Lisp_Object prop, 786extern Lisp_Object font_put_extra (Lisp_Object font, Lisp_Object prop,
810 Lisp_Object val); 787 Lisp_Object val);
811 788
812extern int font_put_frame_data (struct frame *f, 789#if defined (HAVE_XFT) || defined (HAVE_FREETYPE)
813 struct font_driver *driver, 790extern void font_put_frame_data (struct frame *, Lisp_Object, void *);
814 void *data); 791extern void *font_get_frame_data (struct frame *f, Lisp_Object);
815extern void *font_get_frame_data (struct frame *f, 792#endif /* HAVE_XFT || HAVE_FREETYPE */
816 struct font_driver *driver);
817 793
818extern void font_filter_properties (Lisp_Object font, 794extern void font_filter_properties (Lisp_Object font,
819 Lisp_Object alist, 795 Lisp_Object alist,
diff --git a/src/frame.c b/src/frame.c
index c67a233f099..0ccc0f6fcfd 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -46,6 +46,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
46#ifdef HAVE_WINDOW_SYSTEM 46#ifdef HAVE_WINDOW_SYSTEM
47#include "fontset.h" 47#include "fontset.h"
48#endif 48#endif
49#include "cm.h"
49#ifdef MSDOS 50#ifdef MSDOS
50#include "msdos.h" 51#include "msdos.h"
51#include "dosfns.h" 52#include "dosfns.h"
@@ -854,7 +855,9 @@ do_switch_frame (Lisp_Object frame, int track, int for_deletion, Lisp_Object nor
854 855
855 if (FRAME_TERMCAP_P (XFRAME (frame)) || FRAME_MSDOS_P (XFRAME (frame))) 856 if (FRAME_TERMCAP_P (XFRAME (frame)) || FRAME_MSDOS_P (XFRAME (frame)))
856 { 857 {
857 Lisp_Object top_frame = FRAME_TTY (XFRAME (frame))->top_frame; 858 struct frame *f = XFRAME (frame);
859 struct tty_display_info *tty = FRAME_TTY (f);
860 Lisp_Object top_frame = tty->top_frame;
858 861
859 /* Don't mark the frame garbaged and/or obscured if we are 862 /* Don't mark the frame garbaged and/or obscured if we are
860 switching to the frame that is already the top frame of that 863 switching to the frame that is already the top frame of that
@@ -864,9 +867,16 @@ do_switch_frame (Lisp_Object frame, int track, int for_deletion, Lisp_Object nor
864 if (FRAMEP (top_frame)) 867 if (FRAMEP (top_frame))
865 /* Mark previously displayed frame as now obscured. */ 868 /* Mark previously displayed frame as now obscured. */
866 SET_FRAME_VISIBLE (XFRAME (top_frame), 2); 869 SET_FRAME_VISIBLE (XFRAME (top_frame), 2);
867 SET_FRAME_VISIBLE (XFRAME (frame), 1); 870 SET_FRAME_VISIBLE (f, 1);
871 /* If the new TTY frame changed dimensions, we need to
872 resync term.c's idea of the frame size with the new
873 frame's data. */
874 if (FRAME_COLS (f) != FrameCols (tty))
875 FrameCols (tty) = FRAME_COLS (f);
876 if (FRAME_LINES (f) != FrameRows (tty))
877 FrameRows (tty) = FRAME_LINES (f);
868 } 878 }
869 FRAME_TTY (XFRAME (frame))->top_frame = frame; 879 tty->top_frame = frame;
870 } 880 }
871 881
872 selected_frame = frame; 882 selected_frame = frame;
diff --git a/src/frame.h b/src/frame.h
index 2da9fff2d4a..4fb98278a51 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -159,6 +159,11 @@ struct frame
159 tool bar only supports top. */ 159 tool bar only supports top. */
160 Lisp_Object tool_bar_position; 160 Lisp_Object tool_bar_position;
161 161
162#if defined (HAVE_XFT) || defined (HAVE_FREETYPE)
163 /* List of data specific to font-driver and frame, but common to faces. */
164 Lisp_Object font_data;
165#endif
166
162 /* Beyond here, there should be no more Lisp_Object components. */ 167 /* Beyond here, there should be no more Lisp_Object components. */
163 168
164 /* Cache of realized faces. */ 169 /* Cache of realized faces. */
@@ -328,9 +333,6 @@ struct frame
328 333
329 /* List of font-drivers available on the frame. */ 334 /* List of font-drivers available on the frame. */
330 struct font_driver_list *font_driver_list; 335 struct font_driver_list *font_driver_list;
331 /* List of data specific to font-driver and frame, but common to
332 faces. */
333 struct font_data_list *font_data_list;
334 336
335 /* Total width of fringes reserved for drawing truncation bitmaps, 337 /* Total width of fringes reserved for drawing truncation bitmaps,
336 continuation bitmaps and alike. The width is in canonical char 338 continuation bitmaps and alike. The width is in canonical char
diff --git a/src/ftfont.c b/src/ftfont.c
index 0f23b086cf5..7c5d01208d2 100644
--- a/src/ftfont.c
+++ b/src/ftfont.c
@@ -538,8 +538,6 @@ struct font_driver ftfont_driver =
538 NULL, /* draw */ 538 NULL, /* draw */
539 ftfont_get_bitmap, 539 ftfont_get_bitmap,
540 NULL, /* free_bitmap */ 540 NULL, /* free_bitmap */
541 NULL, /* get_outline */
542 NULL, /* free_outline */
543 ftfont_anchor_point, 541 ftfont_anchor_point,
544#ifdef HAVE_LIBOTF 542#ifdef HAVE_LIBOTF
545 ftfont_otf_capability, 543 ftfont_otf_capability,
diff --git a/src/ftxfont.c b/src/ftxfont.c
index 53f2616bb62..63e3477ebf4 100644
--- a/src/ftxfont.c
+++ b/src/ftxfont.c
@@ -59,7 +59,7 @@ ftxfont_get_gcs (struct frame *f, unsigned long foreground, unsigned long backgr
59 XColor color; 59 XColor color;
60 XGCValues xgcv; 60 XGCValues xgcv;
61 int i; 61 int i;
62 struct ftxfont_frame_data *data = font_get_frame_data (f, &ftxfont_driver); 62 struct ftxfont_frame_data *data = font_get_frame_data (f, Qftx);
63 struct ftxfont_frame_data *prev = NULL, *this = NULL, *new; 63 struct ftxfont_frame_data *prev = NULL, *this = NULL, *new;
64 64
65 if (data) 65 if (data)
@@ -78,19 +78,11 @@ ftxfont_get_gcs (struct frame *f, unsigned long foreground, unsigned long backgr
78 } 78 }
79 } 79 }
80 80
81 new = malloc (sizeof *new); 81 new = xmalloc (sizeof *new);
82 if (! new)
83 return NULL;
84 new->next = this; 82 new->next = this;
85 if (prev) 83 if (prev)
86 {
87 prev->next = new; 84 prev->next = new;
88 } 85 font_put_frame_data (f, Qftx, new);
89 else if (font_put_frame_data (f, &ftxfont_driver, new) < 0)
90 {
91 free (new);
92 return NULL;
93 }
94 86
95 new->colors[0].pixel = background; 87 new->colors[0].pixel = background;
96 new->colors[1].pixel = foreground; 88 new->colors[1].pixel = foreground;
@@ -123,8 +115,8 @@ ftxfont_get_gcs (struct frame *f, unsigned long foreground, unsigned long backgr
123 if (prev) 115 if (prev)
124 prev->next = new->next; 116 prev->next = new->next;
125 else if (data) 117 else if (data)
126 font_put_frame_data (f, &ftxfont_driver, new->next); 118 font_put_frame_data (f, Qftx, new->next);
127 free (new); 119 xfree (new);
128 return NULL; 120 return NULL;
129 } 121 }
130 return new->gcs; 122 return new->gcs;
@@ -337,7 +329,7 @@ ftxfont_draw (struct glyph_string *s, int from, int to, int x, int y,
337static int 329static int
338ftxfont_end_for_frame (struct frame *f) 330ftxfont_end_for_frame (struct frame *f)
339{ 331{
340 struct ftxfont_frame_data *data = font_get_frame_data (f, &ftxfont_driver); 332 struct ftxfont_frame_data *data = font_get_frame_data (f, Qftx);
341 333
342 block_input (); 334 block_input ();
343 while (data) 335 while (data)
@@ -347,11 +339,11 @@ ftxfont_end_for_frame (struct frame *f)
347 339
348 for (i = 0; i < 6; i++) 340 for (i = 0; i < 6; i++)
349 XFreeGC (FRAME_X_DISPLAY (f), data->gcs[i]); 341 XFreeGC (FRAME_X_DISPLAY (f), data->gcs[i]);
350 free (data); 342 xfree (data);
351 data = next; 343 data = next;
352 } 344 }
353 unblock_input (); 345 unblock_input ();
354 font_put_frame_data (f, &ftxfont_driver, NULL); 346 font_put_frame_data (f, Qftx, NULL);
355 return 0; 347 return 0;
356} 348}
357 349
diff --git a/src/keymap.c b/src/keymap.c
index 0b2b61dcc05..76119606643 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -727,11 +727,6 @@ get_keyelt (Lisp_Object object, bool autoload)
727 /* This is really the value. */ 727 /* This is really the value. */
728 return object; 728 return object;
729 729
730 /* If the keymap contents looks like (keymap ...) or (lambda ...)
731 then use itself. */
732 else if (EQ (XCAR (object), Qkeymap) || EQ (XCAR (object), Qlambda))
733 return object;
734
735 /* If the keymap contents looks like (menu-item name . DEFN) 730 /* If the keymap contents looks like (menu-item name . DEFN)
736 or (menu-item name DEFN ...) then use DEFN. 731 or (menu-item name DEFN ...) then use DEFN.
737 This is a new format menu item. */ 732 This is a new format menu item. */
@@ -768,25 +763,8 @@ get_keyelt (Lisp_Object object, bool autoload)
768 Keymap alist elements like (CHAR MENUSTRING . DEFN) 763 Keymap alist elements like (CHAR MENUSTRING . DEFN)
769 will be used by HierarKey menus. */ 764 will be used by HierarKey menus. */
770 else if (STRINGP (XCAR (object))) 765 else if (STRINGP (XCAR (object)))
771 { 766 object = XCDR (object);
772 object = XCDR (object);
773 /* Also remove a menu help string, if any,
774 following the menu item name. */
775 if (CONSP (object) && STRINGP (XCAR (object)))
776 object = XCDR (object);
777 /* Also remove the sublist that caches key equivalences, if any. */
778 if (CONSP (object) && CONSP (XCAR (object)))
779 {
780 Lisp_Object carcar;
781 carcar = XCAR (XCAR (object));
782 if (NILP (carcar) || VECTORP (carcar))
783 object = XCDR (object);
784 }
785 }
786 767
787 /* If the contents are (KEYMAP . ELEMENT), go indirect. */
788 else if (KEYMAPP (XCAR (object)))
789 error ("Wow, indirect keymap entry!!");
790 else 768 else
791 return object; 769 return object;
792 } 770 }
@@ -990,9 +968,6 @@ copy_keymap_item (Lisp_Object elt)
990 if (CONSP (tem) && EQ (XCAR (tem), Qkeymap)) 968 if (CONSP (tem) && EQ (XCAR (tem), Qkeymap))
991 XSETCAR (elt, Fcopy_keymap (tem)); 969 XSETCAR (elt, Fcopy_keymap (tem));
992 tem = XCDR (elt); 970 tem = XCDR (elt);
993 if (CONSP (tem) && CONSP (XCAR (tem)))
994 /* Delete cache for key equivalences. */
995 XSETCDR (elt, XCDR (tem));
996 } 971 }
997 } 972 }
998 else 973 else
@@ -1011,16 +986,6 @@ copy_keymap_item (Lisp_Object elt)
1011 elt = XCDR (elt); 986 elt = XCDR (elt);
1012 tem = XCDR (elt); 987 tem = XCDR (elt);
1013 } 988 }
1014 /* There may also be a list that caches key equivalences.
1015 Just delete it for the new keymap. */
1016 if (CONSP (tem)
1017 && CONSP (XCAR (tem))
1018 && (NILP (XCAR (XCAR (tem)))
1019 || VECTORP (XCAR (XCAR (tem)))))
1020 {
1021 XSETCDR (elt, XCDR (tem));
1022 tem = XCDR (tem);
1023 }
1024 if (CONSP (tem) && EQ (XCAR (tem), Qkeymap)) 989 if (CONSP (tem) && EQ (XCAR (tem), Qkeymap))
1025 XSETCDR (elt, Fcopy_keymap (tem)); 990 XSETCDR (elt, Fcopy_keymap (tem));
1026 } 991 }
@@ -2572,9 +2537,8 @@ If FIRSTONLY has another non-nil value, prefer bindings
2572that use the modifier key specified in `where-is-preferred-modifier' 2537that use the modifier key specified in `where-is-preferred-modifier'
2573\(or their meta variants) and entirely reject menu bindings. 2538\(or their meta variants) and entirely reject menu bindings.
2574 2539
2575If optional 4th arg NOINDIRECT is non-nil, don't follow indirections 2540If optional 4th arg NOINDIRECT is non-nil, don't extract the commands inside
2576to other keymaps or slots. This makes it possible to search for an 2541menu-items. This makes it possible to search for a menu-item itself.
2577indirect definition itself.
2578 2542
2579The optional 5th arg NO-REMAP alters how command remapping is handled: 2543The optional 5th arg NO-REMAP alters how command remapping is handled:
2580 2544
diff --git a/src/lisp.h b/src/lisp.h
index fb832b80940..6af390604d6 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1407,10 +1407,11 @@ gc_aset (Lisp_Object array, ptrdiff_t idx, Lisp_Object val)
1407 sense to handle a char-table with type struct Lisp_Vector. An 1407 sense to handle a char-table with type struct Lisp_Vector. An
1408 element of a char table can be any Lisp objects, but if it is a sub 1408 element of a char table can be any Lisp objects, but if it is a sub
1409 char-table, we treat it a table that contains information of a 1409 char-table, we treat it a table that contains information of a
1410 specific range of characters. A sub char-table has the same 1410 specific range of characters. A sub char-table is like a vector but
1411 structure as a vector. A sub char table appears only in an element 1411 with two integer fields between the header and Lisp data, which means
1412 of a char-table, and there's no way to access it directly from 1412 that it has to be marked with some precautions (see mark_char_table
1413 Emacs Lisp program. */ 1413 in alloc.c). A sub char-table appears only in an element of a char-table,
1414 and there's no way to access it directly from Emacs Lisp program. */
1414 1415
1415enum CHARTAB_SIZE_BITS 1416enum CHARTAB_SIZE_BITS
1416 { 1417 {
@@ -1465,10 +1466,10 @@ struct Lisp_Sub_Char_Table
1465 contains 32 elements, and each element covers 128 characters. A 1466 contains 32 elements, and each element covers 128 characters. A
1466 sub char-table of depth 3 contains 128 elements, and each element 1467 sub char-table of depth 3 contains 128 elements, and each element
1467 is for one character. */ 1468 is for one character. */
1468 Lisp_Object depth; 1469 int depth;
1469 1470
1470 /* Minimum character covered by the sub char-table. */ 1471 /* Minimum character covered by the sub char-table. */
1471 Lisp_Object min_char; 1472 int min_char;
1472 1473
1473 /* Use set_sub_char_table_contents to set this. */ 1474 /* Use set_sub_char_table_contents to set this. */
1474 Lisp_Object contents[FLEXIBLE_ARRAY_MEMBER]; 1475 Lisp_Object contents[FLEXIBLE_ARRAY_MEMBER];
@@ -1539,12 +1540,16 @@ struct Lisp_Subr
1539 const char *doc; 1540 const char *doc;
1540 }; 1541 };
1541 1542
1542/* This is the number of slots that every char table must have. This 1543enum char_table_specials
1543 counts the ordinary slots and the top, defalt, parent, and purpose
1544 slots. */
1545enum CHAR_TABLE_STANDARD_SLOTS
1546 { 1544 {
1547 CHAR_TABLE_STANDARD_SLOTS = PSEUDOVECSIZE (struct Lisp_Char_Table, extras) 1545 /* This is the number of slots that every char table must have. This
1546 counts the ordinary slots and the top, defalt, parent, and purpose
1547 slots. */
1548 CHAR_TABLE_STANDARD_SLOTS = PSEUDOVECSIZE (struct Lisp_Char_Table, extras),
1549
1550 /* This is an index of first Lisp_Object field in Lisp_Sub_Char_Table
1551 when the latter is treated as an ordinary Lisp_Vector. */
1552 SUB_CHAR_TABLE_OFFSET = PSEUDOVECSIZE (struct Lisp_Sub_Char_Table, contents)
1548 }; 1553 };
1549 1554
1550/* Return the number of "extra" slots in the char table CT. */ 1555/* Return the number of "extra" slots in the char table CT. */
@@ -1556,7 +1561,11 @@ CHAR_TABLE_EXTRA_SLOTS (struct Lisp_Char_Table *ct)
1556 - CHAR_TABLE_STANDARD_SLOTS); 1561 - CHAR_TABLE_STANDARD_SLOTS);
1557} 1562}
1558 1563
1559 1564/* Make sure that sub char-table contents slot
1565 is aligned on a multiple of Lisp_Objects. */
1566verify ((offsetof (struct Lisp_Sub_Char_Table, contents)
1567 - offsetof (struct Lisp_Sub_Char_Table, depth)) % word_size == 0);
1568
1560/*********************************************************************** 1569/***********************************************************************
1561 Symbols 1570 Symbols
1562 ***********************************************************************/ 1571 ***********************************************************************/
@@ -3723,6 +3732,20 @@ make_uninit_vector (ptrdiff_t size)
3723 return v; 3732 return v;
3724} 3733}
3725 3734
3735/* Like above, but special for sub char-tables. */
3736
3737INLINE Lisp_Object
3738make_uninit_sub_char_table (int depth, int min_char)
3739{
3740 int slots = SUB_CHAR_TABLE_OFFSET + chartab_size[depth];
3741 Lisp_Object v = make_uninit_vector (slots);
3742
3743 XSETPVECTYPE (XVECTOR (v), PVEC_SUB_CHAR_TABLE);
3744 XSUB_CHAR_TABLE (v)->depth = depth;
3745 XSUB_CHAR_TABLE (v)->min_char = min_char;
3746 return v;
3747}
3748
3726extern struct Lisp_Vector *allocate_pseudovector (int, int, enum pvec_type); 3749extern struct Lisp_Vector *allocate_pseudovector (int, int, enum pvec_type);
3727#define ALLOCATE_PSEUDOVECTOR(typ,field,tag) \ 3750#define ALLOCATE_PSEUDOVECTOR(typ,field,tag) \
3728 ((typ*) \ 3751 ((typ*) \
diff --git a/src/lread.c b/src/lread.c
index f252993207d..639d574ac6b 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -2619,21 +2619,38 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list)
2619 c = READCHAR; 2619 c = READCHAR;
2620 if (c == '[') 2620 if (c == '[')
2621 { 2621 {
2622 Lisp_Object tmp; 2622 /* Sub char-table can't be read as a regular
2623 int depth; 2623 vector because of a two C integer fields. */
2624 ptrdiff_t size; 2624 Lisp_Object tbl, tmp = read_list (1, readcharfun);
2625 ptrdiff_t size = XINT (Flength (tmp));
2626 int i, depth, min_char;
2627 struct Lisp_Cons *cell;
2625 2628
2626 tmp = read_vector (readcharfun, 0);
2627 size = ASIZE (tmp);
2628 if (size == 0) 2629 if (size == 0)
2629 error ("Invalid size char-table"); 2630 error ("Zero-sized sub char-table");
2630 if (! RANGED_INTEGERP (1, AREF (tmp, 0), 3)) 2631
2631 error ("Invalid depth in char-table"); 2632 if (! RANGED_INTEGERP (1, XCAR (tmp), 3))
2632 depth = XINT (AREF (tmp, 0)); 2633 error ("Invalid depth in sub char-table");
2634 depth = XINT (XCAR (tmp));
2633 if (chartab_size[depth] != size - 2) 2635 if (chartab_size[depth] != size - 2)
2634 error ("Invalid size char-table"); 2636 error ("Invalid size in sub char-table");
2635 XSETPVECTYPE (XVECTOR (tmp), PVEC_SUB_CHAR_TABLE); 2637 cell = XCONS (tmp), tmp = XCDR (tmp), size--;
2636 return tmp; 2638 free_cons (cell);
2639
2640 if (! RANGED_INTEGERP (0, XCAR (tmp), MAX_CHAR))
2641 error ("Invalid minimum character in sub-char-table");
2642 min_char = XINT (XCAR (tmp));
2643 cell = XCONS (tmp), tmp = XCDR (tmp), size--;
2644 free_cons (cell);
2645
2646 tbl = make_uninit_sub_char_table (depth, min_char);
2647 for (i = 0; i < size; i++)
2648 {
2649 XSUB_CHAR_TABLE (tbl)->contents[i] = XCAR (tmp);
2650 cell = XCONS (tmp), tmp = XCDR (tmp);
2651 free_cons (cell);
2652 }
2653 return tbl;
2637 } 2654 }
2638 invalid_syntax ("#^^"); 2655 invalid_syntax ("#^^");
2639 } 2656 }
diff --git a/src/macfont.m b/src/macfont.m
index 9b3cb2c29f6..82ee54cdc63 100644
--- a/src/macfont.m
+++ b/src/macfont.m
@@ -1580,8 +1580,6 @@ static struct font_driver macfont_driver =
1580 macfont_draw, 1580 macfont_draw,
1581 NULL, /* get_bitmap */ 1581 NULL, /* get_bitmap */
1582 NULL, /* free_bitmap */ 1582 NULL, /* free_bitmap */
1583 NULL, /* get_outline */
1584 NULL, /* free_outline */
1585 NULL, /* anchor_point */ 1583 NULL, /* anchor_point */
1586 NULL, /* otf_capability */ 1584 NULL, /* otf_capability */
1587 NULL, /* otf_drive */ 1585 NULL, /* otf_drive */
diff --git a/src/menu.c b/src/menu.c
index a523cfc6010..e0f226562f8 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -1529,6 +1529,11 @@ for instance using the window manager, then this produces a quit and
1529 but I don't want to make one now. */ 1529 but I don't want to make one now. */
1530 CHECK_WINDOW (window); 1530 CHECK_WINDOW (window);
1531 1531
1532 /* Note that xw_popup_dialog can call menu code, so
1533 Vmenu_updating_frame should be set (Bug#17891). */
1534 eassert (f && FRAME_LIVE_P (f));
1535 XSETFRAME (Vmenu_updating_frame, f);
1536
1532 /* Force a redisplay before showing the dialog. If a frame is created 1537 /* Force a redisplay before showing the dialog. If a frame is created
1533 just before showing the dialog, its contents may not have been fully 1538 just before showing the dialog, its contents may not have been fully
1534 drawn, as this depends on timing of events from the X server. Redisplay 1539 drawn, as this depends on timing of events from the X server. Redisplay
diff --git a/src/nsfont.m b/src/nsfont.m
index 2c5e25b993c..cadc68f9933 100644
--- a/src/nsfont.m
+++ b/src/nsfont.m
@@ -649,7 +649,7 @@ struct font_driver nsfont_driver =
649 nsfont_encode_char, 649 nsfont_encode_char,
650 nsfont_text_extents, 650 nsfont_text_extents,
651 nsfont_draw, 651 nsfont_draw,
652 /* excluded: get_bitmap, free_bitmap, get_outline, free_outline, 652 /* excluded: get_bitmap, free_bitmap,
653 anchor_point, otf_capability, otf_driver, 653 anchor_point, otf_capability, otf_driver,
654 start_for_frame, end_for_frame, shape */ 654 start_for_frame, end_for_frame, shape */
655 }; 655 };
diff --git a/src/print.c b/src/print.c
index 9050a0cb773..2f52f5d03ec 100644
--- a/src/print.c
+++ b/src/print.c
@@ -1968,7 +1968,7 @@ print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag)
1968 Otherwise we'll make a line extremely long, which 1968 Otherwise we'll make a line extremely long, which
1969 results in slow redisplay. */ 1969 results in slow redisplay. */
1970 if (SUB_CHAR_TABLE_P (obj) 1970 if (SUB_CHAR_TABLE_P (obj)
1971 && XINT (XSUB_CHAR_TABLE (obj)->depth) == 3) 1971 && XSUB_CHAR_TABLE (obj)->depth == 3)
1972 PRINTCHAR ('\n'); 1972 PRINTCHAR ('\n');
1973 PRINTCHAR ('#'); 1973 PRINTCHAR ('#');
1974 PRINTCHAR ('^'); 1974 PRINTCHAR ('^');
@@ -1981,16 +1981,24 @@ print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag)
1981 1981
1982 PRINTCHAR ('['); 1982 PRINTCHAR ('[');
1983 { 1983 {
1984 register int i; 1984 int i, idx = SUB_CHAR_TABLE_P (obj) ? SUB_CHAR_TABLE_OFFSET : 0;
1985 register Lisp_Object tem; 1985 register Lisp_Object tem;
1986 ptrdiff_t real_size = size; 1986 ptrdiff_t real_size = size;
1987 1987
1988 /* For a sub char-table, print heading non-Lisp data first. */
1989 if (SUB_CHAR_TABLE_P (obj))
1990 {
1991 i = sprintf (buf, "%d %d", XSUB_CHAR_TABLE (obj)->depth,
1992 XSUB_CHAR_TABLE (obj)->min_char);
1993 strout (buf, i, i, printcharfun);
1994 }
1995
1988 /* Don't print more elements than the specified maximum. */ 1996 /* Don't print more elements than the specified maximum. */
1989 if (NATNUMP (Vprint_length) 1997 if (NATNUMP (Vprint_length)
1990 && XFASTINT (Vprint_length) < size) 1998 && XFASTINT (Vprint_length) < size)
1991 size = XFASTINT (Vprint_length); 1999 size = XFASTINT (Vprint_length);
1992 2000
1993 for (i = 0; i < size; i++) 2001 for (i = idx; i < size; i++)
1994 { 2002 {
1995 if (i) PRINTCHAR (' '); 2003 if (i) PRINTCHAR (' ');
1996 tem = AREF (obj, i); 2004 tem = AREF (obj, i);
diff --git a/src/w32fns.c b/src/w32fns.c
index e24148af4ff..def9d8acb7a 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -89,9 +89,6 @@ extern void w32_free_menu_strings (HWND);
89extern const char *map_w32_filename (const char *, const char **); 89extern const char *map_w32_filename (const char *, const char **);
90extern char * w32_strerror (int error_no); 90extern char * w32_strerror (int error_no);
91 91
92/* If non-NULL, a handle to a frame where to display the hourglass cursor. */
93static HWND hourglass_hwnd = NULL;
94
95#ifndef IDC_HAND 92#ifndef IDC_HAND
96#define IDC_HAND MAKEINTRESOURCE(32649) 93#define IDC_HAND MAKEINTRESOURCE(32649)
97#endif 94#endif
@@ -233,10 +230,6 @@ static int menubar_in_use = 0;
233extern void syms_of_w32uniscribe (void); 230extern void syms_of_w32uniscribe (void);
234extern int uniscribe_available; 231extern int uniscribe_available;
235 232
236/* Function prototypes for hourglass support. */
237static void w32_show_hourglass (struct frame *);
238static void w32_hide_hourglass (void);
239
240#ifdef WINDOWSNT 233#ifdef WINDOWSNT
241/* From w32inevt.c */ 234/* From w32inevt.c */
242extern int faked_key; 235extern int faked_key;
@@ -5500,95 +5493,62 @@ no value of TYPE (always string in the MS Windows case). */)
5500 Busy cursor 5493 Busy cursor
5501 ***********************************************************************/ 5494 ***********************************************************************/
5502 5495
5503void 5496/* Display an hourglass cursor. Set the hourglass_p flag in display info
5504w32_note_current_window (void) 5497 to indicate that an hourglass cursor is shown. */
5505{
5506 struct frame * f = SELECTED_FRAME ();
5507
5508 if (!FRAME_W32_P (f))
5509 return;
5510
5511 hourglass_hwnd = FRAME_W32_WINDOW (f);
5512}
5513 5498
5514void 5499void
5515show_hourglass (struct atimer *timer) 5500show_hourglass (struct atimer *timer)
5516{ 5501{
5517 struct frame *f;
5518
5519 hourglass_atimer = NULL; 5502 hourglass_atimer = NULL;
5520 5503
5521 block_input (); 5504 if (!hourglass_shown_p)
5522 f = x_window_to_frame (&one_w32_display_info,
5523 hourglass_hwnd);
5524
5525 if (f)
5526 f->output_data.w32->hourglass_p = 0;
5527 else
5528 f = SELECTED_FRAME ();
5529
5530 if (!FRAME_W32_P (f))
5531 { 5505 {
5532 unblock_input (); 5506 Lisp_Object tail, frame;
5533 return;
5534 }
5535
5536 w32_show_hourglass (f);
5537 unblock_input ();
5538}
5539 5507
5540void 5508 block_input ();
5541hide_hourglass (void) 5509 FOR_EACH_FRAME (tail, frame)
5542{ 5510 {
5543 block_input (); 5511 struct frame *f = XFRAME (frame);
5544 w32_hide_hourglass ();
5545 unblock_input ();
5546}
5547
5548
5549/* Display an hourglass cursor. Set the hourglass_p flag in display info
5550 to indicate that an hourglass cursor is shown. */
5551 5512
5552static void 5513 if (FRAME_W32_P (f) && !menubar_in_use && !current_popup_menu)
5553w32_show_hourglass (struct frame *f) 5514 {
5554{ 5515 f->output_data.w32->hourglass_p = 1;
5555 if (!hourglass_shown_p) 5516 SetCursor (f->output_data.w32->hourglass_cursor);
5556 { 5517 }
5557 f->output_data.w32->hourglass_p = 1; 5518 }
5558 if (!menubar_in_use && !current_popup_menu) 5519 unblock_input ();
5559 SetCursor (f->output_data.w32->hourglass_cursor);
5560 hourglass_shown_p = 1; 5520 hourglass_shown_p = 1;
5561 } 5521 }
5562} 5522}
5563 5523
5564
5565/* Hide the hourglass cursor on all frames, if it is currently shown. */ 5524/* Hide the hourglass cursor on all frames, if it is currently shown. */
5566 5525
5567static void 5526void
5568w32_hide_hourglass (void) 5527hide_hourglass (void)
5569{ 5528{
5570 if (hourglass_shown_p) 5529 if (hourglass_shown_p)
5571 { 5530 {
5572 struct frame *f = x_window_to_frame (&one_w32_display_info, 5531 Lisp_Object tail, frame;
5573 hourglass_hwnd);
5574 if (f)
5575 f->output_data.w32->hourglass_p = 0;
5576 else
5577 /* If frame was deleted, restore to selected frame's cursor. */
5578 f = SELECTED_FRAME ();
5579 5532
5580 if (FRAME_W32_P (f)) 5533 block_input ();
5581 SetCursor (f->output_data.w32->current_cursor); 5534 FOR_EACH_FRAME (tail, frame)
5582 else 5535 {
5583 /* No cursors on non GUI frames - restore to stock arrow cursor. */ 5536 struct frame *f = XFRAME (frame);
5584 SetCursor (w32_load_cursor (IDC_ARROW));
5585 5537
5538 if (FRAME_W32_P (f))
5539 {
5540 f->output_data.w32->hourglass_p = 0;
5541 SetCursor (f->output_data.w32->current_cursor);
5542 }
5543 else
5544 /* No cursors on non GUI frames - restore to stock arrow cursor. */
5545 SetCursor (w32_load_cursor (IDC_ARROW));
5546 }
5547 unblock_input ();
5586 hourglass_shown_p = 0; 5548 hourglass_shown_p = 0;
5587 } 5549 }
5588} 5550}
5589 5551
5590
5591
5592/*********************************************************************** 5552/***********************************************************************
5593 Tool tips 5553 Tool tips
5594 ***********************************************************************/ 5554 ***********************************************************************/
@@ -8415,9 +8375,6 @@ only be necessary if the default setting causes problems. */);
8415#endif 8375#endif
8416 8376
8417 defsubr (&Sset_message_beep); 8377 defsubr (&Sset_message_beep);
8418
8419 hourglass_hwnd = NULL;
8420
8421 defsubr (&Sx_show_tip); 8378 defsubr (&Sx_show_tip);
8422 defsubr (&Sx_hide_tip); 8379 defsubr (&Sx_hide_tip);
8423 tip_timer = Qnil; 8380 tip_timer = Qnil;
diff --git a/src/w32font.c b/src/w32font.c
index 5262f38663f..43b592ee450 100644
--- a/src/w32font.c
+++ b/src/w32font.c
@@ -757,19 +757,6 @@ w32font_get_bitmap (struct font *font, unsigned code,
757static void 757static void
758w32font_free_bitmap (struct font *font, struct font_bitmap *bitmap); 758w32font_free_bitmap (struct font *font, struct font_bitmap *bitmap);
759 */ 759 */
760/* w32 implementation of get_outline for font backend.
761 Optional.
762 Return an outline data for glyph-code CODE of FONT. The format
763 of the outline data depends on the font-driver.
764static void *
765w32font_get_outline (struct font *font, unsigned code);
766 */
767/* w32 implementation of free_outline for font backend.
768 Optional.
769 Free OUTLINE (that is obtained by the above method).
770static void
771w32font_free_outline (struct font *font, void *outline);
772 */
773/* w32 implementation of anchor_point for font backend. 760/* w32 implementation of anchor_point for font backend.
774 Optional. 761 Optional.
775 Get coordinates of the INDEXth anchor point of the glyph whose 762 Get coordinates of the INDEXth anchor point of the glyph whose
@@ -2557,8 +2544,6 @@ struct font_driver w32font_driver =
2557 w32font_draw, 2544 w32font_draw,
2558 NULL, /* get_bitmap */ 2545 NULL, /* get_bitmap */
2559 NULL, /* free_bitmap */ 2546 NULL, /* free_bitmap */
2560 NULL, /* get_outline */
2561 NULL, /* free_outline */
2562 NULL, /* anchor_point */ 2547 NULL, /* anchor_point */
2563 NULL, /* otf_capability */ 2548 NULL, /* otf_capability */
2564 NULL, /* otf_drive */ 2549 NULL, /* otf_drive */
diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c
index 5bb444f519a..24fc753e708 100644
--- a/src/w32uniscribe.c
+++ b/src/w32uniscribe.c
@@ -604,8 +604,6 @@ uniscribe_encode_char (struct font *font, int c)
604 int uniscribe_get_bitmap (struct font *font, unsigned code, 604 int uniscribe_get_bitmap (struct font *font, unsigned code,
605 struct font_bitmap *bitmap, int bits_per_pixel); 605 struct font_bitmap *bitmap, int bits_per_pixel);
606 void uniscribe_free_bitmap (struct font *font, struct font_bitmap *bitmap); 606 void uniscribe_free_bitmap (struct font *font, struct font_bitmap *bitmap);
607 void * uniscribe_get_outline (struct font *font, unsigned code);
608 void uniscribe_free_outline (struct font *font, void *outline);
609 int uniscribe_anchor_point (struct font *font, unsigned code, 607 int uniscribe_anchor_point (struct font *font, unsigned code,
610 int index, int *x, int *y); 608 int index, int *x, int *y);
611 int uniscribe_start_for_frame (struct frame *f); 609 int uniscribe_start_for_frame (struct frame *f);
@@ -981,8 +979,6 @@ struct font_driver uniscribe_font_driver =
981 w32font_draw, 979 w32font_draw,
982 NULL, /* get_bitmap */ 980 NULL, /* get_bitmap */
983 NULL, /* free_bitmap */ 981 NULL, /* free_bitmap */
984 NULL, /* get_outline */
985 NULL, /* free_outline */
986 NULL, /* anchor_point */ 982 NULL, /* anchor_point */
987 uniscribe_otf_capability, /* Defined so (font-get FONTOBJ :otf) works. */ 983 uniscribe_otf_capability, /* Defined so (font-get FONTOBJ :otf) works. */
988 NULL, /* otf_drive - use shape instead. */ 984 NULL, /* otf_drive - use shape instead. */
diff --git a/src/window.h b/src/window.h
index bdc5dddb7e5..b9c2b1f5ba8 100644
--- a/src/window.h
+++ b/src/window.h
@@ -271,8 +271,10 @@ struct window
271 int left_fringe_width; 271 int left_fringe_width;
272 int right_fringe_width; 272 int right_fringe_width;
273 273
274 /* Width of left and right marginal areas in columns. 274 /* Requested width of left and right marginal areas in columns. A
275 A value of 0 means no margin. */ 275 value of 0 means no margin. The actual values are recorded in
276 the window's glyph matrix, in the left_margin_glyphs and
277 right_margin_glyphs members. */
276 int left_margin_cols; 278 int left_margin_cols;
277 int right_margin_cols; 279 int right_margin_cols;
278 280
diff --git a/src/xdisp.c b/src/xdisp.c
index 31d293143f3..6cec0bf1925 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -19878,7 +19878,7 @@ display_line (struct it *it)
19878 } 19878 }
19879 19879
19880 /* Clear the result glyph row and enable it. */ 19880 /* Clear the result glyph row and enable it. */
19881 prepare_desired_row (row); 19881 prepare_desired_row (it->w, row, false);
19882 19882
19883 row->y = it->current_y; 19883 row->y = it->current_y;
19884 row->start = it->start; 19884 row->start = it->start;
@@ -21517,7 +21517,7 @@ display_mode_line (struct window *w, enum face_id face_id, Lisp_Object format)
21517 /* Don't extend on a previously drawn mode-line. 21517 /* Don't extend on a previously drawn mode-line.
21518 This may happen if called from pos_visible_p. */ 21518 This may happen if called from pos_visible_p. */
21519 it.glyph_row->enabled_p = false; 21519 it.glyph_row->enabled_p = false;
21520 prepare_desired_row (it.glyph_row); 21520 prepare_desired_row (w, it.glyph_row, true);
21521 21521
21522 it.glyph_row->mode_line_p = 1; 21522 it.glyph_row->mode_line_p = 1;
21523 21523
@@ -30683,13 +30683,6 @@ start_hourglass (void)
30683 else 30683 else
30684 delay = make_timespec (DEFAULT_HOURGLASS_DELAY, 0); 30684 delay = make_timespec (DEFAULT_HOURGLASS_DELAY, 0);
30685 30685
30686#ifdef HAVE_NTGUI
30687 {
30688 extern void w32_note_current_window (void);
30689 w32_note_current_window ();
30690 }
30691#endif /* HAVE_NTGUI */
30692
30693 hourglass_atimer = start_atimer (ATIMER_RELATIVE, delay, 30686 hourglass_atimer = start_atimer (ATIMER_RELATIVE, delay,
30694 show_hourglass, NULL); 30687 show_hourglass, NULL);
30695} 30688}
diff --git a/src/xfaces.c b/src/xfaces.c
index 4571137a249..ead14f0116d 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -676,19 +676,9 @@ init_frame_faces (struct frame *f)
676 } 676 }
677#endif /* HAVE_WINDOW_SYSTEM */ 677#endif /* HAVE_WINDOW_SYSTEM */
678 678
679 /* Realize basic faces. Must have enough information in frame 679 /* Realize faces early (Bug#17889). */
680 parameters to realize basic faces at this point. */ 680 if (!realize_basic_faces (f))
681#ifdef HAVE_X_WINDOWS 681 emacs_abort ();
682 if (!FRAME_X_P (f) || FRAME_X_WINDOW (f))
683#endif
684#ifdef HAVE_NTGUI
685 if (!FRAME_WINDOW_P (f) || FRAME_W32_WINDOW (f))
686#endif
687#ifdef HAVE_NS
688 if (!FRAME_NS_P (f) || FRAME_NS_WINDOW (f))
689#endif
690 if (!realize_basic_faces (f))
691 emacs_abort ();
692} 682}
693 683
694 684
diff --git a/src/xfont.c b/src/xfont.c
index f90904a018e..baed9abbc7e 100644
--- a/src/xfont.c
+++ b/src/xfont.c
@@ -146,7 +146,7 @@ struct font_driver xfont_driver =
146 xfont_encode_char, 146 xfont_encode_char,
147 xfont_text_extents, 147 xfont_text_extents,
148 xfont_draw, 148 xfont_draw,
149 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 149 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
150 xfont_check, 150 xfont_check,
151 NULL, /* get_variation_glyphs */ 151 NULL, /* get_variation_glyphs */
152 NULL, /* filter_properties */ 152 NULL, /* filter_properties */
diff --git a/src/xftfont.c b/src/xftfont.c
index 2b4ec065734..bd3f2c92142 100644
--- a/src/xftfont.c
+++ b/src/xftfont.c
@@ -593,7 +593,7 @@ xftfont_text_extents (struct font *font, unsigned int *code, int nglyphs, struct
593static XftDraw * 593static XftDraw *
594xftfont_get_xft_draw (struct frame *f) 594xftfont_get_xft_draw (struct frame *f)
595{ 595{
596 XftDraw *xft_draw = font_get_frame_data (f, &xftfont_driver); 596 XftDraw *xft_draw = font_get_frame_data (f, Qxft);
597 597
598 if (! xft_draw) 598 if (! xft_draw)
599 { 599 {
@@ -604,7 +604,7 @@ xftfont_get_xft_draw (struct frame *f)
604 FRAME_X_COLORMAP (f)); 604 FRAME_X_COLORMAP (f));
605 unblock_input (); 605 unblock_input ();
606 eassert (xft_draw != NULL); 606 eassert (xft_draw != NULL);
607 font_put_frame_data (f, &xftfont_driver, xft_draw); 607 font_put_frame_data (f, Qxft, xft_draw);
608 } 608 }
609 return xft_draw; 609 return xft_draw;
610} 610}
@@ -680,14 +680,14 @@ xftfont_end_for_frame (struct frame *f)
680 /* Don't do anything if display is dead */ 680 /* Don't do anything if display is dead */
681 if (FRAME_X_DISPLAY (f) == NULL) return 0; 681 if (FRAME_X_DISPLAY (f) == NULL) return 0;
682 682
683 xft_draw = font_get_frame_data (f, &xftfont_driver); 683 xft_draw = font_get_frame_data (f, Qxft);
684 684
685 if (xft_draw) 685 if (xft_draw)
686 { 686 {
687 block_input (); 687 block_input ();
688 XftDrawDestroy (xft_draw); 688 XftDrawDestroy (xft_draw);
689 unblock_input (); 689 unblock_input ();
690 font_put_frame_data (f, &xftfont_driver, NULL); 690 font_put_frame_data (f, Qxft, NULL);
691 } 691 }
692 return 0; 692 return 0;
693} 693}
diff --git a/src/xselect.c b/src/xselect.c
index 89ec1da30b2..f23256346cb 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -1299,9 +1299,7 @@ x_get_window_property (Display *display, Window window, Atom property,
1299 if (total_size_max < bytes_remaining) 1299 if (total_size_max < bytes_remaining)
1300 goto size_overflow; 1300 goto size_overflow;
1301 total_size = bytes_remaining; 1301 total_size = bytes_remaining;
1302 data = malloc (total_size + 1); 1302 data = xmalloc (total_size + 1);
1303 if (! data)
1304 goto memory_exhausted;
1305 1303
1306 /* Now read, until we've gotten it all. */ 1304 /* Now read, until we've gotten it all. */
1307 while (bytes_remaining) 1305 while (bytes_remaining)
@@ -1352,9 +1350,7 @@ x_get_window_property (Display *display, Window window, Atom property,
1352 if (remaining_lim < 0 || remaining_lim < bytes_remaining) 1350 if (remaining_lim < 0 || remaining_lim < bytes_remaining)
1353 goto size_overflow; 1351 goto size_overflow;
1354 total_size = offset + bytes_gotten + bytes_remaining; 1352 total_size = offset + bytes_gotten + bytes_remaining;
1355 data1 = realloc (data, total_size + 1); 1353 data1 = xrealloc (data, total_size + 1);
1356 if (! data1)
1357 goto memory_exhausted;
1358 data = data1; 1354 data = data1;
1359 } 1355 }
1360 1356
@@ -1386,14 +1382,10 @@ x_get_window_property (Display *display, Window window, Atom property,
1386 return; 1382 return;
1387 1383
1388 size_overflow: 1384 size_overflow:
1389 free (data); 1385 if (data)
1386 xfree (data);
1390 unblock_input (); 1387 unblock_input ();
1391 memory_full (SIZE_MAX); 1388 memory_full (SIZE_MAX);
1392
1393 memory_exhausted:
1394 free (data);
1395 unblock_input ();
1396 memory_full (total_size + 1);
1397} 1389}
1398 1390
1399/* Use xfree, not XFree, to free the data obtained with this function. */ 1391/* Use xfree, not XFree, to free the data obtained with this function. */