emacs-devel
[Top][All Lists]
Advanced

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

Re: Problem with revert-buffer and overlays


From: martin rudalics
Subject: Re: Problem with revert-buffer and overlays
Date: Tue, 29 Nov 2005 10:15:46 +0100
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

>     Why not do this in kill-all-local-variables then?
>
> The reason to get rid of the overlays after revert is because they
> cannot reliably point to the right place any more.
>
> Changing the major mode should not delete the overlays--that would be
> incorrect.  (Some might be used by minor modes or other features.)
> Instead, the major mode should explicitly delete the overlays that it
> uses.

Might be I don't understand this correctly but to get rid of an overlay
you have to find it in the first place.  The original problem was that
kill-all-local-variables killed the reference to the overlay and CUA's
post-command hook wasn't able to find it any more.  Hence, any attempt
to correct this problem (semi-)automatically would have to do that in
kill-all-local-variables.  Suppose I have a CUA rectangle in cperl-mode
and do M-x perl-mode.  The overlay would become inaccessible and any fix
of revert-buffer wouldn't help here.

I believe that Kim's approach to make such variables permanent-local is
the right one to handle this - when and if the problem shows up again.
The only thing I would do is leave a note about this, somewhere.

>     Deactivating the mark would have to be done by insert-file-contents if
>     it finds out that the mark has been invalidated during reversion.  I'd
>     leave this alone until someone complains.
>
> I just tried it and revert-buffer did deactivate the mark.
> Can someone describe a test case where it fails to do so?

With text-mode it doesn't.  And I never had any problems with that.






reply via email to

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