GNU bug report logs -
#17893
24.4.50; (error "Marker does not point anywhere")
Previous Next
Reported by: Drew Adams <drew.adams <at> oracle.com>
Date: Tue, 1 Jul 2014 21:12:01 UTC
Severity: normal
Found in version 24.4.50
Done: Stefan Monnier <monnier <at> iro.umontreal.ca>
Bug is archived. No further changes may be made.
Full log
Message #58 received at 17893 <at> debbugs.gnu.org (full text, mbox):
> From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
> 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")
This bug report was last modified 7 years and 179 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.