From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#60333: [PATCH] whitespace: Update bob, eob markers in base and indirect buffers Date: Thu, 12 Jan 2023 11:21:00 -0500 Message-ID: References: <87k02dz75f.fsf@localhost> <87358zprk1.fsf@localhost> <45afa067-f63d-e013-a547-ea4ef0c27935@rhansen.org> <83fscgksh0.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31430"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 60333@debbugs.gnu.org, yantar92@posteo.net, Richard Hansen To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 12 17:22:44 2023 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 1pG0Li-0007R3-Vy for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 12 Jan 2023 17:22:43 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pG0L6-00052V-CY; Thu, 12 Jan 2023 11:22:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pG0L4-00051k-6U for bug-gnu-emacs@gnu.org; Thu, 12 Jan 2023 11:22:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pG0L3-0005wX-TR for bug-gnu-emacs@gnu.org; Thu, 12 Jan 2023 11:22:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pG0L3-0000ay-K9 for bug-gnu-emacs@gnu.org; Thu, 12 Jan 2023 11:22:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 12 Jan 2023 16:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60333 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 60333-submit@debbugs.gnu.org id=B60333.16735404712217 (code B ref 60333); Thu, 12 Jan 2023 16:22:01 +0000 Original-Received: (at 60333) by debbugs.gnu.org; 12 Jan 2023 16:21:11 +0000 Original-Received: from localhost ([127.0.0.1]:48431 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pG0KF-0000Zh-BT for submit@debbugs.gnu.org; Thu, 12 Jan 2023 11:21:11 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:13933) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pG0KD-0000ZU-CL for 60333@debbugs.gnu.org; Thu, 12 Jan 2023 11:21:09 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id E540C44161A; Thu, 12 Jan 2023 11:21:03 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 34E7E44160A; Thu, 12 Jan 2023 11:21:02 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1673540462; bh=z/QOAESQJDbQVdM1DpzPpdT1Cd/2tWg658AaP8ju3FU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Qp4NzGENj9s5F94N6nSACwhRQTYsXes/1VHIVOMfuFn0DOs5mpWM+94FtTB+02/jM m0tyr9xZZBvM2KMhZ94D1oVHo6kKQzia3fT96k7h88HM2Q7zPO7n3xgArvhLlM53Go uh/tgPHiSO3wacjAItUGERDOYC/Y65gDyCXFKMCYIDmCgKbAtA/Q83OYpHi6eYinDH DV5SZiuOfVi3d4dHKMeG9XJuoaPJed15E6Vi3PPapic7v4z0N8q+AnJYYJIZVxdvIq oi79eBDYREbm28xYyLbDbar4s0BL9+NCNnGkG0z5amqKri3TQgX0nEKWe5mpHR1XQ3 qRH7mcQUzfGWA== Original-Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id D40A012017B; Thu, 12 Jan 2023 11:21:01 -0500 (EST) In-Reply-To: <83fscgksh0.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 12 Jan 2023 11:33:15 +0200") 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:253233 Archived-At: >> Other options I can see: >> >> #1: Apply this patch as-is, keep Org as-is, and live with the code >> duplication. >> #2: Reject this patch and keep Org as-is. >> #3: Advise `make-indirect-buffer'. The advice would record new >> indirect buffers and add a `kill-buffer-hook' function to clean up the >> entry. (Note, however, that `make-indirect-buffer' is a primitive >> function.) >> #4: Fix Bug#46982. (One possible approach that maintains backwards >> compatibility: Teach `after-change-functions' to look for a symbol >> property that means "run me not just for changes made in this buffer, >> but also if a change is made in this buffer's base/indirect buffer".) > > And this. I think the saner way is to rename `make-indirect-buffer` to `internal-make-indirect-buffer` and then define `make-indirect-buffer` on top of it in ELisp where we make it register extra info about the various indirect buffers, register a hook function on `before/after-change-functions` which runs the hooks of the other buffers sharing the same text, ... Fixing the problem just for whitespace.el seems pointless because it's just one particular spot in a wide area of brokenness: all features that rely on `after/before-change-functions` are broken one way or another in the presence of edits in indirect buffers. That's clearly outside the scope of `emacs-29`, tho. Stefan