From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#17893: 24.4.50; (error "Marker does not point anywhere") Date: Mon, 20 Nov 2017 19:55:23 +0200 Message-ID: <837eukesxg.fsf@gnu.org> References: <8facd635-be88-4990-8e7d-538db19c3e1a@default> <04af8576-c419-4d35-9c6e-7170828ac949@default> <83h8tpdkd4.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1511200572 26520 195.159.176.226 (20 Nov 2017 17:56:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 20 Nov 2017 17:56:12 +0000 (UTC) Cc: 17893@debbugs.gnu.org, charles@aurox.ch To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Nov 20 18:56:07 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eGqIf-0006Vd-LR for geb-bug-gnu-emacs@m.gmane.org; Mon, 20 Nov 2017 18:56:05 +0100 Original-Received: from localhost ([::1]:58665 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGqIn-0007JP-5I for geb-bug-gnu-emacs@m.gmane.org; Mon, 20 Nov 2017 12:56:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42413) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGqIh-0007JI-KE for bug-gnu-emacs@gnu.org; Mon, 20 Nov 2017 12:56:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eGqId-0006zY-Lg for bug-gnu-emacs@gnu.org; Mon, 20 Nov 2017 12:56:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40625) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eGqId-0006z7-Hy for bug-gnu-emacs@gnu.org; Mon, 20 Nov 2017 12:56:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eGqId-0002zz-9B for bug-gnu-emacs@gnu.org; Mon, 20 Nov 2017 12:56:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 20 Nov 2017 17:56:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17893 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 17893-submit@debbugs.gnu.org id=B17893.151120055011501 (code B ref 17893); Mon, 20 Nov 2017 17:56:03 +0000 Original-Received: (at 17893) by debbugs.gnu.org; 20 Nov 2017 17:55:50 +0000 Original-Received: from localhost ([127.0.0.1]:49303 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eGqIP-0002zR-Ra for submit@debbugs.gnu.org; Mon, 20 Nov 2017 12:55:50 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:51283) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eGqIO-0002zD-S6 for 17893@debbugs.gnu.org; Mon, 20 Nov 2017 12:55:49 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eGqIF-0006cS-QJ for 17893@debbugs.gnu.org; Mon, 20 Nov 2017 12:55:43 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:45456) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGqIF-0006cL-MW; Mon, 20 Nov 2017 12:55:39 -0500 Original-Received: from [176.228.60.248] (port=2914 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eGqID-0002e6-P5; Mon, 20 Nov 2017 12:55:39 -0500 In-reply-to: (message from Stefan Monnier on Mon, 20 Nov 2017 11:51:45 -0500) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:140146 Archived-At: > From: Stefan Monnier > Cc: charles@aurox.ch (Charles A. Roelli), 17893@debbugs.gnu.org > Date: Mon, 20 Nov 2017 11:51:45 -0500 > > > E.g., info.el itself maintains a per-buffer marker in > > Info-tag-table-marker; evaluate it after M-n and see what it > > tells you. > > And for that reason, clone-buffer runs `clone-buffer-hook`, which > Info-mode uses to do: If so, it doesn't work well enough: emacs -Q C-u C-h i elisp.info RET M-: Info-tag-table-marker RET => # M-n M-: Info-tag-table-marker RET => # > > but in general this is a ticking bomb, unless I'm missing something. > > If I'm right, the only solution is to walk all the markers that point > > to the parent buffer and clone them to point to the cloned buffer > > (this has to be done in C). > > This can't be done in C because after creating those new markers, where > would we store them? E.g. cloning all the markers that are in > `mark-ring` would just create new markers but it would fail to create > a new list holding those markers, stored in the new buffer-local value > of `mark-ring` (walking the markers doesn't tell us that they're > referred to from `mark-ring`). I guess we will have to walk all the local variables and find markers in them, like GC does. Is there any other way? > Hence clone-buffer-hook, which doesn't solve the problem in itself, but > makes it possible to fix it manually where needed. I think this kind of problems is impossible to solve from Lisp, as we don't expose enough information about markers, and for a good reason. For starters, that hook assumes that every mode knows exactly what local variables could need special handling, but that's an illusion. For example, the user could have set all kinds of local variables behind the back of Emacs which hold markers. As another data point, there are 6 users of clone-buffer in Emacs core, and only one of them bothers to set up a clone-buffer-hook.