From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#57266: Maintaining the base_line_number cache Date: Mon, 22 Aug 2022 19:21:43 +0300 Message-ID: <83edx89rl4.fsf@gnu.org> References: <831qteccli.fsf@gnu.org> <834jy4bhqp.fsf@gnu.org> <83y1vga0l5.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22496"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 57266@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 22 20:22:34 2022 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 1oQC4H-0005fb-9D for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 22 Aug 2022 20:22:33 +0200 Original-Received: from localhost ([::1]:33438 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQC4G-000586-0f for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 22 Aug 2022 14:22:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39146) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQABe-0006v7-DB for bug-gnu-emacs@gnu.org; Mon, 22 Aug 2022 12:22:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51840) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQABe-0001VX-34 for bug-gnu-emacs@gnu.org; Mon, 22 Aug 2022 12:22:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oQABd-0003NW-Vs for bug-gnu-emacs@gnu.org; Mon, 22 Aug 2022 12:22:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 22 Aug 2022 16:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57266 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 57266-submit@debbugs.gnu.org id=B57266.166118530812967 (code B ref 57266); Mon, 22 Aug 2022 16:22:01 +0000 Original-Received: (at 57266) by debbugs.gnu.org; 22 Aug 2022 16:21:48 +0000 Original-Received: from localhost ([127.0.0.1]:41589 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQABP-0003N5-UZ for submit@debbugs.gnu.org; Mon, 22 Aug 2022 12:21:48 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:44830) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQABO-0003Ms-7b for 57266@debbugs.gnu.org; Mon, 22 Aug 2022 12:21:46 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:56138) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQABI-0001Rt-6K; Mon, 22 Aug 2022 12:21:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Jjbz/rE7ic6c8rWa8UmFa29dC/h7MbFkNTl/uTnYhmo=; b=D9UyOCCTpKqD v8hMrtY9Usb0CnIb6R5pTmBnc12saW0nlWyH6mhofGM2Z6xuf1KNkKHPV9Kk++wsf4ccMPHH2wrqJ w7CcYjyfyGAA1Ivg5txym8ktxS9foLtANckzdeKwuD+OoUFzOEza8g0T99DA/rYelDK47uTjbo/uq yVxytt+tlDh5Oqx0OcR3L70WLsOa3vndexC4VVG4Xlybi5L8lwWF6LRWcg1CeXnY8+yZoMA64OAvj tGERZ2ccLyuligKe/vcSaLs5bGhyhhIbr55D1O0P3e1Ot0eR/ZbMXu2eOw99CdNhlFl/0upH26l5y mg+V7WWCvKBSqJs3w7V8RA==; Original-Received: from [87.69.77.57] (port=1124 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQABH-0003Mk-4i; Mon, 22 Aug 2022 12:21:39 -0400 In-Reply-To: (message from Stefan Monnier on Mon, 22 Aug 2022 09:32:50 -0400) 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" Xref: news.gmane.io gmane.emacs.bugs:240448 Archived-At: > From: Stefan Monnier > Cc: 57266@debbugs.gnu.org > Date: Mon, 22 Aug 2022 09:32:50 -0400 > > >> > I didn't just mean just_this_one_p thingy, I meant all the changes > >> > that attempt to somehow "clean up" the use of the line-number cache. > >> > Why do we have to do that at all? This stuff is not too complex, and > >> > it works for ages! Isn't the fact that we find more and more small > >> > issues with the changes telling you something? > >> > >> Yes, it's telling me that the code is a mess and I'm trying to fix it by > >> documenting what is actually needed. > > > > It's fine to fix and enhance the documentation, but please don't fix > > the code that works. > > If the code doesn't match the doc, then we'll never know if the doc > is wrong. Which is why I'm perfectly OK with documenting what the code does. I'm also OK with adding a single function that makes the tests for invalidating the cache, and then calling that function everywhere where we now do such tests, not all of them identical. And in that function we can document everything we know about the cases where the cache should be invalidated. But please leave the tests themselves where they are done now, I see no special reason to move them. Because nothing is really wrong, except the one case you found (and which we should fix, I agree). Please! I hope my requests mean something, given that I'm the only one who works on bugs in these areas, and probably will keep doing that for the observable future.