emacs-devel
[Top][All Lists]
Advanced

[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: Fri, 29 Nov 2019 15:20:42 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

On 29 Nov 2019, Stefan Monnier wrote:
>> There are other buffer-local minor modes that are of similar nature:
>> display-line-numbers-mode, display-fill-column-indicator-mode, and
>> maybe some others (e.g., what about hl-line-mode?).  So if we are
>> going to preserve text-scale-mode across reverting, I think we should
>> have a list of modes to preserve, not just exempt this one mode.
>
>There's already the `preserve-modes` argument to `revert-buffer`
>for that.  For some reason we don't expose it to the end-user :-(

My original post explains why I don't think that parameter is a good mechanism 
for these kinds of display-related behaviors.

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?  I think most 
people just expect `revert-buffer' to revert the contents -- they're trying to 
discard their current changes and get back in sync with whatever's in the 
underlying file.  That doesn't necessarily mean they want to change Emacs's 
behavior in terms of how the buffer is displayed or how it reacts to 
manipulation.  Reversion is about content, not about interaction.

So how about we just flip that parameter's sense and change its name to 
`discard-modes' (or `revert-modes', or whatever)?

That would solve the original problem that motivated me, and it might also be a 
better default behavior for users anyway.

(I'm happy to make the change and update all callers, if there is agreement.)

Best regards,
-Karl



reply via email to

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