diff options
| author | Glenn Morris | 2014-07-02 23:00:53 -0700 |
|---|---|---|
| committer | Glenn Morris | 2014-07-02 23:00:53 -0700 |
| commit | 2d3c9015c70fd05ac1bec42cc59d57c3fb6b82b5 (patch) | |
| tree | 572bc2de8c74eee49d8c49eb84a618b55fa3abf7 /src | |
| parent | e993f8d5d39431545ac0071655071a740534917b (diff) | |
| parent | cbb6a7aeff3b901645ee8e4f2c4abeceafdfc073 (diff) | |
| download | emacs-2d3c9015c70fd05ac1bec42cc59d57c3fb6b82b5.tar.gz emacs-2d3c9015c70fd05ac1bec42cc59d57c3fb6b82b5.zip | |
Merge from emacs-24; up to 2014-06-15T04:52:34Z!eli@barzilay.org
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 25 | ||||
| -rw-r--r-- | src/dispextern.h | 2 | ||||
| -rw-r--r-- | src/dispnew.c | 52 | ||||
| -rw-r--r-- | src/frame.c | 16 | ||||
| -rw-r--r-- | src/menu.c | 5 | ||||
| -rw-r--r-- | src/window.h | 6 | ||||
| -rw-r--r-- | src/xdisp.c | 4 | ||||
| -rw-r--r-- | src/xfaces.c | 16 |
8 files changed, 98 insertions, 28 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index bb514753bdb..0f9b7431462 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,28 @@ | |||
| 1 | 2014-07-03 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * dispnew.c (prepare_desired_row): Accept 2 additional arguments: | ||
| 4 | the window whose glyph row is being prepared and a flag whether it | ||
| 5 | is for mode/header line. Make sure the glyph row's marginal areas | ||
| 6 | are in sync with what the window wants. | ||
| 7 | (Bug#17892) | ||
| 8 | |||
| 9 | * xdisp.c (display_line, display_mode_line): Call | ||
| 10 | prepare_desired_row with additional arguments, as appropriate. | ||
| 11 | |||
| 12 | * dispextern.h (prepare_desired_row): Adjust prototype. | ||
| 13 | |||
| 14 | 2014-07-03 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 15 | |||
| 16 | * xfaces.c (init_frame_faces): Always realize basic faces (Bug#17889). | ||
| 17 | * menu.c (Fx_popup_dialog): Set Vmenu_updating_frame to avoid crash | ||
| 18 | caused by xw_popup_dialog in daemon mode (Bug#17891). | ||
| 19 | |||
| 20 | 2014-07-03 Eli Zaretskii <eliz@gnu.org> | ||
| 21 | |||
| 22 | * frame.c (do_switch_frame): When switching to another TTY frame, | ||
| 23 | make sure FrameCols and FrameRows are in sync with the new frame's | ||
| 24 | data. (Bug#17875) | ||
| 25 | |||
| 1 | 2014-07-02 Dmitry Antipov <dmantipov@yandex.ru> | 26 | 2014-07-02 Dmitry Antipov <dmantipov@yandex.ru> |
| 2 | 27 | ||
| 3 | Shrink Lisp_Sub_Char_Table by preferring C integers to Lisp_Objects. | 28 | Shrink Lisp_Sub_Char_Table by preferring C integers to Lisp_Objects. |
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 *, | |||
| 3460 | void blank_row (struct window *, struct glyph_row *, int); | 3460 | void blank_row (struct window *, struct glyph_row *, int); |
| 3461 | void clear_glyph_matrix_rows (struct glyph_matrix *, int, int); | 3461 | void clear_glyph_matrix_rows (struct glyph_matrix *, int, int); |
| 3462 | void clear_glyph_row (struct glyph_row *); | 3462 | void clear_glyph_row (struct glyph_row *); |
| 3463 | void prepare_desired_row (struct glyph_row *); | 3463 | void prepare_desired_row (struct window *, struct glyph_row *, bool); |
| 3464 | void update_single_window (struct window *, bool); | 3464 | void update_single_window (struct window *, bool); |
| 3465 | void do_pending_window_change (bool); | 3465 | void do_pending_window_change (bool); |
| 3466 | void change_frame_size (struct frame *, int, int, bool, bool, bool, bool); | 3466 | 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 | |||
| 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 | ||
| 1057 | void | 1062 | void |
| 1058 | prepare_desired_row (struct glyph_row *row) | 1063 | prepare_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/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/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/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..3e76d3df9f9 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 | ||
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 | ||