From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: charles@aurox.ch (Charles A. Roelli) Newsgroups: gmane.emacs.bugs Subject: bug#17893: 24.4.50; (error "Marker does not point anywhere") Date: Sun, 19 Nov 2017 20:31:06 +0100 Message-ID: References: <8facd635-be88-4990-8e7d-538db19c3e1a@default> <04af8576-c419-4d35-9c6e-7170828ac949@default> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1511119872 26519 195.159.176.226 (19 Nov 2017 19:31:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 19 Nov 2017 19:31:12 +0000 (UTC) Cc: 17893@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Nov 19 20:31:08 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 1eGVJ5-0006ZU-2G for geb-bug-gnu-emacs@m.gmane.org; Sun, 19 Nov 2017 20:31:07 +0100 Original-Received: from localhost ([::1]:54149 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGVJC-0000Om-Hy for geb-bug-gnu-emacs@m.gmane.org; Sun, 19 Nov 2017 14:31:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57704) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGVJ5-0000OS-GB for bug-gnu-emacs@gnu.org; Sun, 19 Nov 2017 14:31:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eGVJ0-0007nJ-JC for bug-gnu-emacs@gnu.org; Sun, 19 Nov 2017 14:31:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:39275) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eGVJ0-0007mW-DB for bug-gnu-emacs@gnu.org; Sun, 19 Nov 2017 14:31:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eGVJ0-0008Sy-1T for bug-gnu-emacs@gnu.org; Sun, 19 Nov 2017 14:31:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: charles@aurox.ch (Charles A. Roelli) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 19 Nov 2017 19:31:01 +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.151111983532512 (code B ref 17893); Sun, 19 Nov 2017 19:31:01 +0000 Original-Received: (at 17893) by debbugs.gnu.org; 19 Nov 2017 19:30:35 +0000 Original-Received: from localhost ([127.0.0.1]:47955 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eGVIZ-0008SK-1b for submit@debbugs.gnu.org; Sun, 19 Nov 2017 14:30:35 -0500 Original-Received: from sinyavsky.aurox.ch ([37.35.109.145]:48495) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eGVIX-0008S4-KK for 17893@debbugs.gnu.org; Sun, 19 Nov 2017 14:30:34 -0500 Original-Received: from sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) by sinyavsky.aurox.ch (Postfix) with ESMTP id 2F4E7225C9 for <17893@debbugs.gnu.org>; Sun, 19 Nov 2017 19:23:14 +0000 (UTC) Authentication-Results: sinyavsky.aurox.ch (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=aurox.ch DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aurox.ch; h= references:subject:subject:in-reply-to:to:from:from:message-id :date:date; s=dkim; t=1511119391; x=1511983392; bh=O4aoRdJpRv6Yi fRubnioIXCodjOqIgvoW/KyZ9EjnAU=; b=NoIJMfIFsVQa+5mePl3pSwiUsdlY0 FK1aYx74bhNvD5eiI/m5oIv7frkVO+N6XDD9H6erjte11KYcxWeoFJkgR4W28kXe IoNMLgA686r3j2H1tlXZO3H+rVtSPcJoBKP1zcTGRzoQh3zPtMM4pBCsn8sIU6tf ReD1PAvt8KVG5c= X-Virus-Scanned: Debian amavisd-new at test.virtualizor.com Original-Received: from sinyavsky.aurox.ch ([127.0.0.1]) by sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id rz1yG1WpXEzI for <17893@debbugs.gnu.org>; Sun, 19 Nov 2017 19:23:11 +0000 (UTC) Original-Received: from gray (125.85.192.178.dynamic.wline.res.cust.swisscom.ch [178.192.85.125]) by sinyavsky.aurox.ch (Postfix) with ESMTPSA id 6F95A225C1; Sun, 19 Nov 2017 19:23:09 +0000 (UTC) In-reply-to: (message from Stefan Monnier on Tue, 14 Nov 2017 15:08:08 -0500) 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:140116 Archived-At: > From: Stefan Monnier > Date: Tue, 14 Nov 2017 15:08:08 -0500 > > > I was not careful to make sure that the mark-ring contains valid > > markers, so it may be an error in my code. On the other hand, looking > > at the definition of `clone-buffer' (which my patch uses), I don't see > > anything that would update the markers of the mark-ring in the newly > > cloned buffer to point to the new buffer instead of the old one. > > Maybe that is also a problem? > > Yup, sounds like we have a bug in clone-buffer, at least. > > > Stefan Right-o, here's a fix with respect to the emacs-26 branch: diff --git a/lisp/simple.el b/lisp/simple.el index 7d47d0f..64b7bde 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -8518,6 +8518,15 @@ clone-buffer (error nil))) lvars) + ;; Update markers in the copied mark ring to refer to the new buffer. + (setq mark-ring + (mapcar (lambda (m) + (let ((new-marker)) + (setq new-marker (copy-marker m)) + (move-marker new-marker new-marker (current-buffer)) + new-marker)) + mark-ring)) + ;; Run any hooks (typically set up by the major mode ;; for cloning to work properly). (run-hooks 'clone-buffer-hook)) It fixes the minimal recipe to reproduce this bug: > 1. C-h i > 2. Click/drag a few times in the *info* buffer to set some marks > 3. M-n C-x o C-x k RET > 4. Click in the remaining *info*<2> buffer: > > set-transient-map PCH: (error "Marker does not point anywhere")