all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: stefan.hahn@s-hahn.de
Cc: 25246@debbugs.gnu.org, npostavs@users.sourceforge.net
Subject: bug#25246: 25.1.90; Buffer not responsible with overlay at buffer end.
Date: Fri, 23 Dec 2016 13:08:57 +0200	[thread overview]
Message-ID: <83r34yzyuu.fsf@gnu.org> (raw)
In-Reply-To: <83tw9vypab.fsf@gnu.org> (message from Eli Zaretskii on Fri, 23 Dec 2016 11:21:00 +0200)

> Date: Fri, 23 Dec 2016 11:21:00 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: 25246@debbugs.gnu.org, npostavs@users.sourceforge.net
> 
> I will look into this soon.  One thing I already saw: this is a very
> old problem, I see it in Emacs 22.1.

If the change below, when applied to the master branch, gives good
results, I will install it.

The results as I see after this change are not ideal (you cannot see
the entire overlay string, unless you manually hscroll the window with
"C-x >", and the cursor at EOB is not visible).  But at least the loop
is avoided, AFAICT, and there's only one "blink" of incorrect display.
Is this satisfactory enough to install this simple change?

Thanks.

diff --git a/src/xdisp.c b/src/xdisp.c
index ad0b968..37ca81d 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -13049,6 +13049,17 @@ hscroll_window_tree (Lisp_Object window)
 	      init_to_row_start (&it, w, cursor_row);
 	      it.last_visible_x = INFINITY;
 	      move_it_in_display_line_to (&it, pt, -1, MOVE_TO_POS);
+	      /* If the line ends in an overlay string with a newline,
+		 we might infloop, because displaying the window will
+		 want to put the cursor after the overlay, i.e. at X
+		 coordinate of zero on the next screen line.  So we
+		 use the buffer position prior to the overlay string
+		 instead.  */
+	      if (it.method == GET_FROM_STRING && pt > 1)
+		{
+		  init_to_row_start (&it, w, cursor_row);
+		  move_it_in_display_line_to (&it, pt - 1, -1, MOVE_TO_POS);
+		}
 	      current_buffer = saved_current_buffer;
 
 	      /* Position cursor in window.  */





  reply	other threads:[~2016-12-23 11:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-22  9:13 bug#25246: 25.1.90; Buffer not responsible with overlay at buffer end Stefan-W. Hahn
2016-12-22 13:55 ` npostavs
2016-12-22 17:04 ` Eli Zaretskii
2016-12-23  0:01   ` npostavs
2016-12-23  7:33     ` Stefan-W. Hahn
2016-12-23  9:21       ` Eli Zaretskii
2016-12-23 11:08         ` Eli Zaretskii [this message]
2016-12-23 13:36           ` Stefan-W. Hahn
2016-12-23 13:53             ` npostavs
2016-12-23 14:16               ` Stefan-W. Hahn
2016-12-23 13:57             ` Eli Zaretskii
2016-12-23 14:14               ` npostavs
2016-12-23 14:19                 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83r34yzyuu.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=25246@debbugs.gnu.org \
    --cc=npostavs@users.sourceforge.net \
    --cc=stefan.hahn@s-hahn.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.