unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
Cc: emacs-devel@gnu.org, storm@cua.dk
Subject: Re: Problem with revert-buffer and overlays
Date: Tue, 29 Nov 2005 10:15:46 +0100	[thread overview]
Message-ID: <438C1C42.8020709@gmx.at> (raw)
In-Reply-To: <E1Egq7H-0000OF-96@fencepost.gnu.org>

 >     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	other threads:[~2005-11-29  9:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-25 13:23 Two minor problems with CUA rectangles martin rudalics
2005-11-26 23:37 ` Problem with revert-buffer and overlays [was: Two minor problems with CUA rectangles] Kim F. Storm
2005-11-27  3:28   ` Richard M. Stallman
2005-11-27 21:02     ` Problem with revert-buffer and overlays Kim F. Storm
2005-11-28  4:47       ` Richard M. Stallman
2005-11-28 10:17         ` martin rudalics
2005-11-28 12:38           ` Kim F. Storm
2005-11-28 21:00           ` Richard M. Stallman
2005-11-29  9:15             ` martin rudalics [this message]
2005-11-29 21:47               ` Richard M. Stallman
2005-11-30  9:52                 ` martin rudalics
2005-12-04 21:19                   ` Richard M. Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=438C1C42.8020709@gmx.at \
    --to=rudalics@gmx.at \
    --cc=emacs-devel@gnu.org \
    --cc=storm@cua.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).