diff options
| author | Glenn Morris | 2014-06-14 17:06:30 -0700 |
|---|---|---|
| committer | Glenn Morris | 2014-06-14 17:06:30 -0700 |
| commit | 90de50e27049ae19492dd9843e50618ea4ed5d14 (patch) | |
| tree | 1efdf48fb6243e3f8448465c59dda3eb9db67a0c /src | |
| parent | 799d2f3d87185a51835d0594a89485932d0f4c23 (diff) | |
| parent | 27433ff85f21f108e84a6e8966c9461cf66c2015 (diff) | |
| download | emacs-90de50e27049ae19492dd9843e50618ea4ed5d14.tar.gz emacs-90de50e27049ae19492dd9843e50618ea4ed5d14.zip | |
Merge from emacs-24; up to 2014-06-03T06:51:18Z!eliz@gnu.org
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 10 | ||||
| -rw-r--r-- | src/alloc.c | 13 | ||||
| -rw-r--r-- | src/xdisp.c | 68 |
3 files changed, 85 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 5fc04c10f59..1bb96989b60 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2014-06-15 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * xdisp.c (Fmove_point_visually): Don't use the glyph matrix | ||
| 4 | information if we are in the middle of executing a keyboard macro, | ||
| 5 | since redisplay doesn't update the screen until the macro is | ||
| 6 | finished. (Bug#17777) | ||
| 7 | |||
| 8 | * alloc.c (cleanup_vector): Don't dereference a font driver | ||
| 9 | pointer if it is NULL. (Bug#17771) | ||
| 10 | |||
| 1 | 2014-06-13 Glenn Morris <rgm@gnu.org> | 11 | 2014-06-13 Glenn Morris <rgm@gnu.org> |
| 2 | 12 | ||
| 3 | * Makefile.in ($(leimdir)/leim-list.el, $(srcdir)/macuvs.h) | 13 | * Makefile.in ($(leimdir)/leim-list.el, $(srcdir)/macuvs.h) |
diff --git a/src/alloc.c b/src/alloc.c index e5116acaefd..e2213db853d 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -2974,9 +2974,16 @@ cleanup_vector (struct Lisp_Vector *vector) | |||
| 2974 | && ((vector->header.size & PSEUDOVECTOR_SIZE_MASK) | 2974 | && ((vector->header.size & PSEUDOVECTOR_SIZE_MASK) |
| 2975 | == FONT_OBJECT_MAX)) | 2975 | == FONT_OBJECT_MAX)) |
| 2976 | { | 2976 | { |
| 2977 | /* Attempt to catch subtle bugs like Bug#16140. */ | 2977 | struct font_driver *drv = ((struct font *) vector)->driver; |
| 2978 | eassert (valid_font_driver (((struct font *) vector)->driver)); | 2978 | |
| 2979 | ((struct font *) vector)->driver->close ((struct font *) vector); | 2979 | /* The font driver might sometimes be NULL, e.g. if Emacs was |
| 2980 | interrupted before it had time to set it up. */ | ||
| 2981 | if (drv) | ||
| 2982 | { | ||
| 2983 | /* Attempt to catch subtle bugs like Bug#16140. */ | ||
| 2984 | eassert (valid_font_driver (drv)); | ||
| 2985 | drv->close ((struct font *) vector); | ||
| 2986 | } | ||
| 2980 | } | 2987 | } |
| 2981 | } | 2988 | } |
| 2982 | 2989 | ||
diff --git a/src/xdisp.c b/src/xdisp.c index 54a8c8beb8f..d7368c7c0c4 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -98,7 +98,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 98 | 98 | ||
| 99 | This function attempts to redisplay a window by reusing parts of | 99 | This function attempts to redisplay a window by reusing parts of |
| 100 | its existing display. It finds and reuses the part that was not | 100 | its existing display. It finds and reuses the part that was not |
| 101 | changed, and redraws the rest. | 101 | changed, and redraws the rest. (The "id" part in the function's |
| 102 | name stands for "insert/delete", not for "identification" or | ||
| 103 | somesuch.) | ||
| 102 | 104 | ||
| 103 | . try_window | 105 | . try_window |
| 104 | 106 | ||
| @@ -113,6 +115,19 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 113 | optimizations were successful, redisplay calls redisplay_windows, | 115 | optimizations were successful, redisplay calls redisplay_windows, |
| 114 | which performs a full redisplay of all windows. | 116 | which performs a full redisplay of all windows. |
| 115 | 117 | ||
| 118 | Note that there's one more important optimization up Emacs's | ||
| 119 | sleeve, but it is related to actually redrawing the potentially | ||
| 120 | changed portions of the window/frame, not to reproducing the | ||
| 121 | desired matrices of those potentially changed portions. Namely, | ||
| 122 | the function update_frame and its subroutines, which you will find | ||
| 123 | in dispnew.c, compare the desired matrices with the current | ||
| 124 | matrices, and only redraw the portions that changed. So it could | ||
| 125 | happen that the functions in this file for some reason decide that | ||
| 126 | the entire desired matrix needs to be regenerated from scratch, and | ||
| 127 | still only parts of the Emacs display, or even nothing at all, will | ||
| 128 | be actually delivered to the glass, because update_frame has found | ||
| 129 | that the new and the old screen contents are similar or identical. | ||
| 130 | |||
| 116 | Desired matrices. | 131 | Desired matrices. |
| 117 | 132 | ||
| 118 | Desired matrices are always built per Emacs window. The function | 133 | Desired matrices are always built per Emacs window. The function |
| @@ -15746,7 +15761,51 @@ set_vertical_scroll_bar (struct window *w) | |||
| 15746 | selected_window is redisplayed. | 15761 | selected_window is redisplayed. |
| 15747 | 15762 | ||
| 15748 | We can return without actually redisplaying the window if fonts has been | 15763 | We can return without actually redisplaying the window if fonts has been |
| 15749 | changed on window's frame. In that case, redisplay_internal will retry. */ | 15764 | changed on window's frame. In that case, redisplay_internal will retry. |
| 15765 | |||
| 15766 | As one of the important parts of redisplaying a window, we need to | ||
| 15767 | decide whether the previous window-start position (stored in the | ||
| 15768 | window's w->start marker position) is still valid, and if it isn't, | ||
| 15769 | recompute it. Some details about that: | ||
| 15770 | |||
| 15771 | . The previous window-start could be in a continuation line, in | ||
| 15772 | which case we need to recompute it when the window width | ||
| 15773 | changes. See compute_window_start_on_continuation_line and its | ||
| 15774 | call below. | ||
| 15775 | |||
| 15776 | . The text that changed since last redisplay could include the | ||
| 15777 | previous window-start position. In that case, we try to salvage | ||
| 15778 | what we can from the current glyph matrix by calling | ||
| 15779 | try_scrolling, which see. | ||
| 15780 | |||
| 15781 | . Some Emacs command could force us to use a specific window-start | ||
| 15782 | position by setting the window's force_start flag, or gently | ||
| 15783 | propose doing that by setting the window's optional_new_start | ||
| 15784 | flag. In these cases, we try using the specified start point if | ||
| 15785 | that succeeds (i.e. the window desired matrix is successfully | ||
| 15786 | recomputed, and point location is within the window). In case | ||
| 15787 | of optional_new_start, we first check if the specified start | ||
| 15788 | position is feasible, i.e. if it will allow point to be | ||
| 15789 | displayed in the window. If using the specified start point | ||
| 15790 | fails, e.g., if new fonts are needed to be loaded, we abort the | ||
| 15791 | redisplay cycle and leave it up to the next cycle to figure out | ||
| 15792 | things. | ||
| 15793 | |||
| 15794 | . Note that the window's force_start flag is sometimes set by | ||
| 15795 | redisplay itself, when it decides that the previous window start | ||
| 15796 | point is fine and should be kept. Search for "goto force_start" | ||
| 15797 | below to see the details. Like the values of window-start | ||
| 15798 | specified outside of redisply, these internally deduced values | ||
| 15799 | are tested for feasibility, and ignored if found to be | ||
| 15800 | unfeasible. | ||
| 15801 | |||
| 15802 | . Note that the function try_window, used to completely redisplay | ||
| 15803 | a window, accepts the window's start point as its argument. | ||
| 15804 | This is used several times in the redisplay code to control | ||
| 15805 | where the window start will be, according to user options such | ||
| 15806 | as scroll-conservatively, and also to ensure the screen line | ||
| 15807 | showing point will be fully (as opposed to partially) visible on | ||
| 15808 | display. */ | ||
| 15750 | 15809 | ||
| 15751 | static void | 15810 | static void |
| 15752 | redisplay_window (Lisp_Object window, bool just_this_one_p) | 15811 | redisplay_window (Lisp_Object window, bool just_this_one_p) |
| @@ -15792,6 +15851,8 @@ redisplay_window (Lisp_Object window, bool just_this_one_p) | |||
| 15792 | eassert (XMARKER (w->start)->buffer == buffer); | 15851 | eassert (XMARKER (w->start)->buffer == buffer); |
| 15793 | eassert (XMARKER (w->pointm)->buffer == buffer); | 15852 | eassert (XMARKER (w->pointm)->buffer == buffer); |
| 15794 | 15853 | ||
| 15854 | /* We come here again if we need to run window-text-change-functions | ||
| 15855 | below. */ | ||
| 15795 | restart: | 15856 | restart: |
| 15796 | reconsider_clip_changes (w); | 15857 | reconsider_clip_changes (w); |
| 15797 | frame_line_height = default_line_pixel_height (w); | 15858 | frame_line_height = default_line_pixel_height (w); |
| @@ -15856,7 +15917,7 @@ redisplay_window (Lisp_Object window, bool just_this_one_p) | |||
| 15856 | && !current_buffer->prevent_redisplay_optimizations_p | 15917 | && !current_buffer->prevent_redisplay_optimizations_p |
| 15857 | && !window_outdated (w)); | 15918 | && !window_outdated (w)); |
| 15858 | 15919 | ||
| 15859 | /* Run the window-bottom-change-functions | 15920 | /* Run the window-text-change-functions |
| 15860 | if it is possible that the text on the screen has changed | 15921 | if it is possible that the text on the screen has changed |
| 15861 | (either due to modification of the text, or any other reason). */ | 15922 | (either due to modification of the text, or any other reason). */ |
| 15862 | if (!current_matrix_up_to_date_p | 15923 | if (!current_matrix_up_to_date_p |
| @@ -20685,6 +20746,7 @@ Value is the new character position of point. */) | |||
| 20685 | recorded in the glyphs, at least as long as the goal is on the | 20746 | recorded in the glyphs, at least as long as the goal is on the |
| 20686 | screen. */ | 20747 | screen. */ |
| 20687 | if (w->window_end_valid | 20748 | if (w->window_end_valid |
| 20749 | && NILP (Vexecuting_kbd_macro) | ||
| 20688 | && !windows_or_buffers_changed | 20750 | && !windows_or_buffers_changed |
| 20689 | && b | 20751 | && b |
| 20690 | && !b->clip_changed | 20752 | && !b->clip_changed |