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#56682: locked narrowing Date: Wed, 17 Aug 2022 21:33:40 +0300 Message-ID: <83czcyd8jf.fsf@gnu.org> References: <83edxgfi75.fsf@gnu.org> <5e3c3081-f098-8140-c767-b895c32bf30b@yandex.ru> <835yisffil.fsf@gnu.org> <831qtgff78.fsf@gnu.org> <83zgg4dw4y.fsf@gnu.org> <83r11gdrr4.fsf@gnu.org> <83edxfds7s.fsf@gnu.org> <83r11fc80o.fsf@gnu.org> <83o7wjc6o2.fsf@gnu.org> <83lernc5gu.fsf@gnu.org> <83k076dd7d.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5893"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 56682@debbugs.gnu.org, gregory@heytings.org, dgutov@yandex.ru To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 17 20:34:35 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 1oONsA-0001Kf-S1 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 17 Aug 2022 20:34:35 +0200 Original-Received: from localhost ([::1]:60962 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oONs9-00049A-Di for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 17 Aug 2022 14:34:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56030) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oONrf-00046U-2U for bug-gnu-emacs@gnu.org; Wed, 17 Aug 2022 14:34:09 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35061) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oONre-0005In-Fu for bug-gnu-emacs@gnu.org; Wed, 17 Aug 2022 14:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oONre-0001pF-CE for bug-gnu-emacs@gnu.org; Wed, 17 Aug 2022 14:34:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 Aug 2022 18:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56682 X-GNU-PR-Package: emacs Original-Received: via spool by 56682-submit@debbugs.gnu.org id=B56682.16607612367006 (code B ref 56682); Wed, 17 Aug 2022 18:34:02 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 17 Aug 2022 18:33:56 +0000 Original-Received: from localhost ([127.0.0.1]:53043 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oONrY-0001ov-1z for submit@debbugs.gnu.org; Wed, 17 Aug 2022 14:33:56 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:46660) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oONrW-0001oi-B2 for 56682@debbugs.gnu.org; Wed, 17 Aug 2022 14:33:54 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:50570) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oONrR-0005HS-3H; Wed, 17 Aug 2022 14:33:49 -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=7X/p1BQDQAFskvdYK1uZSV8W5k5THkH9snSY5caiTTQ=; b=WVtWnYUKXJrE EpOECQ13m7dtLmUj74Q4XHqu2jTNj5CmyBD0Riy6SKVhM2d5eW+AYTPyLYkkqGxXl5aY3rKPGynBh Mo/XjxQcycoRHjmzvZTwz9sBal6Qt2hR6YBBscbGwyp0+DB5m4zmQ7ZM6w81JE916gJsiK4KG8Dg9 fIb0XZOTOo3Hh2GN64dGZVgEXyteMcjeeuS8fzJ5Zw57zpYnVajoX6SvHOqSjm4ZwbfIUczZQak4H oiAi9R28i+MgyHwabzASAlEaSdW1osKQFrwt0pqtveMh90jYdawKjFHqo7k8pZAcTA6jU3DL/5Osc DLcqlDidwo1GIRKVUuBOXQ==; Original-Received: from [87.69.77.57] (port=1941 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 1oONrQ-0002IJ-Hp; Wed, 17 Aug 2022 14:33:48 -0400 In-Reply-To: (message from Stefan Monnier on Wed, 17 Aug 2022 13:58:21 -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:240103 Archived-At: > From: Stefan Monnier > Cc: dgutov@yandex.ru, 56682@debbugs.gnu.org, gregory@heytings.org > Date: Wed, 17 Aug 2022 13:58:21 -0400 > > [ BTW, apparently when `display_line_numbers_widen` is in use and the > buffer is narrowed, we don't use that cache at all for > `maybe_produce_line_number` (according to xdisp.c:24217). IOW that > cache always counts from BEGV, so we also need to check that BEGV is > still the same as when the cache was filled. I also can't see in > `decode_mode_spec` where we check that the narrowing has changed > before using the cached value. All in all, I just don't understand > how that cache is maintained. ] Search in xdisp.c for "->base_line_number = 0", and you will see that we invalidate the cache when the narrowing changes or when other similar calamities happen.