From: Dmitry Gutov <dgutov@yandex.ru>
To: 25599@debbugs.gnu.org
Subject: bug#25599: 26.0.50; "Marker does not point anywhere" error signaled by primitive-undo near an overlay with an auto-removal insert-in-front-hooks value
Date: Wed, 1 Feb 2017 16:18:27 +0200 [thread overview]
Message-ID: <28211825-9989-bd18-1f53-891506af9adf@yandex.ru> (raw)
In diff-hl, we create overlays to paint markers on the fringe. The
overlays are set to be deleted when text inside (or very close nearby)
is modified, for better user experience. Yet it seems to clash with
"undo", original bug report here:
https://github.com/dgutov/diff-hl/issues/84
Here's how to reproduce the problem without diff-hl installed:
1. Replace the contents of the scratch buffer with this:
--->
;; aaaaaaaaaaaaa
;; bbbbbbbbbbbbb
(defun overlay-modified (ov after-p _beg _end &optional length)
(unless after-p
(when (overlay-buffer ov)
(delete-overlay ov))))
(save-excursion
(goto-char (point-min))
(let ((ov (make-overlay (line-beginning-position 2)
(line-end-position 2))))
(overlay-put ov 'insert-in-front-hooks '(overlay-modified))))
<---
2. Evaluate both forms at the end, the one that defines
`overlay-modified' and the one that creates the overlay.
3. Select the whole first line (;; aaa...), including the newline, so
that the region ends at the beginning of the second line.
4. Press C-w, killing the region, then M-x undo.
5. See the error "Marker does not point anywhere".
The backtrace looks like this:
Debugger entered--Lisp error: (error "Marker does not point anywhere")
primitive-undo(1 ((#(";; aaaaaaaaaaaaa\n" 0 1 (fontified t face
font-lock-comment-delimiter-face) 1 3 (fontified t face
font-lock-comment-delimiter-face) 3 16 (fontified t face
font-lock-comment-face) 16 17 (fontified t face font-lock-comment-face))
. 1) (#<marker at 1 in -scratch-> . -17) (#<marker in no buffer> . -17)
(#<marker in no buffer> . -17) 18 nil undo-tree-canary))
undo-more(1)
undo(nil)
funcall-interactively(undo nil)
The problem is not new, I see it in 24.5 as well.
In GNU Emacs 26.0.50.5 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9)
of 2017-01-23 built on zappa
Repository revision: 03de82fe7ca09ab40fbcae394d4fcdfe3374496e
Windowing system distributor 'The X.Org Foundation', version 11.0.11804000
System Description: Ubuntu 16.04.1 LTS
next reply other threads:[~2017-02-01 14:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-01 14:18 Dmitry Gutov [this message]
2017-03-08 16:14 ` bug#25599: Why edit markers after insert? nitish chandra
2017-03-08 17:39 ` Andreas Schwab
2017-03-08 18:08 ` nitish chandra
2017-03-08 18:17 ` nitish chandra
2017-03-09 19:39 ` nitish chandra
2017-05-14 1:12 ` Dmitry Gutov
2017-06-11 18:10 ` npostavs
2017-06-17 1:06 ` Dmitry Gutov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=28211825-9989-bd18-1f53-891506af9adf@yandex.ru \
--to=dgutov@yandex.ru \
--cc=25599@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.