From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#13446: 24.2; Fix loop test in linum.el Date: Sun, 27 Oct 2013 00:20:01 -0400 Message-ID: References: <87y5fvp7ti.fsf@nbtrap.com> <874n85cqxj.fsf@nbtrap.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1382847676 14848 80.91.229.3 (27 Oct 2013 04:21:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 27 Oct 2013 04:21:16 +0000 (UTC) Cc: 13446@debbugs.gnu.org To: Nathan Trapuzzano Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Oct 27 05:21:19 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VaHqn-0002sj-Hm for geb-bug-gnu-emacs@m.gmane.org; Sun, 27 Oct 2013 05:21:17 +0100 Original-Received: from localhost ([::1]:36621 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VaHqn-0007kI-4T for geb-bug-gnu-emacs@m.gmane.org; Sun, 27 Oct 2013 00:21:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43822) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VaHqe-0007k7-FT for bug-gnu-emacs@gnu.org; Sun, 27 Oct 2013 00:21:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VaHqY-0001nr-8g for bug-gnu-emacs@gnu.org; Sun, 27 Oct 2013 00:21:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:32841) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VaHqY-0001nn-5P for bug-gnu-emacs@gnu.org; Sun, 27 Oct 2013 00:21:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VaHqX-0002zV-Lt for bug-gnu-emacs@gnu.org; Sun, 27 Oct 2013 00:21:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 Oct 2013 04:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13446 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 13446-submit@debbugs.gnu.org id=B13446.138284761211426 (code B ref 13446); Sun, 27 Oct 2013 04:21:01 +0000 Original-Received: (at 13446) by debbugs.gnu.org; 27 Oct 2013 04:20:12 +0000 Original-Received: from localhost ([127.0.0.1]:46860 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VaHpi-0002yB-Rt for submit@debbugs.gnu.org; Sun, 27 Oct 2013 00:20:11 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:48438) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VaHpf-0002xj-W5 for 13446@debbugs.gnu.org; Sun, 27 Oct 2013 00:20:08 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFLd/hu/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYSFBgNJBOICwbBLY0ag3ADpHqBXoMTgUs X-IPAS-Result: Av4EABK/CFFLd/hu/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYSFBgNJBOICwbBLY0ag3ADpHqBXoMTgUs X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="36440838" Original-Received: from 75-119-248-110.dsl.teksavvy.com (HELO pastel.home) ([75.119.248.110]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 27 Oct 2013 00:20:01 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 97C8E60038; Sun, 27 Oct 2013 00:20:01 -0400 (EDT) In-Reply-To: <874n85cqxj.fsf@nbtrap.com> (Nathan Trapuzzano's message of "Fri, 25 Oct 2013 11:26:32 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:79685 Archived-At: > Any reason why this hasn't been accepted? On my end, it's mostly for lack of time. But having just looked at it, I can't see what the problem is about really. I mean, your patch looks fine, but it's not clear what it's fixing. I've read your explanation, but I think it's too subtle to explain with only text. I just installed your patch into trunk, since it looks sane. But I'd be interested to hear a concrete description of the problematic behavior this bug could introduce. Stefan > Nathan Trapuzzano writes: >> There is an incorrect loop test in linum.el that potentially applies an >> overlay to a line not visible in the window and thereby messes up the >> width of the overlays in the lines that are visible. The patch/merge >> directive is attached, and what follows is the commit message: >> >> ----- >> >> Modify loop test in `linum-update-window'. >> >> `limit' is set to the position returned by `window-end'; this position >> is either on the last visible (logical) line in the buffer or is the >> first position on the line following the last visible line. In the >> former case, the loop variable never reaches the value of `limit', but >> in the latter case, an overlay is applied to a line that is not >> visible in the window. This can mess up the width of the overlay on >> the visible lines, especially if the width of the line number (as a >> string) of the line that's not visible is different from the width of >> the visible lines' line numbers. >> # Bazaar merge directive format 2 (Bazaar 0.90) >> # revision_id: nbtrap@nbtrap.com-20130115010121-h7kwjyr5kimowgml >> # target_branch: . >> # testament_sha1: a9154d3ede2b389220646bb8e9e708117d876d01 >> # timestamp: 2013-01-14 20:03:26 -0500 >> # base_revision_id: nbtrap@nbtrap.com-20130111013646-pn4xh5r94x5asomb >> # >> # Begin patch >> === modified file 'lisp/linum.el' >> --- lisp/linum.el 2012-01-19 07:21:25 +0000 >> +++ lisp/linum.el 2013-01-15 00:45:27 +0000 >> @@ -151,7 +151,7 @@ >> (run-hooks 'linum-before-numbering-hook) >> ;; Create an overlay (or reuse an existing one) for each >> ;; line visible in this window, if necessary. >> - (while (and (not (eobp)) (<= (point) limit)) >> + (while (and (not (eobp)) (< (point) limit)) >> (let* ((str (if fmt >> (propertize (format fmt line) 'face 'linum) >> (funcall linum-format line))) >> >> # Begin bundle >> IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWdjgvvgAABJfgAAQQGFxUBIA >> AACv794QIABkRTaajamQyGjTaRiFGgBMBBkwQhDmaVnH5r9hMFQyJ7EUzThiw4Ixc/mQVpexbPS2 >> 9yLLTxaFbWvXcN2zcydOQxpD652acQC4g4Z96jI5BipgKAAiM5Zz45Kd/4u5IpwoSGxwX3wA