From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs 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 Message-ID: References: <86pmd969ps.fsf@aarsen.me> <83tu2lqyi6.fsf@gnu.org> <874juljl6h.fsf@localhost> <87k03gj4uw.fsf@localhost> <837czbib0k.fsf@gnu.org> <87a63rg6b2.fsf@localhost> <877cyvg5nw.fsf@localhost> <1d41780a-5b2f-caed-4bd6-6b7ecd1fef58@rhansen.org> <83bko6nq4l.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24371"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 59618@debbugs.gnu.org, yantar92@posteo.net, arsen@aarsen.me, stefankangas@gmail.com, Richard Hansen To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 14 15:20:40 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p5Sch-0006Bo-IC for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 14 Dec 2022 15:20:39 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p5SYF-00040c-Lv; Wed, 14 Dec 2022 09:16:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p5SYE-0003yG-6N for bug-gnu-emacs@gnu.org; Wed, 14 Dec 2022 09:16:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p5SYD-0007aV-UM for bug-gnu-emacs@gnu.org; Wed, 14 Dec 2022 09:16:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p5SYD-00017A-Pl for bug-gnu-emacs@gnu.org; Wed, 14 Dec 2022 09:16:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Dec 2022 14:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59618 X-GNU-PR-Package: emacs Original-Received: via spool by 59618-submit@debbugs.gnu.org id=B59618.16710273364269 (code B ref 59618); Wed, 14 Dec 2022 14:16:01 +0000 Original-Received: (at 59618) by debbugs.gnu.org; 14 Dec 2022 14:15:36 +0000 Original-Received: from localhost ([127.0.0.1]:39507 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5SXo-00016n-By for submit@debbugs.gnu.org; Wed, 14 Dec 2022 09:15:36 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:64917) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p5SXk-00016f-Of for 59618@debbugs.gnu.org; Wed, 14 Dec 2022 09:15:34 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id C4403440A9D; Wed, 14 Dec 2022 09:15:26 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 465E1440989; Wed, 14 Dec 2022 09:15:25 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1671027325; bh=cmwHDGWC1gcVf5GoxOWbzyJYPdKpAzSz9LBqvFdpAd0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=fKZvl8AoMP8KazlcBViFdRsMzaNSYRtt2vXzIaZw7vHdL1ts6Q+QPmBsUJQNQwVjN OoSeet0XCr2sl4BZakuy9yVD+J+Pcz45OnStr3YR24aOwp3LgvGjVblocdS53H1NSo 420yJByMcufEfwGLII7Vua7tgUm+zcDyWFtm0ZSvpsM6ydBaCOy59DuBqGkp7hy+yf Pdu0wh2OyCvn21WRikcj70rICDEzeY/mq8lTPF2ixJj1mpfEl3fQA2C4pIynX/g6Wk NuDG8IIwaWg9acGC4zB/jrdGPqpeYbmk7ySYvjs9bBSzWQT/+LOaCTa7c0+7MU7Ln7 yOKvoQjLFIBYA== Original-Received: from pastel (unknown [45.72.193.52]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id F26401208BC; Wed, 14 Dec 2022 09:15:24 -0500 (EST) In-Reply-To: <83bko6nq4l.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 14 Dec 2022 14:09:30 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:250944 Archived-At: >> >> 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