diff options
| author | Dmitry Antipov | 2012-11-13 10:11:40 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2012-11-13 10:11:40 +0400 |
| commit | 2a14f83bbdb59565f3e4bffa8e583270e10cf92c (patch) | |
| tree | 45168ab55413daefe7a6902d2551339bea5d2a6b /src | |
| parent | 7db1bda8a4a757581f2b93a90657ae667d7e62fb (diff) | |
| download | emacs-2a14f83bbdb59565f3e4bffa8e583270e10cf92c.tar.gz emacs-2a14f83bbdb59565f3e4bffa8e583270e10cf92c.zip | |
Omit glyphs initialization at startup.
* dispnew.c (glyphs_initialized_initially_p): Remove.
(adjust_frame_glyphs_initially): Likewise. Adjust users.
(Fredraw_frame): Move actual code from here...
(redraw_here): ...to here. Add eassert. Adjust comment.
(Fredraw_display): Use redraw_frame.
* xdisp.c (clear_garbaged_frames): Likewise.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 10 | ||||
| -rw-r--r-- | src/dispnew.c | 82 | ||||
| -rw-r--r-- | src/xdisp.c | 2 |
3 files changed, 24 insertions, 70 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 88352c201b6..bdddcc11cdb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2012-11-13 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 2 | |||
| 3 | Omit glyphs initialization at startup. | ||
| 4 | * dispnew.c (glyphs_initialized_initially_p): Remove. | ||
| 5 | (adjust_frame_glyphs_initially): Likewise. Adjust users. | ||
| 6 | (Fredraw_frame): Move actual code from here... | ||
| 7 | (redraw_here): ...to here. Add eassert. Adjust comment. | ||
| 8 | (Fredraw_display): Use redraw_frame. | ||
| 9 | * xdisp.c (clear_garbaged_frames): Likewise. | ||
| 10 | |||
| 1 | 2012-11-13 Eli Zaretskii <eliz@gnu.org> | 11 | 2012-11-13 Eli Zaretskii <eliz@gnu.org> |
| 2 | 12 | ||
| 3 | * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument | 13 | * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument |
diff --git a/src/dispnew.c b/src/dispnew.c index 4758f4ad76f..675c06c22e9 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -141,10 +141,6 @@ struct frame *last_nonminibuf_frame; | |||
| 141 | 141 | ||
| 142 | static bool delayed_size_change; | 142 | static bool delayed_size_change; |
| 143 | 143 | ||
| 144 | /* 1 means glyph initialization has been completed at startup. */ | ||
| 145 | |||
| 146 | static bool glyphs_initialized_initially_p; | ||
| 147 | |||
| 148 | /* Updated window if != 0. Set by update_window. */ | 144 | /* Updated window if != 0. Set by update_window. */ |
| 149 | 145 | ||
| 150 | struct window *updated_window; | 146 | struct window *updated_window; |
| @@ -1850,43 +1846,6 @@ adjust_glyphs (struct frame *f) | |||
| 1850 | unblock_input (); | 1846 | unblock_input (); |
| 1851 | } | 1847 | } |
| 1852 | 1848 | ||
| 1853 | |||
| 1854 | /* Adjust frame glyphs when Emacs is initialized. | ||
| 1855 | |||
| 1856 | To be called from init_display. | ||
| 1857 | |||
| 1858 | We need a glyph matrix because redraw will happen soon. | ||
| 1859 | Unfortunately, window sizes on selected_frame are not yet set to | ||
| 1860 | meaningful values. I believe we can assume that there are only two | ||
| 1861 | windows on the frame---the mini-buffer and the root window. Frame | ||
| 1862 | height and width seem to be correct so far. So, set the sizes of | ||
| 1863 | windows to estimated values. */ | ||
| 1864 | |||
| 1865 | static void | ||
| 1866 | adjust_frame_glyphs_initially (void) | ||
| 1867 | { | ||
| 1868 | struct frame *sf = SELECTED_FRAME (); | ||
| 1869 | struct window *root = XWINDOW (sf->root_window); | ||
| 1870 | struct window *mini = XWINDOW (root->next); | ||
| 1871 | int frame_lines = FRAME_LINES (sf); | ||
| 1872 | int frame_cols = FRAME_COLS (sf); | ||
| 1873 | int top_margin = FRAME_TOP_MARGIN (sf); | ||
| 1874 | |||
| 1875 | /* Do it for the root window. */ | ||
| 1876 | wset_top_line (root, make_number (top_margin)); | ||
| 1877 | wset_total_lines (root, make_number (frame_lines - 1 - top_margin)); | ||
| 1878 | wset_total_cols (root, make_number (frame_cols)); | ||
| 1879 | |||
| 1880 | /* Do it for the mini-buffer window. */ | ||
| 1881 | wset_top_line (mini, make_number (frame_lines - 1)); | ||
| 1882 | wset_total_lines (mini, make_number (1)); | ||
| 1883 | wset_total_cols (mini, make_number (frame_cols)); | ||
| 1884 | |||
| 1885 | adjust_frame_glyphs (sf); | ||
| 1886 | glyphs_initialized_initially_p = 1; | ||
| 1887 | } | ||
| 1888 | |||
| 1889 | |||
| 1890 | /* Allocate/reallocate glyph matrices of a single frame F. */ | 1849 | /* Allocate/reallocate glyph matrices of a single frame F. */ |
| 1891 | 1850 | ||
| 1892 | static void | 1851 | static void |
| @@ -3071,19 +3030,13 @@ window_to_frame_hpos (struct window *w, int hpos) | |||
| 3071 | Redrawing Frames | 3030 | Redrawing Frames |
| 3072 | **********************************************************************/ | 3031 | **********************************************************************/ |
| 3073 | 3032 | ||
| 3074 | DEFUN ("redraw-frame", Fredraw_frame, Sredraw_frame, 0, 1, 0, | 3033 | /* Redraw frame F. */ |
| 3075 | doc: /* Clear frame FRAME and output again what is supposed to appear on it. | ||
| 3076 | If FRAME is omitted or nil, the selected frame is used. */) | ||
| 3077 | (Lisp_Object frame) | ||
| 3078 | { | ||
| 3079 | struct frame *f = decode_live_frame (frame); | ||
| 3080 | |||
| 3081 | /* Ignore redraw requests, if frame has no glyphs yet. | ||
| 3082 | (Implementation note: It still has to be checked why we are | ||
| 3083 | called so early here). */ | ||
| 3084 | if (!glyphs_initialized_initially_p) | ||
| 3085 | return Qnil; | ||
| 3086 | 3034 | ||
| 3035 | void | ||
| 3036 | redraw_frame (struct frame *f) | ||
| 3037 | { | ||
| 3038 | /* Error if F has no glyphs. */ | ||
| 3039 | eassert (f->glyphs_initialized_p); | ||
| 3087 | update_begin (f); | 3040 | update_begin (f); |
| 3088 | #ifdef MSDOS | 3041 | #ifdef MSDOS |
| 3089 | if (FRAME_MSDOS_P (f)) | 3042 | if (FRAME_MSDOS_P (f)) |
| @@ -3100,22 +3053,17 @@ If FRAME is omitted or nil, the selected frame is used. */) | |||
| 3100 | mark_window_display_accurate (FRAME_ROOT_WINDOW (f), 0); | 3053 | mark_window_display_accurate (FRAME_ROOT_WINDOW (f), 0); |
| 3101 | set_window_update_flags (XWINDOW (FRAME_ROOT_WINDOW (f)), 1); | 3054 | set_window_update_flags (XWINDOW (FRAME_ROOT_WINDOW (f)), 1); |
| 3102 | f->garbaged = 0; | 3055 | f->garbaged = 0; |
| 3103 | return Qnil; | ||
| 3104 | } | 3056 | } |
| 3105 | 3057 | ||
| 3106 | 3058 | DEFUN ("redraw-frame", Fredraw_frame, Sredraw_frame, 0, 1, 0, | |
| 3107 | /* Redraw frame F. This is nothing more than a call to the Lisp | 3059 | doc: /* Clear frame FRAME and output again what is supposed to appear on it. |
| 3108 | function redraw-frame. */ | 3060 | If FRAME is omitted or nil, the selected frame is used. */) |
| 3109 | 3061 | (Lisp_Object frame) | |
| 3110 | void | ||
| 3111 | redraw_frame (struct frame *f) | ||
| 3112 | { | 3062 | { |
| 3113 | Lisp_Object frame; | 3063 | redraw_frame (decode_live_frame (frame)); |
| 3114 | XSETFRAME (frame, f); | 3064 | return Qnil; |
| 3115 | Fredraw_frame (frame); | ||
| 3116 | } | 3065 | } |
| 3117 | 3066 | ||
| 3118 | |||
| 3119 | DEFUN ("redraw-display", Fredraw_display, Sredraw_display, 0, 0, "", | 3067 | DEFUN ("redraw-display", Fredraw_display, Sredraw_display, 0, 0, "", |
| 3120 | doc: /* Clear and redisplay all visible frames. */) | 3068 | doc: /* Clear and redisplay all visible frames. */) |
| 3121 | (void) | 3069 | (void) |
| @@ -3124,7 +3072,7 @@ DEFUN ("redraw-display", Fredraw_display, Sredraw_display, 0, 0, "", | |||
| 3124 | 3072 | ||
| 3125 | FOR_EACH_FRAME (tail, frame) | 3073 | FOR_EACH_FRAME (tail, frame) |
| 3126 | if (FRAME_VISIBLE_P (XFRAME (frame))) | 3074 | if (FRAME_VISIBLE_P (XFRAME (frame))) |
| 3127 | Fredraw_frame (frame); | 3075 | redraw_frame (XFRAME (frame)); |
| 3128 | 3076 | ||
| 3129 | return Qnil; | 3077 | return Qnil; |
| 3130 | } | 3078 | } |
| @@ -6208,7 +6156,6 @@ init_display (void) | |||
| 6208 | So call tgetent. */ | 6156 | So call tgetent. */ |
| 6209 | { char b[2044]; tgetent (b, "xterm");} | 6157 | { char b[2044]; tgetent (b, "xterm");} |
| 6210 | #endif | 6158 | #endif |
| 6211 | adjust_frame_glyphs_initially (); | ||
| 6212 | return; | 6159 | return; |
| 6213 | } | 6160 | } |
| 6214 | #endif /* HAVE_X_WINDOWS */ | 6161 | #endif /* HAVE_X_WINDOWS */ |
| @@ -6218,7 +6165,6 @@ init_display (void) | |||
| 6218 | { | 6165 | { |
| 6219 | Vinitial_window_system = Qw32; | 6166 | Vinitial_window_system = Qw32; |
| 6220 | Vwindow_system_version = make_number (1); | 6167 | Vwindow_system_version = make_number (1); |
| 6221 | adjust_frame_glyphs_initially (); | ||
| 6222 | return; | 6168 | return; |
| 6223 | } | 6169 | } |
| 6224 | #endif /* HAVE_NTGUI */ | 6170 | #endif /* HAVE_NTGUI */ |
| @@ -6232,7 +6178,6 @@ init_display (void) | |||
| 6232 | { | 6178 | { |
| 6233 | Vinitial_window_system = Qns; | 6179 | Vinitial_window_system = Qns; |
| 6234 | Vwindow_system_version = make_number (10); | 6180 | Vwindow_system_version = make_number (10); |
| 6235 | adjust_frame_glyphs_initially (); | ||
| 6236 | return; | 6181 | return; |
| 6237 | } | 6182 | } |
| 6238 | #endif | 6183 | #endif |
| @@ -6322,7 +6267,6 @@ init_display (void) | |||
| 6322 | fatal ("screen size %dx%d too big", width, height); | 6267 | fatal ("screen size %dx%d too big", width, height); |
| 6323 | } | 6268 | } |
| 6324 | 6269 | ||
| 6325 | adjust_frame_glyphs_initially (); | ||
| 6326 | calculate_costs (XFRAME (selected_frame)); | 6270 | calculate_costs (XFRAME (selected_frame)); |
| 6327 | 6271 | ||
| 6328 | /* Set up faces of the initial terminal frame of a dumped Emacs. */ | 6272 | /* Set up faces of the initial terminal frame of a dumped Emacs. */ |
diff --git a/src/xdisp.c b/src/xdisp.c index 12d7b89291c..a74628db392 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -10769,7 +10769,7 @@ clear_garbaged_frames (void) | |||
| 10769 | { | 10769 | { |
| 10770 | if (f->resized_p) | 10770 | if (f->resized_p) |
| 10771 | { | 10771 | { |
| 10772 | Fredraw_frame (frame); | 10772 | redraw_frame (f); |
| 10773 | f->force_flush_display_p = 1; | 10773 | f->force_flush_display_p = 1; |
| 10774 | } | 10774 | } |
| 10775 | clear_current_matrices (f); | 10775 | clear_current_matrices (f); |