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#24633: highlight-region func using (window-hscroll) in :align-to spec can cause inf loop Date: Sat, 08 Oct 2016 22:57:53 +0300 Message-ID: <83y41yfwam.fsf@gnu.org> References: <87vax5vuoj.fsf@users.sourceforge.net> <834m4nhz1t.fsf@gnu.org> <874m4mwyj2.fsf@users.sourceforge.net> <837f9ihg8l.fsf@gnu.org> <87y41yved9.fsf@users.sourceforge.net> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1475956776 9526 195.159.176.226 (8 Oct 2016 19:59:36 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 8 Oct 2016 19:59:36 +0000 (UTC) Cc: 24633@debbugs.gnu.org To: npostavs@users.sourceforge.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 08 21:59:32 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 1bsxm6-0007su-Pn for geb-bug-gnu-emacs@m.gmane.org; Sat, 08 Oct 2016 21:59:14 +0200 Original-Received: from localhost ([::1]:42218 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsxm5-0004o1-EG for geb-bug-gnu-emacs@m.gmane.org; Sat, 08 Oct 2016 15:59:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47225) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsxly-0004nt-Fq for bug-gnu-emacs@gnu.org; Sat, 08 Oct 2016 15:59:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bsxlu-0002GX-Br for bug-gnu-emacs@gnu.org; Sat, 08 Oct 2016 15:59:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42871) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsxlu-0002GR-8Q for bug-gnu-emacs@gnu.org; Sat, 08 Oct 2016 15:59:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bsxlu-0003lL-2v for bug-gnu-emacs@gnu.org; Sat, 08 Oct 2016 15:59:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Oct 2016 19:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24633 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24633-submit@debbugs.gnu.org id=B24633.147595668914395 (code B ref 24633); Sat, 08 Oct 2016 19:59:02 +0000 Original-Received: (at 24633) by debbugs.gnu.org; 8 Oct 2016 19:58:09 +0000 Original-Received: from localhost ([127.0.0.1]:49061 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bsxl2-0003k7-NP for submit@debbugs.gnu.org; Sat, 08 Oct 2016 15:58:08 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56185) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bsxl1-0003jr-D1 for 24633@debbugs.gnu.org; Sat, 08 Oct 2016 15:58:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bsxks-0001qx-UX for 24633@debbugs.gnu.org; Sat, 08 Oct 2016 15:58:02 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:51284) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsxks-0001qf-R3; Sat, 08 Oct 2016 15:57:58 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3257 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bsxkp-0004lD-MC; Sat, 08 Oct 2016 15:57:57 -0400 In-reply-to: <87y41yved9.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net) 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:124248 Archived-At: > From: npostavs@users.sourceforge.net > Cc: 24633@debbugs.gnu.org > Date: Sat, 08 Oct 2016 15:18:26 -0400 > > > Automatic hscrolling is based on length of point's line at the end of > > redisplaying a window. Here, "line length" means the horizontal space > > required for displaying all the glyphs of the line, which includes the > > glyphs that come from the after-string. Since you extend your > > after-string each time the window is hscrolled, you in effect enlarge > > the line each time the display engine hscrolls the window, which > > causes an endless loop. > > > > Can you restrict the after-string's length so it always ends at the > > last character of the line, or some fixed number of columns afterward? > > Then it won't reach the edge of the screen when the buffer is scrolled. Yes, but is it so bad? > I guess what I would expect is that the automatic hscrolling only goes > as far as the cursor is rendered, which should be the end of text where > I put the `cursor' property. The implementation doesn't actually use the cursor position (it can't: by the time hscroll_windows runs the cursor is not yet in its final horizontal position, only its vertical position is correct, because the horizontal scrolling was not yet done). The implementation uses a function that simulates redisplay, and that one doesn't pay attention to the 'cursor' property. So it stops only when the after-string is exhausted. > If you think this would be too complex/slow to implement, we can > mark this bug as wontfix. It'd be messy, yes. We'd need to search for before- and after-strings that begin/end right at point, then augment the call to the display emulating function accordingly, deal with complications like strings that include newlines, etc. > >> > In particular, I don't > >> > understand the align-to expression: e.g., window-hscroll returns its > >> > value in columns, while align-to needs pixels, AFAIU. > >> > >> According to `(elisp) Pixel Specification', > >> > >> The form NUM specifies a fraction of the default frame font height > >> or width. The form `(NUM)' specifies an absolute number of pixels. > > > > I admire your courage in reading that documentation and then writing > > stuff like the above, which the documentation doesn't mention even > > remotely. > > Uh, not sure how to read this, is it irony? Only a little. I find this area severely under-documented.