From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: Problem with revert-buffer and overlays Date: Mon, 28 Nov 2005 13:38:23 +0100 Message-ID: References: <43871059.9090705@gmx.at> <438AD957.4010005@gmx.at> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1133189492 2492 80.91.229.2 (28 Nov 2005 14:51:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 28 Nov 2005 14:51:32 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 28 15:51:28 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EgkI2-0007uN-9i for ged-emacs-devel@m.gmane.org; Mon, 28 Nov 2005 15:47:34 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EgkI1-0000nH-DX for ged-emacs-devel@m.gmane.org; Mon, 28 Nov 2005 09:47:33 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EgiI9-0003pe-Kg for emacs-devel@gnu.org; Mon, 28 Nov 2005 07:39:33 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EgiI7-0003oJ-0s for emacs-devel@gnu.org; Mon, 28 Nov 2005 07:39:31 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EgiI6-0003o3-JQ for emacs-devel@gnu.org; Mon, 28 Nov 2005 07:39:30 -0500 Original-Received: from [195.41.46.236] (helo=pfepb.post.tele.dk) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EgiI4-0007o6-Pr; Mon, 28 Nov 2005 07:39:28 -0500 Original-Received: from kfs-l.imdomain.dk.cua.dk (unknown [80.165.4.124]) by pfepb.post.tele.dk (Postfix) with SMTP id 3F3275EE0D0; Mon, 28 Nov 2005 13:39:13 +0100 (CET) Original-To: martin rudalics In-Reply-To: <438AD957.4010005@gmx.at> (martin rudalics's message of "Mon, 28 Nov 2005 11:17:59 +0100") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) 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:46701 Archived-At: martin rudalics writes: > > This seems to be a generic problem with revert-buffer, as other modes > > may also have overlays in the buffer which should be removed by > > revert-buffer. It seems like it should unconditionally delete all > > overlays in that buffer. > > > > Perhaps things which kills all local variables should also kill all > > overlays in the buffer. > > > It should be done in revert-buffer, I think. > > after-find-file is not the right place, > > and normal-mode should NOT mess with overlays. > > Why not do this in kill-all-local-variables then? > > Although solving this problem is tricky in general. Consider two > buffers A and B. A buffer-local variable in A may reference an overlay > in buffer B. When A is reverted how remove the overlay in B? This looks like a can of works best left alone for now. > > > BTW, I noticed that revert-buffer does not deactivate the mark. > > > > That seems like a bug, too. > > 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. Ok with me. Still, I'll fix it for cua. > In a similar way, I don't > think it necessary to remove the CUA rectangle when a buffer is > reverted. It may not be necessary, but since most of the cua state is kept in buffer local variables, that state is lost when you do revert-buffer, so to keep the rectangle, cua must do "extra work" to ensure it is still valid after revert-buffer. So it is simpler to remove it. -- Kim F. Storm http://www.cua.dk