emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: question about markers, replace-match, and undo


From: Johan Bockgård
Subject: Re: question about markers, replace-match, and undo
Date: Sun, 29 Apr 2007 17:19:04 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.1.50 (gnu/linux)

Richard Stallman <address@hidden> writes:

> Can you send a program to construct the test case that fails for you?
> Then I will test my patch and make sure it fixes your problem.

I tested it like this:

$ emacs -Q

---------- Buffer: *scratch* ----------
123456

(defun a ()
  (interactive)
  (setq a (copy-marker 1))
  (setq b (copy-marker 7))
  (goto-char (point-min))
  (re-search-forward "123456")
  (replace-match "000"))

(defun b ()
  (interactive)
  (message "%s, %s" a b))
---------- Buffer: *scratch* ----------

Eval the buffer.

M-x a RET
Undo (C-/)
M-x b RET


Emacs 21
  => #<marker at 1 in *scratch*>, #<marker at 7 in *scratch*>

Emacs 22
  => #<marker at 1 in *scratch*>, #<marker at 1 in *scratch*>

Emacs 22 after your patch
  => #<marker at 1 in *scratch*>, #<marker at 7 in *scratch*>


-- 
Johan Bockgård





reply via email to

[Prev in Thread] Current Thread [Next in Thread]