From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#25246: 25.1.90; Buffer not responsible with overlay at buffer end. Date: Fri, 23 Dec 2016 13:08:57 +0200 Message-ID: <83r34yzyuu.fsf@gnu.org> References: <20161222091305.GC5148@seven> <83bmw328uy.fsf@gnu.org> <87wpera4y3.fsf@users.sourceforge.net> <20161223073315.GD5148@seven> <83tw9vypab.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1482491423 15953 195.159.176.226 (23 Dec 2016 11:10:23 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 23 Dec 2016 11:10:23 +0000 (UTC) Cc: 25246@debbugs.gnu.org, npostavs@users.sourceforge.net To: stefan.hahn@s-hahn.de Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 23 12:10:19 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cKNjt-0003DY-DD for geb-bug-gnu-emacs@m.gmane.org; Fri, 23 Dec 2016 12:10:17 +0100 Original-Received: from localhost ([::1]:38535 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cKNju-0004Rn-Me for geb-bug-gnu-emacs@m.gmane.org; Fri, 23 Dec 2016 06:10:18 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42695) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cKNjk-0004NP-0D for bug-gnu-emacs@gnu.org; Fri, 23 Dec 2016 06:10:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cKNje-0000aF-Ct for bug-gnu-emacs@gnu.org; Fri, 23 Dec 2016 06:10:08 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36696) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cKNje-0000aB-9v for bug-gnu-emacs@gnu.org; Fri, 23 Dec 2016 06:10:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cKNje-0001fl-53 for bug-gnu-emacs@gnu.org; Fri, 23 Dec 2016 06:10:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 23 Dec 2016 11:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25246 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 25246-submit@debbugs.gnu.org id=B25246.14824913816397 (code B ref 25246); Fri, 23 Dec 2016 11:10:02 +0000 Original-Received: (at 25246) by debbugs.gnu.org; 23 Dec 2016 11:09:41 +0000 Original-Received: from localhost ([127.0.0.1]:52095 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cKNjJ-0001f6-2Q for submit@debbugs.gnu.org; Fri, 23 Dec 2016 06:09:41 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:51496) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cKNjH-0001eu-Tf for 25246@debbugs.gnu.org; Fri, 23 Dec 2016 06:09:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cKNj9-0000Bo-CH for 25246@debbugs.gnu.org; Fri, 23 Dec 2016 06:09:34 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:51875) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cKNiy-00006a-CU; Fri, 23 Dec 2016 06:09:20 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1964 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cKNix-0007dK-Kj; Fri, 23 Dec 2016 06:09:20 -0500 In-reply-to: <83tw9vypab.fsf@gnu.org> (message from Eli Zaretskii on Fri, 23 Dec 2016 11:21:00 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:127358 Archived-At: > Date: Fri, 23 Dec 2016 11:21:00 +0200 > From: Eli Zaretskii > 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. */