Subject: Re: bug#20410: 24.5.50; cursor not updated after yank of non-ASCII string from the clipboard

From: YAMAMOTO Mitsuharu <[email-masked]>
Date: Fri, 24 Apr 2015 13:09:29 +0900

>>>>> On Thu, 23 Apr 2015 13:42:40 +0300, Eli Zaretskii <[email-masked]> said:

>> Date: Thu, 23 Apr 2015 18:59:45 +0900
>> From: YAMAMOTO Mitsuharu <[email-masked]>
>> 
>> 1. Copy some non-ASCII string (say, "あ") to the clipboard.
>> 2. $ emacs -Q -D &
>> 3. C-x C-b
>> 4. C-y
>> 5. C-p
>> 
>> Expected Result:
>> 
>> The cursor moves upward by Step 5.
>> 
>> Actual Result:
>> 
>> The display is not changed between Step 4 and 5.

> What does "C-x =" report before and after step 5?

It says

  Char: C-j (10, #o12, #xa) point=191 of 192 (99%) column=0

So, the cursor is actually moved internally, but display is not
updated accordingly.

> Anyway, this seems to be X-specific: I cannot reproduce it on
> MS-Windows.

It turned out Step 3 above was not necessary.

I also tried git bisect, and it shows:

bd0443bb8799b908cefd0b11c86db6115180850d is the first bad commit
commit bd0443bb8799b908cefd0b11c86db6115180850d
Author: Dmitry Antipov <[email-masked]>
Date:   Fri Sep 6 11:00:29 2013 +0400

    Attempt to make redisplay more selective when changing fonts.
    * frame.h (struct frame): New bitfield fonts_changed.
    * dispextern.h (fonts_changed_p, adjust_glyphs): Remove declaration.
    (adjust_frame_glyphs): Add prototype.
    * dispnew.c (fonts_changed_p): Remove.
    (adjust_glyphs): Remove becase we do not
    adjust matrices on all frames at once any more.
    (adjust_frame_glyphs): Block and unblock input here.
    (adjust_glyph_matrix): Use fonts_changed.
    (change_frame_size_1): Use adjust_frame_glyphs.
    * font.c (font_open_entity): Use fonts_changed.
    * frame.c (set_menu_bar_lines, Fmake_terminal_frame):
    * w32fns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_show_tip):
    * window.c (Fdelete_other_windows_internal, Fwindow_resize_apply)
    (Fsplit_window_internal, Fdelete_window_internal, grow_mini_window)
    (shrink_mini_window, Fresize_mini_window_internal)
    (window_scroll_pixel_based, Fset_window_configuration)
    (apply_window_adjustment, Fset_window_vscroll):
    * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_show_tip):
    Use adjust_frame_glyphs.
    * xdisp.c (redisplay_tool_bar, redisplay_window, try_window)
    (try_window_reusing_current_matrix, try_window_id, display_line)
    (IT_EXPAND_MATRIX_WIDTH): Use fonts_changed.
    (redisplay_internal): Consider fonts_changed and adjust frame
    matrices for each frame only if the frame is visible.  If font
    has been changed on some frame during full redisplay, retry
    only visible frames where the font has been actually changed.

				     YAMAMOTO Mitsuharu
				[email-masked]