GNU bug report logs -
#59618
29.0.50; global-whitespace-mode + org-capture: "Marker does not point anywhere"
Previous Next
Reported by: Arsen Arsenović <arsen <at> aarsen.me>
Date: Sat, 26 Nov 2022 19:54:02 UTC
Severity: normal
Tags: patch
Found in version 29.0.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #53 received at 59618 <at> debbugs.gnu.org (full text, mbox):
>> >> 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
This bug report was last modified 2 years and 189 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.