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 13:17:37 -0400 Message-ID: <874m4mwyj2.fsf@users.sourceforge.net> References: <87vax5vuoj.fsf@users.sourceforge.net> <834m4nhz1t.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1475947123 29090 195.159.176.226 (8 Oct 2016 17:18:43 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 8 Oct 2016 17:18:43 +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 19:18:39 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 1bsvGJ-00042U-Mr for geb-bug-gnu-emacs@m.gmane.org; Sat, 08 Oct 2016 19:18:15 +0200 Original-Received: from localhost ([::1]:41869 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsvGI-0000ps-Ah for geb-bug-gnu-emacs@m.gmane.org; Sat, 08 Oct 2016 13:18:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51117) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsvGA-0000pW-L0 for bug-gnu-emacs@gnu.org; Sat, 08 Oct 2016 13:18:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bsvG6-0004kY-Ay for bug-gnu-emacs@gnu.org; Sat, 08 Oct 2016 13:18:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42740) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsvG6-0004kQ-6t for bug-gnu-emacs@gnu.org; Sat, 08 Oct 2016 13:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bsvG5-0008AL-TX for bug-gnu-emacs@gnu.org; Sat, 08 Oct 2016 13:18:01 -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 17:18:01 +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.147594703031317 (code B ref 24633); Sat, 08 Oct 2016 17:18:01 +0000 Original-Received: (at 24633) by debbugs.gnu.org; 8 Oct 2016 17:17:10 +0000 Original-Received: from localhost ([127.0.0.1]:48930 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bsvFG-000893-FV for submit@debbugs.gnu.org; Sat, 08 Oct 2016 13:17:10 -0400 Original-Received: from mail-io0-f171.google.com ([209.85.223.171]:32889) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bsvFE-00088q-Ne for 24633@debbugs.gnu.org; Sat, 08 Oct 2016 13:17:09 -0400 Original-Received: by mail-io0-f171.google.com with SMTP id q192so75253423iod.0 for <24633@debbugs.gnu.org>; Sat, 08 Oct 2016 10:17:08 -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=yOUxC5OG6xTVyymBb8JYvbg75MqqtU4hdxBcWOpfdVc=; b=FknG12MIu5avTkcVUa/CXKLVy9BYMreVszSaGMW3wyTwm9fUQaHgeHBV79tV9ouZZd mRjPpIBluCEuoeG+ghJvt54cMmC7sj5vvvjpeEFEUeJTtpoDGLGW2v5E+tMQ4WZZZ6xi icqSfJnX8LP0uqxVuwr3xtchBcKc44T6ORbP/BjmTRbPQeyhGkb3d57VbVegQrSe/WR5 5nAfm5dbbU53KnGw+z6tUlpEAiV7poMBAVCsIo0pJ8rpTDlPopx5wRsMvtFYYwxk+PS5 7GkvjJ2MxJBbgJj8HjVpg3FPq8ASVZdP4dkh44y2aimgshMks2oiDRrF2nQKhqh2EupA ipgw== 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=yOUxC5OG6xTVyymBb8JYvbg75MqqtU4hdxBcWOpfdVc=; b=PF0QpGfXcoeOmt/OE1oKz0KRB1bmqo1QY8wg5kWeT+sq+wBPIu5OKhS0L/KABpxAag HdGBa1IYxPrh3FFKeeqVSKDDAoDTWEmW6hN8FSmdS84lBrdvWM75DW5CIHgIST9MAgmm lLkUM9J65qwLjN9Z0cWKoMI+3yM0G0KGAnSvBHAtSyIliMe2PaHU9VhntrFlnYXejSCk MQbtMaGFxjDFolgrUHVlAIj7DAUZTLNdQ9PcY/q+Hk48ujIKXEKsM0b09+uN0k7Cj7j+ uCYmd30vPhC9NAQGHYDFojH12fMIhxm5tOkPDrnTvh+NofyCVb5lOs6v5Egmccm1y2dM 27+w== X-Gm-Message-State: AA6/9RnTpwUzu0AgvF2290Ce3PfLUFS/b3dxDC1PPNS5M5Q6QzxmaHthbi4+sQ3TZ5iacA== X-Received: by 10.107.29.75 with SMTP id d72mr7236054iod.82.1475947023223; Sat, 08 Oct 2016 10:17:03 -0700 (PDT) Original-Received: from zony ([45.2.7.130]) by smtp.googlemail.com with ESMTPSA id g65sm9825609ioj.24.2016.10.08.10.17.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 08 Oct 2016 10:17:02 -0700 (PDT) In-Reply-To: <834m4nhz1t.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 08 Oct 2016 14:15:26 +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:124229 Archived-At: Eli Zaretskii writes: > > Can you explain what do you expect this to do, and how/why? It's hard > to reverse-engineer this to glean the intent. 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. > 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 interpreted "fraction of the default frame font" to mean that the result of window-hscroll would be multiplied by the font width (it's a plain number outside a list). I tried now also `(+ (,(window-hscroll) . width) (0 . right)), which gives the same result. The `width' and `height' units correspond to the default width and height of the current face. [...] A value of the form `(NUM . EXPR)' stands for the product of the values of NUM and EXPR. By the way, I also tried `(+ (,(window-hscroll) . width) (,(window-body-width nil t))) which again gives the same result. > > What I see in the debugger is that the display engine loops > indefinitely, each time increasing the window's hscroll by 4 columns. > IOW, the redisplay cycle never stops. > > Thanks.