all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 59618@debbugs.gnu.org, yantar92@posteo.net, arsen@aarsen.me,
	stefankangas@gmail.com, Richard Hansen <rhansen@rhansen.org>
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	[thread overview]
Message-ID: <jwvwn6u6pog.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <83bko6nq4l.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 14 Dec 2022 14:09:30 +0200")

>> >> 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	other threads:[~2022-12-14 14:15 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-26 14:42 bug#59618: 29.0.50; global-whitespace-mode + org-capture: "Marker does not point anywhere" Arsen Arsenović via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-26 19:58 ` Eli Zaretskii
2022-11-26 20:11   ` Arsen Arsenović via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-27  0:27   ` Ihor Radchenko
2022-11-27  6:13     ` Stefan Kangas
2022-11-27  6:20       ` Ihor Radchenko
2022-11-27  6:54         ` Stefan Kangas
2022-12-01 12:06           ` Eli Zaretskii
2022-12-01 15:02             ` Stefan Kangas
2022-12-13  6:25             ` Richard Hansen
2022-12-13  6:34               ` Ihor Radchenko
2022-12-13  6:38                 ` Richard Hansen
2022-12-13  6:48                   ` Ihor Radchenko
2022-12-14  2:42                     ` Richard Hansen
2022-12-14 12:09                       ` Eli Zaretskii
2022-12-14 14:15                         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-12-14 15:08                           ` Ihor Radchenko
2022-12-14 17:40                             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-14 17:48                               ` Ihor Radchenko
2022-12-14 20:10                                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-18  9:24                                   ` bug#59618: [PATCH] " Richard Hansen
2022-12-20  0:41                                     ` bug#59618: [PATCH] " Richard Hansen
2022-12-20 13:52                                       ` Eli Zaretskii
2022-12-21 13:34                                         ` Ihor Radchenko
2022-12-21 14:03                                           ` Eli Zaretskii
2022-11-27  0:28   ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvwn6u6pog.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=59618@debbugs.gnu.org \
    --cc=arsen@aarsen.me \
    --cc=eliz@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=rhansen@rhansen.org \
    --cc=stefankangas@gmail.com \
    --cc=yantar92@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.