bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#59618: 29.0.50; global-whitespace-mode + org-capture: "Marker does n


From: Stefan Monnier
Subject: bug#59618: 29.0.50; global-whitespace-mode + org-capture: "Marker does not point anywhere"
Date: Wed, 14 Dec 2022 09:15:23 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

>> >> Sounds like setting CLONE to t does not clone markers.  That sounds like
>> >> a bug in `make-indirect-buffer', no?
>> > 
>> > AFAIK, it does clone markers. Also changing marker buffer appropriately.
>> 
>> Hmm, maybe not.  The following fails:
>> 
>> emacs -Q
>> 
>> (progn
>>    (whitespace-mode 1)
>>    (with-current-buffer (clone-indirect-buffer "foo" nil)
>>      (cl-assert (eq (current-buffer)
>>                     (marker-buffer whitespace-bob-marker)))))

the buffer cloning code can't know that a given marker is stored in a variable.
So when it clones the variables, both buffers's `whitespace-bob-marker`
variable will point to the same marker.

While we could try and solve it for this specific case by looking for
buffer-local variables that contains markers, the problem is much more
general (think of the case where the buffer var contains a list of
markers, or a hash-table containing markers, or ...), so `clone-buffer`
does not try to solve it.

Instead modes that use such variables are responsable to setup
a `clone-buffer-hook` that does the necessary work.


        Stefan






reply via email to

[Prev in Thread] Current Thread [Next in Thread]