From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: Problem with revert-buffer and overlays Date: Tue, 29 Nov 2005 10:15:46 +0100 Message-ID: <438C1C42.8020709@gmx.at> References: <43871059.9090705@gmx.at> <438AD957.4010005@gmx.at> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1133269024 7450 80.91.229.2 (29 Nov 2005 12:57:04 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 29 Nov 2005 12:57:04 +0000 (UTC) Cc: emacs-devel@gnu.org, storm@cua.dk Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 29 13:56:54 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Eh3Dl-0000wM-45 for ged-emacs-devel@m.gmane.org; Tue, 29 Nov 2005 12:00:25 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Eh2dL-00080R-CO for ged-emacs-devel@m.gmane.org; Tue, 29 Nov 2005 05:22:47 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Eh1pw-0002AG-Up for emacs-devel@gnu.org; Tue, 29 Nov 2005 04:31:45 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Eh1pb-000273-IU for emacs-devel@gnu.org; Tue, 29 Nov 2005 04:31:41 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Eh1kQ-0001UR-MS for emacs-devel@gnu.org; Tue, 29 Nov 2005 04:26:03 -0500 Original-Received: from [213.165.64.20] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.34) id 1Eh1kQ-0000Tq-Gd for emacs-devel@gnu.org; Tue, 29 Nov 2005 04:26:02 -0500 Original-Received: (qmail invoked by alias); 29 Nov 2005 09:25:58 -0000 Original-Received: from N802P025.adsl.highway.telekom.at (EHLO [62.47.44.57]) [62.47.44.57] by mail.gmx.net (mp028) with SMTP; 29 Nov 2005 10:25:58 +0100 X-Authenticated: #14592706 User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: de-DE, de, en-us, en Original-To: rms@gnu.org In-Reply-To: X-Y-GMX-Trusted: 0 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:46756 Archived-At: > 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.