> it seems that after the smerge-remove-props call, the match data
> information is lost so (match-end n) returns nil, causing
> delete-region to fail.  Changing the definition as below seems to fix
> the problem.

> (defun smerge-keep-n (n)
>    (let ((zero-start (match-beginning 0))
>          (zero-end (match-end 0))
>          (n-start (match-beginning n))
>          (n-end (match-end n)))
>      (smerge-remove-props zero-start zero-end)
>      ;; We used to use replace-match, but that did not preserve  markers
>         so well.
>      (delete-region n-end zero-end)
>      (delete-region zero-start n-start)))

That's odd.  I can't see any place in smerge-remove-props where the
match-data might be clobbered.

And I can't reproduce your problem: M-x smerge-keep-current works just fine
in my tests.  I suspect it may be something like a bad interaction with an
after-change-function that doesn't properly save the match data.  Can you
give a more precise recipe to reproduce the problem, starting from "emacs -Q"?


        Stefan


_______________________________________________
emacs-pretest-bug mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

Reply via email to