diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 97 | ||||
| -rw-r--r-- | src/alloc.c | 14 | ||||
| -rw-r--r-- | src/chartab.c | 47 | ||||
| -rw-r--r-- | src/dispextern.h | 2 | ||||
| -rw-r--r-- | src/dispnew.c | 52 | ||||
| -rw-r--r-- | src/font.c | 55 | ||||
| -rw-r--r-- | src/font.h | 32 | ||||
| -rw-r--r-- | src/frame.c | 16 | ||||
| -rw-r--r-- | src/frame.h | 8 | ||||
| -rw-r--r-- | src/ftfont.c | 2 | ||||
| -rw-r--r-- | src/ftxfont.c | 24 | ||||
| -rw-r--r-- | src/keymap.c | 42 | ||||
| -rw-r--r-- | src/lisp.h | 47 | ||||
| -rw-r--r-- | src/lread.c | 41 | ||||
| -rw-r--r-- | src/macfont.m | 2 | ||||
| -rw-r--r-- | src/menu.c | 5 | ||||
| -rw-r--r-- | src/nsfont.m | 2 | ||||
| -rw-r--r-- | src/print.c | 14 | ||||
| -rw-r--r-- | src/w32fns.c | 107 | ||||
| -rw-r--r-- | src/w32font.c | 15 | ||||
| -rw-r--r-- | src/w32uniscribe.c | 4 | ||||
| -rw-r--r-- | src/window.h | 6 | ||||
| -rw-r--r-- | src/xdisp.c | 11 | ||||
| -rw-r--r-- | src/xfaces.c | 16 | ||||
| -rw-r--r-- | src/xfont.c | 2 | ||||
| -rw-r--r-- | src/xftfont.c | 8 | ||||
| -rw-r--r-- | src/xselect.c | 16 |
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 @@ -2014-07-01 K. Handa <handa@gnu.org> +2014-07-04 K. Handa <handa@gnu.org> * coding.c (MIN_CHARBUF_SIZE): Delete it. (MAX_CHARBUF_EXTRA_SIZE): New macro. (ALLOC_CONVERSION_WORK_AREA): Use MAX_CHARBUF_EXTRA_SIZE. +2014-07-04 Dmitry Antipov <dmantipov@yandex.ru> + + * font.h (struct font_driver): Remove get_outline and free_outline; + not used by any font driver. + * ftfont.c (ftfont_driver): + * macfont.m (macfont_driver): + * nsfont.m (nsfont_driver): + * w32font.c (w32font_driver): + * w32uniscribe.c (uniscribe_font_driver): + * xfont.c (xfont_driver): Related users changed. + * xselect.c (x_get_window_property): Use convenient xmalloc. + Call to xfree only if some data was really allocated. + +2014-07-03 Dmitry Antipov <dmantipov@yandex.ru> + + On MS-Windows, display busy cursor on all GUI frames. + This is similar to what we have on X. Quickly tested by Dani Moncayo. + * w32fns.c (toplevel): Remove hourglass_hwnd; no longer used. + (w32_show_hourglass, w32_hide_hourglass, w32_note_current_window): + Likewise. + (hide_hourglass, show_hourglass): Redesign to match X counterparts. + * xdisp.c (start_hourglass): Remove Windows-specific bits. + +2014-07-03 Dmitry Antipov <dmantipov@yandex.ru> + + Use convenient alists to manage per-frame font driver-specific data. + * frame.h (struct frame): Rename font_data_list to... + [HAVE_XFT || HAVE_FREETYPE]: ... font_data, which is a Lisp_Object now. + * font.h (struct font_data_list): Remove; no longer need a special + data type. + (font_put_frame_data, font_get_frame_data) [HAVE_XFT || HAVE_FREETYPE]: + Adjust prototypes. + * font.c (font_put_frame_data, font_get_frame_data) + [HAVE_XFT || HAVE_FREETYPE]: Prefer alist functions to ad-hoc list + management. + * xftfont.c (xftfont_get_xft_draw, xftfont_end_for_frame): + Related users changed. + * ftxfont.c (ftxfont_get_gcs, ftxfont_end_for_frame): Likewise. + Prefer convenient xmalloc and xfree. + +2014-07-03 Eli Zaretskii <eliz@gnu.org> + + * dispnew.c (prepare_desired_row): Accept 2 additional arguments: + the window whose glyph row is being prepared and a flag whether it + is for mode/header line. Make sure the glyph row's marginal areas + are in sync with what the window wants. + (Bug#17892) + + * xdisp.c (display_line, display_mode_line): Call + prepare_desired_row with additional arguments, as appropriate. + + * dispextern.h (prepare_desired_row): Adjust prototype. + +2014-07-03 Dmitry Antipov <dmantipov@yandex.ru> + + * xfaces.c (init_frame_faces): Always realize basic faces (Bug#17889). + * menu.c (Fx_popup_dialog): Set Vmenu_updating_frame to avoid crash + caused by xw_popup_dialog in daemon mode (Bug#17891). + +2014-07-03 Eli Zaretskii <eliz@gnu.org> + + * frame.c (do_switch_frame): When switching to another TTY frame, + make sure FrameCols and FrameRows are in sync with the new frame's + data. (Bug#17875) + +2014-07-02 Dmitry Antipov <dmantipov@yandex.ru> + + Shrink Lisp_Sub_Char_Table by preferring C integers to Lisp_Objects. + * lisp.h (struct Lisp_Sub_Char_Table): Use C integers for depth and + min_char slots. Adjust comment. + (enum char_table_specials): Rename from CHAR_TABLE_STANDARD_SLOTS. + Add SUB_CHAR_TABLE_OFFSET member. + (make_uninit_sub_char_table): New function. + (toplevel): Add compile-time assert to verify suitable member layout + in Lisp_Sub_Char_Table. + * alloc.c (mark_char_table): Add extra argument to denote char table + subtype. Adjust to match new layout of sub char-table. + (mark_object): Always mark sub char-tables with mark_char_table. + * chartab.c (make_sub_char_table, copy_sub_char_table) + (sub_char_table_ref, sub_char_table_ref_and_range, sub_char_table_set) + (sub_char_table_set_range, optimize_sub_char_table, map_sub_char_table) + (map_sub_char_table_for_charset, uniprop_table_uncompress): + All related users changed. + * lread.c (read1): Adjust to match new layout of sub char-table. + * print.c (print_object): Likewise (Bug#17898). + +2014-07-02 Stefan Monnier <monnier@iro.umontreal.ca> + + * keymap.c (get_keyelt): Simplify. + (copy_keymap_item): Remove left-over code for when we had + key-shortcut caches. + 2014-06-30 Jan Djärv <jan.h.d@swipnet.se> * nsterm.m (judge): EmacsScroller: Move dealloc code here. @@ -25,8 +117,7 @@ (mouseMoved:): Set any_help_event_p to YES if help event is generated. Remove else with empty help event that triggered redisplay for every mouse move. - (windowDidResignKey:): If any_help_event_p, generate empty help - event. + (windowDidResignKey:): If any_help_event_p, generate empty help event. 2014-06-29 Dmitry Antipov <dmantipov@yandex.ru> 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) symbols. */ static void -mark_char_table (struct Lisp_Vector *ptr) +mark_char_table (struct Lisp_Vector *ptr, enum pvec_type pvectype) { int size = ptr->header.size & PSEUDOVECTOR_SIZE_MASK; - int i; + /* Consult the Lisp_Sub_Char_Table layout before changing this. */ + int i, idx = (pvectype == PVEC_SUB_CHAR_TABLE ? SUB_CHAR_TABLE_OFFSET : 0); eassert (!VECTOR_MARKED_P (ptr)); VECTOR_MARK (ptr); - for (i = 0; i < size; i++) + for (i = idx; i < size; i++) { Lisp_Object val = ptr->contents[i]; @@ -5974,7 +5975,7 @@ mark_char_table (struct Lisp_Vector *ptr) if (SUB_CHAR_TABLE_P (val)) { if (! VECTOR_MARKED_P (XVECTOR (val))) - mark_char_table (XVECTOR (val)); + mark_char_table (XVECTOR (val), PVEC_SUB_CHAR_TABLE); } else mark_object (val); @@ -6320,7 +6321,8 @@ mark_object (Lisp_Object arg) break; case PVEC_CHAR_TABLE: - mark_char_table (ptr); + case PVEC_SUB_CHAR_TABLE: + mark_char_table (ptr, (enum pvec_type) pvectype); break; case PVEC_BOOL_VECTOR: @@ -7218,7 +7220,7 @@ The time is in seconds as a floating point value. */); union { enum CHARTAB_SIZE_BITS CHARTAB_SIZE_BITS; - enum CHAR_TABLE_STANDARD_SLOTS CHAR_TABLE_STANDARD_SLOTS; + enum char_table_specials char_table_specials; enum char_bits char_bits; enum CHECK_LISP_OBJECT_TYPE CHECK_LISP_OBJECT_TYPE; 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. */) static Lisp_Object make_sub_char_table (int depth, int min_char, Lisp_Object defalt) { - Lisp_Object table; - int size = (PSEUDOVECSIZE (struct Lisp_Sub_Char_Table, contents) - + chartab_size[depth]); - - table = Fmake_vector (make_number (size), defalt); - XSETPVECTYPE (XVECTOR (table), PVEC_SUB_CHAR_TABLE); - XSUB_CHAR_TABLE (table)->depth = make_number (depth); - XSUB_CHAR_TABLE (table)->min_char = make_number (min_char); + int i; + Lisp_Object table = make_uninit_sub_char_table (depth, min_char); + for (i = 0; i < chartab_size[depth]; i++) + XSUB_CHAR_TABLE (table)->contents[i] = defalt; return table; } @@ -172,8 +168,8 @@ char_table_ascii (Lisp_Object table) static Lisp_Object copy_sub_char_table (Lisp_Object table) { - int depth = XINT (XSUB_CHAR_TABLE (table)->depth); - int min_char = XINT (XSUB_CHAR_TABLE (table)->min_char); + int depth = XSUB_CHAR_TABLE (table)->depth; + int min_char = XSUB_CHAR_TABLE (table)->min_char; Lisp_Object copy = make_sub_char_table (depth, min_char, Qnil); int i; @@ -220,10 +216,8 @@ static Lisp_Object sub_char_table_ref (Lisp_Object table, int c, bool is_uniprop) { struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); - int depth = XINT (tbl->depth); - int min_char = XINT (tbl->min_char); Lisp_Object val; - int idx = CHARTAB_IDX (c, depth, min_char); + int idx = CHARTAB_IDX (c, tbl->depth, tbl->min_char); val = tbl->contents[idx]; 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, Lisp_Object defalt, bool is_uniprop) { struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); - int depth = XINT (tbl->depth); - int min_char = XINT (tbl->min_char); + int depth = tbl->depth, min_char = tbl->min_char; int chartab_idx = CHARTAB_IDX (c, depth, min_char), idx; Lisp_Object val; @@ -402,8 +395,7 @@ static void sub_char_table_set (Lisp_Object table, int c, Lisp_Object val, bool is_uniprop) { struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); - int depth = XINT ((tbl)->depth); - int min_char = XINT ((tbl)->min_char); + int depth = tbl->depth, min_char = tbl->min_char; int i = CHARTAB_IDX (c, depth, min_char); Lisp_Object sub; @@ -458,8 +450,7 @@ sub_char_table_set_range (Lisp_Object table, int from, int to, Lisp_Object val, bool is_uniprop) { struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); - int depth = XINT ((tbl)->depth); - int min_char = XINT ((tbl)->min_char); + int depth = tbl->depth, min_char = tbl->min_char; int chars_in_block = chartab_chars[depth]; int i, c, lim = chartab_size[depth]; @@ -689,9 +680,8 @@ static Lisp_Object optimize_sub_char_table (Lisp_Object table, Lisp_Object test) { struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); - int depth = XINT (tbl->depth); + int i, depth = tbl->depth; Lisp_Object elt, this; - int i; bool optimizable; elt = XSUB_CHAR_TABLE (table)->contents[0]; @@ -778,8 +768,8 @@ map_sub_char_table (void (*c_function) (Lisp_Object, Lisp_Object, Lisp_Object), { struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); - depth = XINT (tbl->depth); - min_char = XINT (tbl->min_char); + depth = tbl->depth; + min_char = tbl->min_char; max_char = min_char + chartab_chars[depth - 1] - 1; } else @@ -973,12 +963,10 @@ map_sub_char_table_for_charset (void (*c_function) (Lisp_Object, Lisp_Object), unsigned from, unsigned to) { struct Lisp_Sub_Char_Table *tbl = XSUB_CHAR_TABLE (table); - int depth = XINT (tbl->depth); - int c, i; + int i, c = tbl->min_char, depth = tbl->depth; if (depth < 3) - for (i = 0, c = XINT (tbl->min_char); i < chartab_size[depth]; - i++, c += chartab_chars[depth]) + for (i = 0; i < chartab_size[depth]; i++, c += chartab_chars[depth]) { Lisp_Object this; @@ -1000,7 +988,7 @@ map_sub_char_table_for_charset (void (*c_function) (Lisp_Object, Lisp_Object), } } else - for (i = 0, c = XINT (tbl->min_char); i < chartab_size[depth]; i++, c ++) + for (i = 0; i < chartab_size[depth]; i++, c++) { Lisp_Object this; unsigned code; @@ -1147,8 +1135,7 @@ static Lisp_Object uniprop_table_uncompress (Lisp_Object table, int idx) { Lisp_Object val = XSUB_CHAR_TABLE (table)->contents[idx]; - int min_char = (XINT (XSUB_CHAR_TABLE (table)->min_char) - + chartab_chars[2] * idx); + int min_char = XSUB_CHAR_TABLE (table)->min_char + chartab_chars[2] * idx; Lisp_Object sub = make_sub_char_table (3, min_char, Qnil); const unsigned char *p, *pend; 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 *, void blank_row (struct window *, struct glyph_row *, int); void clear_glyph_matrix_rows (struct glyph_matrix *, int, int); void clear_glyph_row (struct glyph_row *); -void prepare_desired_row (struct glyph_row *); +void prepare_desired_row (struct window *, struct glyph_row *, bool); void update_single_window (struct window *, bool); void do_pending_window_change (bool); void 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 + x); if (w == NULL - || row == matrix->rows + dim.height - 1 + || (row == matrix->rows + dim.height - 1 + && WINDOW_WANTS_MODELINE_P (w)) || (row == matrix->rows && matrix->header_line_p)) { row->glyphs[TEXT_AREA] @@ -492,8 +493,9 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y = xnrealloc (row->glyphs[LEFT_MARGIN_AREA], dim.width, sizeof (struct glyph)); - /* The mode line never has marginal areas. */ - if (row == matrix->rows + dim.height - 1 + /* The mode line, if displayed, never has marginal areas. */ + if ((row == matrix->rows + dim.height - 1 + && !(w && WINDOW_WANTS_MODELINE_P (w))) || (row == matrix->rows && matrix->header_line_p)) { row->glyphs[TEXT_AREA] @@ -1049,13 +1051,16 @@ find_glyph_row_slice (struct glyph_matrix *window_matrix, #endif /* 0 */ -/* Prepare ROW for display. Desired rows are cleared lazily, - i.e. they are only marked as to be cleared by setting their +/* Prepare ROW for display in windows W. Desired rows are cleared + lazily, i.e. they are only marked as to be cleared by setting their enabled_p flag to zero. When a row is to be displayed, a prior - call to this function really clears it. */ + call to this function really clears it. In addition, this function + makes sure the marginal areas of ROW are in sync with the window's + display margins. MODE_LINE_P non-zero means we are preparing a + glyph row for header line or mode line. */ void -prepare_desired_row (struct glyph_row *row) +prepare_desired_row (struct window *w, struct glyph_row *row, bool mode_line_p) { if (!row->enabled_p) { @@ -1065,6 +1070,39 @@ prepare_desired_row (struct glyph_row *row) row->enabled_p = true; row->reversed_p = rp; } + if (mode_line_p) + { + /* Mode and header lines, if displayed, never have marginal + areas. If we are called with MODE_LINE_P non-zero, we are + displaying the mode/header line in this window, and so the + marginal areas of this glyph row should be eliminated. This + is needed when the mode/header line is switched on in a + window that has display margins. */ + if (w->left_margin_cols > 0) + row->glyphs[TEXT_AREA] = row->glyphs[LEFT_MARGIN_AREA]; + if (w->right_margin_cols > 0) + row->glyphs[RIGHT_MARGIN_AREA] = row->glyphs[LAST_AREA]; + } + else if (row == MATRIX_MODE_LINE_ROW (w->desired_matrix) + || row == MATRIX_HEADER_LINE_ROW (w->desired_matrix)) + { + /* The real number of glyphs reserved for the margins is + recorded in the glyph matrix, and can be different from + window's left_margin_cols and right_margin_cols; see + margin_glyphs_to_reserve for when that happens. */ + int left = w->desired_matrix->left_margin_glyphs; + int right = w->desired_matrix->right_margin_glyphs; + + /* Make sure the marginal areas of this row are in sync with + what the window wants, when the 1st/last row of the matrix + actually displays text and not header/mode line. */ + if (w->left_margin_cols > 0 + && (left != row->glyphs[TEXT_AREA] - row->glyphs[LEFT_MARGIN_AREA])) + row->glyphs[TEXT_AREA] = row->glyphs[LEFT_MARGIN_AREA] + left; + if (w->right_margin_cols > 0 + && (right != row->glyphs[LAST_AREA] - row->glyphs[RIGHT_MARGIN_AREA])) + row->glyphs[RIGHT_MARGIN_AREA] = row->glyphs[LAST_AREA] - right; + } } 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) return active_drivers; } -int -font_put_frame_data (struct frame *f, struct font_driver *driver, void *data) -{ - struct font_data_list *list, *prev; +#if defined (HAVE_XFT) || defined (HAVE_FREETYPE) - for (prev = NULL, list = f->font_data_list; list; - prev = list, list = list->next) - if (list->driver == driver) - break; - if (! data) - { - if (list) - { - if (prev) - prev->next = list->next; - else - f->font_data_list = list->next; - xfree (list); - } - return 0; - } +void +font_put_frame_data (struct frame *f, Lisp_Object driver, void *data) +{ + Lisp_Object val = assq_no_quit (driver, f->font_data); - if (! list) + if (!data) + f->font_data = Fdelq (val, f->font_data); + else { - list = xmalloc (sizeof *list); - list->driver = driver; - list->next = f->font_data_list; - f->font_data_list = list; + if (NILP (val)) + f->font_data = Fcons (Fcons (driver, make_save_ptr (data)), + f->font_data); + else + XSETCDR (val, make_save_ptr (data)); } - list->data = data; - return 0; } - void * -font_get_frame_data (struct frame *f, struct font_driver *driver) +font_get_frame_data (struct frame *f, Lisp_Object driver) { - struct font_data_list *list; - - for (list = f->font_data_list; list; list = list->next) - if (list->driver == driver) - break; - if (! list) - return NULL; - return list->data; + Lisp_Object val = assq_no_quit (driver, f->font_data); + + return NILP (val) ? NULL : XSAVE_POINTER (XCDR (val), 0); } +#endif /* HAVE_XFT || HAVE_FREETYPE */ /* Sets attributes on a font. Any properties that appear in ALIST and 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 #endif /* HAVE_WINDOW_SYSTEM */ /* Optional. - Return an outline data for glyph-code CODE of FONT. The format - of the outline data depends on the font-driver. */ - void *(*get_outline) (struct font *font, unsigned code); - - /* Optional. - Free OUTLINE (that is obtained by the above method). */ - void (*free_outline) (struct font *font, void *outline); - - /* Optional. Get coordinates of the INDEXth anchor point of the glyph whose code is CODE. Store the coordinates in *X and *Y. Return 0 if the operations was successful. Otherwise return -1. */ @@ -723,20 +714,6 @@ struct font_driver_list struct font_driver_list *next; }; - -/* Chain of arbitrary data specific to each font driver. - Each frame has its own font data list at F->font_data_list. */ - -struct font_data_list -{ - /* Pointer to the font driver. */ - struct font_driver *driver; - /* Data specific to the font driver. */ - void *data; - /* Pointer to the next element of the chain. */ - struct font_data_list *next; -}; - extern Lisp_Object copy_font_spec (Lisp_Object); extern Lisp_Object merge_font_spec (Lisp_Object, Lisp_Object); @@ -809,11 +786,10 @@ extern void font_fill_lglyph_metrics (Lisp_Object, Lisp_Object); extern Lisp_Object font_put_extra (Lisp_Object font, Lisp_Object prop, Lisp_Object val); -extern int font_put_frame_data (struct frame *f, - struct font_driver *driver, - void *data); -extern void *font_get_frame_data (struct frame *f, - struct font_driver *driver); +#if defined (HAVE_XFT) || defined (HAVE_FREETYPE) +extern void font_put_frame_data (struct frame *, Lisp_Object, void *); +extern void *font_get_frame_data (struct frame *f, Lisp_Object); +#endif /* HAVE_XFT || HAVE_FREETYPE */ extern void font_filter_properties (Lisp_Object font, 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/>. */ #ifdef HAVE_WINDOW_SYSTEM #include "fontset.h" #endif +#include "cm.h" #ifdef MSDOS #include "msdos.h" #include "dosfns.h" @@ -854,7 +855,9 @@ do_switch_frame (Lisp_Object frame, int track, int for_deletion, Lisp_Object nor if (FRAME_TERMCAP_P (XFRAME (frame)) || FRAME_MSDOS_P (XFRAME (frame))) { - Lisp_Object top_frame = FRAME_TTY (XFRAME (frame))->top_frame; + struct frame *f = XFRAME (frame); + struct tty_display_info *tty = FRAME_TTY (f); + Lisp_Object top_frame = tty->top_frame; /* Don't mark the frame garbaged and/or obscured if we are 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 if (FRAMEP (top_frame)) /* Mark previously displayed frame as now obscured. */ SET_FRAME_VISIBLE (XFRAME (top_frame), 2); - SET_FRAME_VISIBLE (XFRAME (frame), 1); + SET_FRAME_VISIBLE (f, 1); + /* If the new TTY frame changed dimensions, we need to + resync term.c's idea of the frame size with the new + frame's data. */ + if (FRAME_COLS (f) != FrameCols (tty)) + FrameCols (tty) = FRAME_COLS (f); + if (FRAME_LINES (f) != FrameRows (tty)) + FrameRows (tty) = FRAME_LINES (f); } - FRAME_TTY (XFRAME (frame))->top_frame = frame; + tty->top_frame = frame; } 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 tool bar only supports top. */ Lisp_Object tool_bar_position; +#if defined (HAVE_XFT) || defined (HAVE_FREETYPE) + /* List of data specific to font-driver and frame, but common to faces. */ + Lisp_Object font_data; +#endif + /* Beyond here, there should be no more Lisp_Object components. */ /* Cache of realized faces. */ @@ -328,9 +333,6 @@ struct frame /* List of font-drivers available on the frame. */ struct font_driver_list *font_driver_list; - /* List of data specific to font-driver and frame, but common to - faces. */ - struct font_data_list *font_data_list; /* Total width of fringes reserved for drawing truncation bitmaps, 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 = NULL, /* draw */ ftfont_get_bitmap, NULL, /* free_bitmap */ - NULL, /* get_outline */ - NULL, /* free_outline */ ftfont_anchor_point, #ifdef HAVE_LIBOTF 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 XColor color; XGCValues xgcv; int i; - struct ftxfont_frame_data *data = font_get_frame_data (f, &ftxfont_driver); + struct ftxfont_frame_data *data = font_get_frame_data (f, Qftx); struct ftxfont_frame_data *prev = NULL, *this = NULL, *new; if (data) @@ -78,19 +78,11 @@ ftxfont_get_gcs (struct frame *f, unsigned long foreground, unsigned long backgr } } - new = malloc (sizeof *new); - if (! new) - return NULL; + new = xmalloc (sizeof *new); new->next = this; if (prev) - { prev->next = new; - } - else if (font_put_frame_data (f, &ftxfont_driver, new) < 0) - { - free (new); - return NULL; - } + font_put_frame_data (f, Qftx, new); new->colors[0].pixel = background; new->colors[1].pixel = foreground; @@ -123,8 +115,8 @@ ftxfont_get_gcs (struct frame *f, unsigned long foreground, unsigned long backgr if (prev) prev->next = new->next; else if (data) - font_put_frame_data (f, &ftxfont_driver, new->next); - free (new); + font_put_frame_data (f, Qftx, new->next); + xfree (new); return NULL; } return new->gcs; @@ -337,7 +329,7 @@ ftxfont_draw (struct glyph_string *s, int from, int to, int x, int y, static int ftxfont_end_for_frame (struct frame *f) { - struct ftxfont_frame_data *data = font_get_frame_data (f, &ftxfont_driver); + struct ftxfont_frame_data *data = font_get_frame_data (f, Qftx); block_input (); while (data) @@ -347,11 +339,11 @@ ftxfont_end_for_frame (struct frame *f) for (i = 0; i < 6; i++) XFreeGC (FRAME_X_DISPLAY (f), data->gcs[i]); - free (data); + xfree (data); data = next; } unblock_input (); - font_put_frame_data (f, &ftxfont_driver, NULL); + font_put_frame_data (f, Qftx, NULL); return 0; } 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) /* This is really the value. */ return object; - /* If the keymap contents looks like (keymap ...) or (lambda ...) - then use itself. */ - else if (EQ (XCAR (object), Qkeymap) || EQ (XCAR (object), Qlambda)) - return object; - /* If the keymap contents looks like (menu-item name . DEFN) or (menu-item name DEFN ...) then use DEFN. This is a new format menu item. */ @@ -768,25 +763,8 @@ get_keyelt (Lisp_Object object, bool autoload) Keymap alist elements like (CHAR MENUSTRING . DEFN) will be used by HierarKey menus. */ else if (STRINGP (XCAR (object))) - { - object = XCDR (object); - /* Also remove a menu help string, if any, - following the menu item name. */ - if (CONSP (object) && STRINGP (XCAR (object))) - object = XCDR (object); - /* Also remove the sublist that caches key equivalences, if any. */ - if (CONSP (object) && CONSP (XCAR (object))) - { - Lisp_Object carcar; - carcar = XCAR (XCAR (object)); - if (NILP (carcar) || VECTORP (carcar)) - object = XCDR (object); - } - } + object = XCDR (object); - /* If the contents are (KEYMAP . ELEMENT), go indirect. */ - else if (KEYMAPP (XCAR (object))) - error ("Wow, indirect keymap entry!!"); else return object; } @@ -990,9 +968,6 @@ copy_keymap_item (Lisp_Object elt) if (CONSP (tem) && EQ (XCAR (tem), Qkeymap)) XSETCAR (elt, Fcopy_keymap (tem)); tem = XCDR (elt); - if (CONSP (tem) && CONSP (XCAR (tem))) - /* Delete cache for key equivalences. */ - XSETCDR (elt, XCDR (tem)); } } else @@ -1011,16 +986,6 @@ copy_keymap_item (Lisp_Object elt) elt = XCDR (elt); tem = XCDR (elt); } - /* There may also be a list that caches key equivalences. - Just delete it for the new keymap. */ - if (CONSP (tem) - && CONSP (XCAR (tem)) - && (NILP (XCAR (XCAR (tem))) - || VECTORP (XCAR (XCAR (tem))))) - { - XSETCDR (elt, XCDR (tem)); - tem = XCDR (tem); - } if (CONSP (tem) && EQ (XCAR (tem), Qkeymap)) XSETCDR (elt, Fcopy_keymap (tem)); } @@ -2572,9 +2537,8 @@ If FIRSTONLY has another non-nil value, prefer bindings that use the modifier key specified in `where-is-preferred-modifier' \(or their meta variants) and entirely reject menu bindings. -If optional 4th arg NOINDIRECT is non-nil, don't follow indirections -to other keymaps or slots. This makes it possible to search for an -indirect definition itself. +If optional 4th arg NOINDIRECT is non-nil, don't extract the commands inside +menu-items. This makes it possible to search for a menu-item itself. The optional 5th arg NO-REMAP alters how command remapping is handled: 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) sense to handle a char-table with type struct Lisp_Vector. An element of a char table can be any Lisp objects, but if it is a sub char-table, we treat it a table that contains information of a - specific range of characters. A sub char-table has the same - structure as a vector. A sub char table appears only in an element - of a char-table, and there's no way to access it directly from - Emacs Lisp program. */ + specific range of characters. A sub char-table is like a vector but + with two integer fields between the header and Lisp data, which means + that it has to be marked with some precautions (see mark_char_table + in alloc.c). A sub char-table appears only in an element of a char-table, + and there's no way to access it directly from Emacs Lisp program. */ enum CHARTAB_SIZE_BITS { @@ -1465,10 +1466,10 @@ struct Lisp_Sub_Char_Table contains 32 elements, and each element covers 128 characters. A sub char-table of depth 3 contains 128 elements, and each element is for one character. */ - Lisp_Object depth; + int depth; /* Minimum character covered by the sub char-table. */ - Lisp_Object min_char; + int min_char; /* Use set_sub_char_table_contents to set this. */ Lisp_Object contents[FLEXIBLE_ARRAY_MEMBER]; @@ -1539,12 +1540,16 @@ struct Lisp_Subr const char *doc; }; -/* This is the number of slots that every char table must have. This - counts the ordinary slots and the top, defalt, parent, and purpose - slots. */ -enum CHAR_TABLE_STANDARD_SLOTS +enum char_table_specials { - CHAR_TABLE_STANDARD_SLOTS = PSEUDOVECSIZE (struct Lisp_Char_Table, extras) + /* This is the number of slots that every char table must have. This + counts the ordinary slots and the top, defalt, parent, and purpose + slots. */ + CHAR_TABLE_STANDARD_SLOTS = PSEUDOVECSIZE (struct Lisp_Char_Table, extras), + + /* This is an index of first Lisp_Object field in Lisp_Sub_Char_Table + when the latter is treated as an ordinary Lisp_Vector. */ + SUB_CHAR_TABLE_OFFSET = PSEUDOVECSIZE (struct Lisp_Sub_Char_Table, contents) }; /* Return the number of "extra" slots in the char table CT. */ @@ -1556,7 +1561,11 @@ CHAR_TABLE_EXTRA_SLOTS (struct Lisp_Char_Table *ct) - CHAR_TABLE_STANDARD_SLOTS); } - +/* Make sure that sub char-table contents slot + is aligned on a multiple of Lisp_Objects. */ +verify ((offsetof (struct Lisp_Sub_Char_Table, contents) + - offsetof (struct Lisp_Sub_Char_Table, depth)) % word_size == 0); + /*********************************************************************** Symbols ***********************************************************************/ @@ -3723,6 +3732,20 @@ make_uninit_vector (ptrdiff_t size) return v; } +/* Like above, but special for sub char-tables. */ + +INLINE Lisp_Object +make_uninit_sub_char_table (int depth, int min_char) +{ + int slots = SUB_CHAR_TABLE_OFFSET + chartab_size[depth]; + Lisp_Object v = make_uninit_vector (slots); + + XSETPVECTYPE (XVECTOR (v), PVEC_SUB_CHAR_TABLE); + XSUB_CHAR_TABLE (v)->depth = depth; + XSUB_CHAR_TABLE (v)->min_char = min_char; + return v; +} + extern struct Lisp_Vector *allocate_pseudovector (int, int, enum pvec_type); #define ALLOCATE_PSEUDOVECTOR(typ,field,tag) \ ((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) c = READCHAR; if (c == '[') { - Lisp_Object tmp; - int depth; - ptrdiff_t size; + /* Sub char-table can't be read as a regular + vector because of a two C integer fields. */ + Lisp_Object tbl, tmp = read_list (1, readcharfun); + ptrdiff_t size = XINT (Flength (tmp)); + int i, depth, min_char; + struct Lisp_Cons *cell; - tmp = read_vector (readcharfun, 0); - size = ASIZE (tmp); if (size == 0) - error ("Invalid size char-table"); - if (! RANGED_INTEGERP (1, AREF (tmp, 0), 3)) - error ("Invalid depth in char-table"); - depth = XINT (AREF (tmp, 0)); + error ("Zero-sized sub char-table"); + + if (! RANGED_INTEGERP (1, XCAR (tmp), 3)) + error ("Invalid depth in sub char-table"); + depth = XINT (XCAR (tmp)); if (chartab_size[depth] != size - 2) - error ("Invalid size char-table"); - XSETPVECTYPE (XVECTOR (tmp), PVEC_SUB_CHAR_TABLE); - return tmp; + error ("Invalid size in sub char-table"); + cell = XCONS (tmp), tmp = XCDR (tmp), size--; + free_cons (cell); + + if (! RANGED_INTEGERP (0, XCAR (tmp), MAX_CHAR)) + error ("Invalid minimum character in sub-char-table"); + min_char = XINT (XCAR (tmp)); + cell = XCONS (tmp), tmp = XCDR (tmp), size--; + free_cons (cell); + + tbl = make_uninit_sub_char_table (depth, min_char); + for (i = 0; i < size; i++) + { + XSUB_CHAR_TABLE (tbl)->contents[i] = XCAR (tmp); + cell = XCONS (tmp), tmp = XCDR (tmp); + free_cons (cell); + } + return tbl; } invalid_syntax ("#^^"); } 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 = macfont_draw, NULL, /* get_bitmap */ NULL, /* free_bitmap */ - NULL, /* get_outline */ - NULL, /* free_outline */ NULL, /* anchor_point */ NULL, /* otf_capability */ 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 but I don't want to make one now. */ CHECK_WINDOW (window); + /* Note that xw_popup_dialog can call menu code, so + Vmenu_updating_frame should be set (Bug#17891). */ + eassert (f && FRAME_LIVE_P (f)); + XSETFRAME (Vmenu_updating_frame, f); + /* Force a redisplay before showing the dialog. If a frame is created just before showing the dialog, its contents may not have been fully 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 = nsfont_encode_char, nsfont_text_extents, nsfont_draw, - /* excluded: get_bitmap, free_bitmap, get_outline, free_outline, + /* excluded: get_bitmap, free_bitmap, anchor_point, otf_capability, otf_driver, start_for_frame, end_for_frame, shape */ }; 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) Otherwise we'll make a line extremely long, which results in slow redisplay. */ if (SUB_CHAR_TABLE_P (obj) - && XINT (XSUB_CHAR_TABLE (obj)->depth) == 3) + && XSUB_CHAR_TABLE (obj)->depth == 3) PRINTCHAR ('\n'); PRINTCHAR ('#'); PRINTCHAR ('^'); @@ -1981,16 +1981,24 @@ print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag) PRINTCHAR ('['); { - register int i; + int i, idx = SUB_CHAR_TABLE_P (obj) ? SUB_CHAR_TABLE_OFFSET : 0; register Lisp_Object tem; ptrdiff_t real_size = size; + /* For a sub char-table, print heading non-Lisp data first. */ + if (SUB_CHAR_TABLE_P (obj)) + { + i = sprintf (buf, "%d %d", XSUB_CHAR_TABLE (obj)->depth, + XSUB_CHAR_TABLE (obj)->min_char); + strout (buf, i, i, printcharfun); + } + /* Don't print more elements than the specified maximum. */ if (NATNUMP (Vprint_length) && XFASTINT (Vprint_length) < size) size = XFASTINT (Vprint_length); - for (i = 0; i < size; i++) + for (i = idx; i < size; i++) { if (i) PRINTCHAR (' '); 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); extern const char *map_w32_filename (const char *, const char **); extern char * w32_strerror (int error_no); -/* If non-NULL, a handle to a frame where to display the hourglass cursor. */ -static HWND hourglass_hwnd = NULL; - #ifndef IDC_HAND #define IDC_HAND MAKEINTRESOURCE(32649) #endif @@ -233,10 +230,6 @@ static int menubar_in_use = 0; extern void syms_of_w32uniscribe (void); extern int uniscribe_available; -/* Function prototypes for hourglass support. */ -static void w32_show_hourglass (struct frame *); -static void w32_hide_hourglass (void); - #ifdef WINDOWSNT /* From w32inevt.c */ extern int faked_key; @@ -5500,95 +5493,62 @@ no value of TYPE (always string in the MS Windows case). */) Busy cursor ***********************************************************************/ -void -w32_note_current_window (void) -{ - struct frame * f = SELECTED_FRAME (); - - if (!FRAME_W32_P (f)) - return; - - hourglass_hwnd = FRAME_W32_WINDOW (f); -} +/* Display an hourglass cursor. Set the hourglass_p flag in display info + to indicate that an hourglass cursor is shown. */ void show_hourglass (struct atimer *timer) { - struct frame *f; - hourglass_atimer = NULL; - block_input (); - f = x_window_to_frame (&one_w32_display_info, - hourglass_hwnd); - - if (f) - f->output_data.w32->hourglass_p = 0; - else - f = SELECTED_FRAME (); - - if (!FRAME_W32_P (f)) + if (!hourglass_shown_p) { - unblock_input (); - return; - } - - w32_show_hourglass (f); - unblock_input (); -} + Lisp_Object tail, frame; -void -hide_hourglass (void) -{ - block_input (); - w32_hide_hourglass (); - unblock_input (); -} - - -/* Display an hourglass cursor. Set the hourglass_p flag in display info - to indicate that an hourglass cursor is shown. */ + block_input (); + FOR_EACH_FRAME (tail, frame) + { + struct frame *f = XFRAME (frame); -static void -w32_show_hourglass (struct frame *f) -{ - if (!hourglass_shown_p) - { - f->output_data.w32->hourglass_p = 1; - if (!menubar_in_use && !current_popup_menu) - SetCursor (f->output_data.w32->hourglass_cursor); + if (FRAME_W32_P (f) && !menubar_in_use && !current_popup_menu) + { + f->output_data.w32->hourglass_p = 1; + SetCursor (f->output_data.w32->hourglass_cursor); + } + } + unblock_input (); hourglass_shown_p = 1; } } - /* Hide the hourglass cursor on all frames, if it is currently shown. */ -static void -w32_hide_hourglass (void) +void +hide_hourglass (void) { if (hourglass_shown_p) { - struct frame *f = x_window_to_frame (&one_w32_display_info, - hourglass_hwnd); - if (f) - f->output_data.w32->hourglass_p = 0; - else - /* If frame was deleted, restore to selected frame's cursor. */ - f = SELECTED_FRAME (); + Lisp_Object tail, frame; - if (FRAME_W32_P (f)) - SetCursor (f->output_data.w32->current_cursor); - else - /* No cursors on non GUI frames - restore to stock arrow cursor. */ - SetCursor (w32_load_cursor (IDC_ARROW)); + block_input (); + FOR_EACH_FRAME (tail, frame) + { + struct frame *f = XFRAME (frame); + if (FRAME_W32_P (f)) + { + f->output_data.w32->hourglass_p = 0; + SetCursor (f->output_data.w32->current_cursor); + } + else + /* No cursors on non GUI frames - restore to stock arrow cursor. */ + SetCursor (w32_load_cursor (IDC_ARROW)); + } + unblock_input (); hourglass_shown_p = 0; } } - - /*********************************************************************** Tool tips ***********************************************************************/ @@ -8415,9 +8375,6 @@ only be necessary if the default setting causes problems. */); #endif defsubr (&Sset_message_beep); - - hourglass_hwnd = NULL; - defsubr (&Sx_show_tip); defsubr (&Sx_hide_tip); 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, static void w32font_free_bitmap (struct font *font, struct font_bitmap *bitmap); */ -/* w32 implementation of get_outline for font backend. - Optional. - Return an outline data for glyph-code CODE of FONT. The format - of the outline data depends on the font-driver. -static void * -w32font_get_outline (struct font *font, unsigned code); - */ -/* w32 implementation of free_outline for font backend. - Optional. - Free OUTLINE (that is obtained by the above method). -static void -w32font_free_outline (struct font *font, void *outline); - */ /* w32 implementation of anchor_point for font backend. Optional. Get coordinates of the INDEXth anchor point of the glyph whose @@ -2557,8 +2544,6 @@ struct font_driver w32font_driver = w32font_draw, NULL, /* get_bitmap */ NULL, /* free_bitmap */ - NULL, /* get_outline */ - NULL, /* free_outline */ NULL, /* anchor_point */ NULL, /* otf_capability */ 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) int uniscribe_get_bitmap (struct font *font, unsigned code, struct font_bitmap *bitmap, int bits_per_pixel); void uniscribe_free_bitmap (struct font *font, struct font_bitmap *bitmap); - void * uniscribe_get_outline (struct font *font, unsigned code); - void uniscribe_free_outline (struct font *font, void *outline); int uniscribe_anchor_point (struct font *font, unsigned code, int index, int *x, int *y); int uniscribe_start_for_frame (struct frame *f); @@ -981,8 +979,6 @@ struct font_driver uniscribe_font_driver = w32font_draw, NULL, /* get_bitmap */ NULL, /* free_bitmap */ - NULL, /* get_outline */ - NULL, /* free_outline */ NULL, /* anchor_point */ uniscribe_otf_capability, /* Defined so (font-get FONTOBJ :otf) works. */ 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 int left_fringe_width; int right_fringe_width; - /* Width of left and right marginal areas in columns. - A value of 0 means no margin. */ + /* Requested width of left and right marginal areas in columns. A + value of 0 means no margin. The actual values are recorded in + the window's glyph matrix, in the left_margin_glyphs and + right_margin_glyphs members. */ int left_margin_cols; int right_margin_cols; 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) } /* Clear the result glyph row and enable it. */ - prepare_desired_row (row); + prepare_desired_row (it->w, row, false); row->y = it->current_y; row->start = it->start; @@ -21517,7 +21517,7 @@ display_mode_line (struct window *w, enum face_id face_id, Lisp_Object format) /* Don't extend on a previously drawn mode-line. This may happen if called from pos_visible_p. */ it.glyph_row->enabled_p = false; - prepare_desired_row (it.glyph_row); + prepare_desired_row (w, it.glyph_row, true); it.glyph_row->mode_line_p = 1; @@ -30683,13 +30683,6 @@ start_hourglass (void) else delay = make_timespec (DEFAULT_HOURGLASS_DELAY, 0); -#ifdef HAVE_NTGUI - { - extern void w32_note_current_window (void); - w32_note_current_window (); - } -#endif /* HAVE_NTGUI */ - hourglass_atimer = start_atimer (ATIMER_RELATIVE, delay, show_hourglass, NULL); } 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) } #endif /* HAVE_WINDOW_SYSTEM */ - /* Realize basic faces. Must have enough information in frame - parameters to realize basic faces at this point. */ -#ifdef HAVE_X_WINDOWS - if (!FRAME_X_P (f) || FRAME_X_WINDOW (f)) -#endif -#ifdef HAVE_NTGUI - if (!FRAME_WINDOW_P (f) || FRAME_W32_WINDOW (f)) -#endif -#ifdef HAVE_NS - if (!FRAME_NS_P (f) || FRAME_NS_WINDOW (f)) -#endif - if (!realize_basic_faces (f)) - emacs_abort (); + /* Realize faces early (Bug#17889). */ + if (!realize_basic_faces (f)) + emacs_abort (); } 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 = xfont_encode_char, xfont_text_extents, xfont_draw, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, xfont_check, NULL, /* get_variation_glyphs */ 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 static XftDraw * xftfont_get_xft_draw (struct frame *f) { - XftDraw *xft_draw = font_get_frame_data (f, &xftfont_driver); + XftDraw *xft_draw = font_get_frame_data (f, Qxft); if (! xft_draw) { @@ -604,7 +604,7 @@ xftfont_get_xft_draw (struct frame *f) FRAME_X_COLORMAP (f)); unblock_input (); eassert (xft_draw != NULL); - font_put_frame_data (f, &xftfont_driver, xft_draw); + font_put_frame_data (f, Qxft, xft_draw); } return xft_draw; } @@ -680,14 +680,14 @@ xftfont_end_for_frame (struct frame *f) /* Don't do anything if display is dead */ if (FRAME_X_DISPLAY (f) == NULL) return 0; - xft_draw = font_get_frame_data (f, &xftfont_driver); + xft_draw = font_get_frame_data (f, Qxft); if (xft_draw) { block_input (); XftDrawDestroy (xft_draw); unblock_input (); - font_put_frame_data (f, &xftfont_driver, NULL); + font_put_frame_data (f, Qxft, NULL); } return 0; } 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, if (total_size_max < bytes_remaining) goto size_overflow; total_size = bytes_remaining; - data = malloc (total_size + 1); - if (! data) - goto memory_exhausted; + data = xmalloc (total_size + 1); /* Now read, until we've gotten it all. */ while (bytes_remaining) @@ -1352,9 +1350,7 @@ x_get_window_property (Display *display, Window window, Atom property, if (remaining_lim < 0 || remaining_lim < bytes_remaining) goto size_overflow; total_size = offset + bytes_gotten + bytes_remaining; - data1 = realloc (data, total_size + 1); - if (! data1) - goto memory_exhausted; + data1 = xrealloc (data, total_size + 1); data = data1; } @@ -1386,14 +1382,10 @@ x_get_window_property (Display *display, Window window, Atom property, return; size_overflow: - free (data); + if (data) + xfree (data); unblock_input (); memory_full (SIZE_MAX); - - memory_exhausted: - free (data); - unblock_input (); - memory_full (total_size + 1); } /* Use xfree, not XFree, to free the data obtained with this function. */ |
