GNU bug report logs - #60333
[PATCH] whitespace: Update bob, eob markers in base and indirect buffers

Previous Next

Package: emacs;

Reported by: Richard Hansen <rhansen <at> rhansen.org>

Date: Mon, 26 Dec 2022 06:22:02 UTC

Severity: normal

Tags: patch

Full log


Message #50 received at 60333 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 60333 <at> debbugs.gnu.org, yantar92 <at> posteo.net,
 Richard Hansen <rhansen <at> rhansen.org>
Subject: Re: bug#60333: [PATCH] whitespace: Update bob, eob markers in base
 and indirect buffers
Date: Thu, 12 Jan 2023 11:21:00 -0500
>> 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





This bug report was last modified 2 years and 215 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.