Chong Yidong wrote:
[EMAIL PROTECTED] (Kim F. Storm) writes:IIRC, the original problem I tried to solve is shown by this test-case: (progn (switch-to-buffer (get-buffer-create "*test*")) (erase-buffer) (insert ".\n<\n.\n>\n") (goto-char (point-min)) (let ((ov (make-overlay 4 7))) (overlay-put ov 'display "Ax\nyB")) (goto-char (point-max))) With my change, moving the cursor places it on the 'A'. Without my change, moving the cursor places it on the 'y'. So my change may be incorrect - but it _does_ solve a real problem.OK, now I see the problem. I believe the underlying fault is not in cursor_row_p, but in set_cursor_from_row, on xdisp.c:11948: pos = string_buffer_position (w, string, string_before_pos); /* If STRING is from overlay, LAST_POS == 0. We skip such glyphs because we always put cursor after overlay strings. */ while (pos == 0 && glyph < stop) { string = glyph->object; The assumption made in the comment is not correct: string_buffer_position returns non-zero values for overlay strings with the `display' property. In xdisp.c:4446: prop = Fget_char_property (pos, Qdisplay, Qnil); if (!NILP (prop) && display_prop_string_p (prop, string)) found = 1; This suggests that the way to fix this is to changestring_buffer_position to do what that says.
I tested with !display_prop_string_p at the two places in string_buffer_position where it occurs. That does the correct thing in my case, but not in Kim's example AFAICS.
In Kim's example the cursor stops after the 'display part when moving char by char from left or right. It stays on that position for an extra left or right arrow.
Checking if the string is from 'display at the correct position in set_cursor_from_row could perhaps cure the problem. There is a test now for Qdisplay, but it looks like this test might be disabled by the while loop right above it which skips all overlays.
However, it is dangerous to change string_buffer_position right now, because it's called from several places in xdisp.c. Changing its behavior runs a serious risk of introducing subtle bugs.
Maybe. They are either in set_cursor_from_row or note_mouse_highlight. _______________________________________________ emacs-pretest-bug mailing list [EMAIL PROTECTED] http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
