emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: problems with smerge-mode.el


From: Stefan Monnier
Subject: Re: problems with smerge-mode.el
Date: Thu, 15 Dec 2005 17:35:34 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

> 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




reply via email to

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