From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ben Levy via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#22763: 25.1.50; Feature Request -- A faster method to obtain line number at position. Date: Thu, 20 May 2021 19:53:24 +0000 Message-ID: <1TyanmjF6SBvziMpm9jWhwA0kDQ9iG5jzO7S0dTBDQjNe1sc7te_PrVSR1_pGXPFgQzlDEX2Nq5NK-wJiHQyCDhemaevOVf527K_I1jGvIw=@protonmail.com> References: Reply-To: Ben Levy Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1667"; mail-complaints-to="usenet@ciao.gmane.io" To: "22763@debbugs.gnu.org" <22763@debbugs.gnu.org> Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 20 21:54:13 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ljokF-0000Ec-TI for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 20 May 2021 21:54:11 +0200 Original-Received: from localhost ([::1]:51458 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljokE-0006xQ-Sm for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 20 May 2021 15:54:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54548) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljok6-0006t3-QM for bug-gnu-emacs@gnu.org; Thu, 20 May 2021 15:54:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51938) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ljok6-0001zL-IR for bug-gnu-emacs@gnu.org; Thu, 20 May 2021 15:54:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ljok6-0001xA-Gh for bug-gnu-emacs@gnu.org; Thu, 20 May 2021 15:54:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Ben Levy Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 20 May 2021 19:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22763 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed Original-Received: via spool by 22763-submit@debbugs.gnu.org id=B22763.16215404227477 (code B ref 22763); Thu, 20 May 2021 19:54:02 +0000 Original-Received: (at 22763) by debbugs.gnu.org; 20 May 2021 19:53:42 +0000 Original-Received: from localhost ([127.0.0.1]:35251 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ljojl-0001wX-TT for submit@debbugs.gnu.org; Thu, 20 May 2021 15:53:42 -0400 Original-Received: from mail-40140.protonmail.ch ([185.70.40.140]:17038) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ljojh-0001wF-9R for 22763@debbugs.gnu.org; Thu, 20 May 2021 15:53:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1621540410; bh=y+kd6Gg/FJqy54i/6W92Yq8+j4rzquIxwYHRk2fSNM0=; h=Date:To:From:Reply-To:Subject:From; b=dMRcZn4GelExJqzRAX/HFZ0LiVN6eXerqbf7cpSFabSgnufcTU1xheADZsR49a3kF Pe8zW9hCet31RLvuhDDs3947xFFWa7Fn2T1iOWjWZSX0O3jW9LAaChlr3XqlMzJtt9 YYdRriAtJk4dyHecI0XhCwyQZAgeG+864NZ7mCU8= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" X-ACL-Warn: , Ben Levy Xref: news.gmane.io gmane.emacs.bugs:206960 Archived-At: I'm not 100% sure about this, but it looks like when line-number-at-pos was written in elisp, it didn't do any bounds check, and instead called (widen) before counting lines. Did the elisp version have unintended behavior, or are the differences with the C version a regression? I think it's causing this bug: https://github.com/io12/good-scroll.el/issues/16