GNU bug report logs - #59618
29.0.50; global-whitespace-mode + org-capture: "Marker does not point anywhere"

Previous Next

Package: emacs;

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):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 59618 <at> debbugs.gnu.org, yantar92 <at> posteo.net, arsen <at> aarsen.me,
 stefankangas <at> gmail.com, Richard Hansen <rhansen <at> rhansen.org>
Subject: Re: bug#59618: 29.0.50; global-whitespace-mode + org-capture:
 "Marker does not point anywhere"
Date: Wed, 14 Dec 2022 09:15:23 -0500
>> >> 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.