From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#17893: 24.4.50; (error "Marker does not point anywhere") Date: Mon, 20 Nov 2017 13:59:12 -0500 Message-ID: References: <8facd635-be88-4990-8e7d-538db19c3e1a@default> <04af8576-c419-4d35-9c6e-7170828ac949@default> <83h8tpdkd4.fsf@gnu.org> <837eukesxg.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1511204428 19960 195.159.176.226 (20 Nov 2017 19:00:28 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 20 Nov 2017 19:00:28 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 17893@debbugs.gnu.org, charles@aurox.ch To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Nov 20 20:00:18 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 1eGrIg-0004BN-Vj for geb-bug-gnu-emacs@m.gmane.org; Mon, 20 Nov 2017 20:00:11 +0100 Original-Received: from localhost ([::1]:59265 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGrIo-0005Tl-62 for geb-bug-gnu-emacs@m.gmane.org; Mon, 20 Nov 2017 14:00:18 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43160) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGrIc-0005PG-VP for bug-gnu-emacs@gnu.org; Mon, 20 Nov 2017 14:00:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eGrIY-0002nG-Vs for bug-gnu-emacs@gnu.org; Mon, 20 Nov 2017 14:00:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40736) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eGrIY-0002n6-S7 for bug-gnu-emacs@gnu.org; Mon, 20 Nov 2017 14:00:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eGrIY-0006gI-CM for bug-gnu-emacs@gnu.org; Mon, 20 Nov 2017 14:00:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 20 Nov 2017 19:00:02 +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.151120436125600 (code B ref 17893); Mon, 20 Nov 2017 19:00:02 +0000 Original-Received: (at 17893) by debbugs.gnu.org; 20 Nov 2017 18:59:21 +0000 Original-Received: from localhost ([127.0.0.1]:49417 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eGrHt-0006eq-G5 for submit@debbugs.gnu.org; Mon, 20 Nov 2017 13:59:21 -0500 Original-Received: from pmta21.teksavvy.com ([76.10.157.36]:39269) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eGrHr-0006ec-3U for 17893@debbugs.gnu.org; Mon, 20 Nov 2017 13:59:19 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2E4SADyJBNa/3HQSC1bHAEBAQQBAQoBAYM8Jz9uJ4M0hViEeY9BgX2CIAGWUiWBE4QNAoR9QxQBAQEBAQEBAQEDaCiECVs8AQQBeQULCw0nEhQYMYowCKp9IQKKUwEBAQEGAgElgzSCB4ZpixMFkwiPNodyg2qMKIh7KIcxkkEBhSo2I4F0NCEIMoMtCYR0IzaLTAEBAQ X-IPAS-Result: A2E4SADyJBNa/3HQSC1bHAEBAQQBAQoBAYM8Jz9uJ4M0hViEeY9BgX2CIAGWUiWBE4QNAoR9QxQBAQEBAQEBAQEDaCiECVs8AQQBeQULCw0nEhQYMYowCKp9IQKKUwEBAQEGAgElgzSCB4ZpixMFkwiPNodyg2qMKIh7KIcxkkEBhSo2I4F0NCEIMoMtCYR0IzaLTAEBAQ X-IronPort-AV: E=Sophos;i="5.44,429,1505793600"; d="scan'208";a="9460530" Original-Received: from unknown (HELO pastel.home) ([45.72.208.113]) by smtp.teksavvy.com with ESMTP; 20 Nov 2017 13:59:12 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 80C20607D3; Mon, 20 Nov 2017 13:59:12 -0500 (EST) In-Reply-To: <837eukesxg.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 20 Nov 2017 19:55:23 +0200") 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:140158 Archived-At: >> > 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 > => # Maybe there's a bug, indeed. Does the above lead to undesired behavior? [ It's been a while since I last looked at those things. ] > I guess we will have to walk all the local variables and find markers > in them, like GC does. Is there any other way? I don't think it can be done reliably: whether a marker needs to be cloned or not may depend on what the marker is used for; and some of the markers that need to be cloned could be stored elsewhere than in buffer-local vars. And in order to clone such a marker, we'd need to clone all objects found on the "spine" between the local var and the marker. In some cases such a "clone" is again difficult to do automatically and reliably, because what needs to be done again will depend on semantic details to which such a generic code at the C level doesn't have access. >> 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. No. It just assumes that whichever package owns a marker that needs special treatment should register itself on that hook. Maybe that's too much to ask, but it's definitely not "impossible". > For example, the user could have set all kinds of local variables > behind the back of Emacs which hold markers. Then it's his responsibility to add a function to clone-buffer-hook to handle those (in the unlikely case that she actually cares about interaction between those vars and clone-buffer, that is). > 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. Do these suffer from problems? When I introduced clone-buffer (motivated by Info-mode), I also introduced the Info-clone-buffer hook function because it was simply indispensable to get it working. But I remember using it in other cases where such a hook didn't seem necessary. Stefan