[Top][All Lists]

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

Re: Should `revert-buffer' preserve text-scaling by default?

From: Karl Fogel
Subject: Re: Should `revert-buffer' preserve text-scaling by default?
Date: Sun, 01 Dec 2019 02:15:33 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

On 30 Nov 2019, Eli Zaretskii wrote:
>> In general, are you in favor of having a default list of preserved
>> modes for `revert-buffer', with the above modes as the initial
>> candidates for membership in that list?
>I'm okay with that, as an option, but let's hear what others think.
>The more modes we want to preserve, the more backward incompatibility
>this change will bring, so we may wish to tread with care.

Agreed (see below).

>> However, the more I think about it, the more I wonder if maybe just
>> defaulting `preserve-modes' to true might be the best solution. Does
>> it really make sense to *not* preserve modes by default when
>> reverting a buffer?
>Well, the fact that we did that for eons is one huge evidence that it
>does make sense.
>But I won't object to exposing that argument via a defcustom or a
>special value of prefix arg.
>> So how about we just flip that parameter's sense and change its name
>to `discard-modes' (or `revert-modes', or whatever)?
>This must be an opt-in feature, for backward compatibility reasons.

I have to agree, despite my earlier eagerness.  Just as whoever implemented 
text-scaling using a minor mode probably had no thought about the interaction 
with `revert-buffer' given the latter's `preserve-modes' parameter, we cannot 
know the consequences of reversing that parameter's sense now.

Given that it would be opt-in, however, the value of implementing becomes 
somewhat low, since as an opt-in it would not by default solve the original 
bug, which is that `revert-buffer' behaves unexpectedly w.r.t. text-scaling.

So going back to the previous proposal seems like the best approach, because it 
allows us to change just the buggy behavior(s) and nothing else.  To reiterate: 
that proposal is to have a new list variable `revert-buffer-preserved-modes', 
whose default value includes these modes:

  `hl-line-mode' (maybe?)

Over time we could adjust the default contents of this list, of course.

I would also like to hear what others here think, both about the overall idea 
and about what modes should be in that list.

Best regards,

reply via email to

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