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: Sun, 09 Oct 2016 08:29:51 -0400 Message-ID: <87lgxxvh6o.fsf@users.sourceforge.net> References: <87vax5vuoj.fsf@users.sourceforge.net> <834m4nhz1t.fsf@gnu.org> <874m4mwyj2.fsf@users.sourceforge.net> <837f9ihg8l.fsf@gnu.org> <87y41yved9.fsf@users.sourceforge.net> <83y41yfwam.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1476016227 12929 195.159.176.226 (9 Oct 2016 12:30:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 9 Oct 2016 12:30:27 +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 Sun Oct 09 14:30: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 1btDFA-0001yg-Pv for geb-bug-gnu-emacs@m.gmane.org; Sun, 09 Oct 2016 14:30:17 +0200 Original-Received: from localhost ([::1]:44347 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btDF9-0007Ok-66 for geb-bug-gnu-emacs@m.gmane.org; Sun, 09 Oct 2016 08:30:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38434) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btDF2-0007Lx-47 for bug-gnu-emacs@gnu.org; Sun, 09 Oct 2016 08:30:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1btDEw-00082v-O8 for bug-gnu-emacs@gnu.org; Sun, 09 Oct 2016 08:30:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:43204) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btDEw-00082m-Kb for bug-gnu-emacs@gnu.org; Sun, 09 Oct 2016 08:30:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1btDEw-0007Lf-A4 for bug-gnu-emacs@gnu.org; Sun, 09 Oct 2016 08:30: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: Sun, 09 Oct 2016 12:30: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.147601616528182 (code B ref 24633); Sun, 09 Oct 2016 12:30:02 +0000 Original-Received: (at 24633) by debbugs.gnu.org; 9 Oct 2016 12:29:25 +0000 Original-Received: from localhost ([127.0.0.1]:49394 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1btDEL-0007KU-9W for submit@debbugs.gnu.org; Sun, 09 Oct 2016 08:29:25 -0400 Original-Received: from mail-io0-f174.google.com ([209.85.223.174]:32845) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1btDEJ-0007KH-0g for 24633@debbugs.gnu.org; Sun, 09 Oct 2016 08:29:23 -0400 Original-Received: by mail-io0-f174.google.com with SMTP id q192so87329627iod.0 for <24633@debbugs.gnu.org>; Sun, 09 Oct 2016 05:29:22 -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=SZC1+2H+LmQimN20nAWBB3f//V1IY9Sbt/g6O2+srn0=; b=xvp3dyA/z2nReXH9f3G0pnd29VXPw3KQiQ5NCM1op7ZX+1GEsZ0fd/sxtsFoT3We0m UTQ9nJiYIDeexvIEmu8YAqTtyysHF5ygZEIbNJIbCpxFTO0+tT53lkuWBaWxfalXMfDv I0bYw0DFXssnx3QrYQRpm/3dflrAoUbPgny4UqnG1aQUFiPNGRHSSuPgdlgS6zymmp4n Ys8nk1+PYoPuJr0YI8btqUvfPNXyZWJ3NL7W3bAU981EQqO/DHDsUVoxihJo828/3km6 FPUoy15uF6+6Qgyg6Us5/dJM9SQYMsY0nsJjuduBy0hmSnH/Hcq5X94IyKzQG0rJCnHU P+bQ== 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=SZC1+2H+LmQimN20nAWBB3f//V1IY9Sbt/g6O2+srn0=; b=cOafgunbtjNrhMM7LqiVoy0RAJc9X1PJHs12wkq49L7utTCQYNYrf4ycQGe+VRHJJ+ MbgWnOZiAA/2RELDkwhczlqwCHFe1hjFy1+aJ8xbnmJ78SilDbnZz4GBT6pJZGNJQVXw QfpulPwU5TlCBzUv6HL59a7gtZ14BJMt357XsM7wl9moF57Yg7onlbuQJXiyWruU4w/R ypjGcEGTulspYwlhrCXn8D1JvU4oUJnCvmGKV02GNrc91p5KAGW7Y4smkaH0YcgZeI5t LHcruZ7i5CReNbkKuLugJL0purT3PXNYWZWhsNOT2exEzapKXXYHoKCDkGjrs3Z2CJ07 DGYw== X-Gm-Message-State: AA6/9RkBqmpSt8F9ia54KJ6skghy8RZjznkAQEfkT5nAv8X19PKBtjmO64Ssz/HGf06Gjw== X-Received: by 10.107.53.166 with SMTP id k38mr4505378ioo.74.1476016157086; Sun, 09 Oct 2016 05:29:17 -0700 (PDT) Original-Received: from zony ([45.2.7.130]) by smtp.googlemail.com with ESMTPSA id e6sm4990284ite.2.2016.10.09.05.29.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Oct 2016 05:29:16 -0700 (PDT) In-Reply-To: <83y41yfwam.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 08 Oct 2016 22:57:53 +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:124267 Archived-At: Eli Zaretskii writes: >> 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? Hmm, it's not quite the effect I was going for, but actually maybe it isn't that bad. > 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. Anyway, it doesn't seem worth going through this complexity. I just wonder if there is some way to stop bad lisp code from triggering a hard lockup. Can the display engine notice if it's looping and throw some kind of error? Maybe unset pre-redisplay-functions? > >> >> > 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. The grammar in the doc seems complete to me. Although using "fraction of" to mean "gets multiplied by" is perhaps a bit unintuitive.