From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net 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 15:18:26 -0400 Message-ID: <87y41yved9.fsf@users.sourceforge.net> References: <87vax5vuoj.fsf@users.sourceforge.net> <834m4nhz1t.fsf@gnu.org> <874m4mwyj2.fsf@users.sourceforge.net> <837f9ihg8l.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1475954306 18933 195.159.176.226 (8 Oct 2016 19:18:26 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 8 Oct 2016 19:18:26 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: 24633@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 08 21:18:22 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 1bsx8W-0004KC-Vl for geb-bug-gnu-emacs@m.gmane.org; Sat, 08 Oct 2016 21:18:21 +0200 Original-Received: from localhost ([::1]:42125 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsx8V-0007sO-K1 for geb-bug-gnu-emacs@m.gmane.org; Sat, 08 Oct 2016 15:18:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40440) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsx8K-0007s4-Hw for bug-gnu-emacs@gnu.org; Sat, 08 Oct 2016 15:18:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bsx8E-0006Vb-T8 for bug-gnu-emacs@gnu.org; Sat, 08 Oct 2016 15:18:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42823) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsx8E-0006VR-Pn for bug-gnu-emacs@gnu.org; Sat, 08 Oct 2016 15:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bsx8E-0002iz-Cx for bug-gnu-emacs@gnu.org; Sat, 08 Oct 2016 15:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Oct 2016 19:18: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.147595427910464 (code B ref 24633); Sat, 08 Oct 2016 19:18:02 +0000 Original-Received: (at 24633) by debbugs.gnu.org; 8 Oct 2016 19:17:59 +0000 Original-Received: from localhost ([127.0.0.1]:49013 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bsx8B-0002ii-46 for submit@debbugs.gnu.org; Sat, 08 Oct 2016 15:17:59 -0400 Original-Received: from mail-it0-f51.google.com ([209.85.214.51]:38518) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bsx89-0002iP-GS for 24633@debbugs.gnu.org; Sat, 08 Oct 2016 15:17:57 -0400 Original-Received: by mail-it0-f51.google.com with SMTP id o19so45973634ito.1 for <24633@debbugs.gnu.org>; Sat, 08 Oct 2016 12:17:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=p5UtYbwPmYVq41m/aXA9UeF7G2TBFQZQ3/155Clt0sw=; b=vIzT5y0HA4AznXVu+4wwbUJy6Le1LbTc1RkLWIs+7bjk1gCVN8qkqLjssTXlr/Foe0 /sEqIYViPP5O7EoZQHURFCOjuTmSJl3GvRw437FeR1EFev+j9E+kYsd+E4n7GwY1Fgy5 maEPdIqSxoXQ5RVgk9R7AR3azg61FBpS4cOKnVnB6a2asgnysM03SmEAco/He695Dr4F CKo+uaW3BXOq5s7i1baLRUoD6cebcZdaVMtqGiK9BMSySeFqW8INne7PCpocjd+v5NNe hu12NOmWboYvWQhl++lobYmGlNDAOplYbgQem25wf4HaO7TwqPELn9JwWSlmQxmco+z3 op2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=p5UtYbwPmYVq41m/aXA9UeF7G2TBFQZQ3/155Clt0sw=; b=MD2sYKVWxn0YjbH+sQo9N/CPCXoDmJ6xtcvu3u0hPcwaYru82nsTz85marp6xdaEcP ZcB/JM0V7B0pZ0QoPECv3xq3axAv7C88xHfax4QQ7EMbA58mrEu+LScP/mEJl94Hu1HK EhT0c5c6IeIugT38Cn057TBsaJ33uuOhexTo+jCmuKOPtQamI3lFyZaRlZPCUmQ2w8Mz 0VorFXv5Qy3WSzG9m2xx71MPj0oj54p33ReDbCpxKsfBYznVa37B9oH1hn7EYlsJeEi+ xNQn4XIpVrcqrsf1Bvw8fb3KsLGU8GkkakgS5o98pzrO171luaMfDFk0Q/qwKZtxc3Nk m7oA== X-Gm-Message-State: AA6/9Rk2h9V6sne8Mww8QAdKAZj2ka2jxHJW+mYbVfn8qRcYBEKkFN9ybROhSvcQIXIroQ== X-Received: by 10.36.242.196 with SMTP id j187mr3967512ith.102.1475954271954; Sat, 08 Oct 2016 12:17:51 -0700 (PDT) Original-Received: from zony ([45.2.7.130]) by smtp.googlemail.com with ESMTPSA id i75sm3547328itf.22.2016.10.08.12.17.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 08 Oct 2016 12:17:51 -0700 (PDT) In-Reply-To: <837f9ihg8l.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 08 Oct 2016 21:01:46 +0300") 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:124242 Archived-At: Eli Zaretskii writes: >> From: npostavs@users.sourceforge.net >> Cc: 24633@debbugs.gnu.org >> Date: Sat, 08 Oct 2016 13:17:37 -0400 >> >> The high-level idea is to have a line from going from the left to the >> right edge of the window. Most of the line is composed of an overlay >> specifying the :underline text property. The last bit of it, from the >> end of the text to the right edge of the screen, is created by an >> underlined after-string space which uses :align-to to reach the right >> edge of the screen. >> >> Using :align-to 'right or :align-to `((,(window-body-width nil t))) does >> not account for horizontal scrolling (i.e., the line ends at 80 columns, >> even when the 80th column is scrolled to the left). So I tried >> >> `(+ ,(window-hscroll) (0 . right)) >> `(+ ,(window-hscroll) (,(window-body-width nil t))) ; initially this >> >> to make up for it, which turns out to cause this strange looping. > > 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. 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. If you think this would be too complex/slow to implement, we can mark this bug as wontfix. > >> > 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?