unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Karl Fogel <kfogel@red-bean.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Subject: Re: Should `revert-buffer' preserve text-scaling by default?
Date: Sun, 01 Dec 2019 20:01:37 -0600	[thread overview]
Message-ID: <8736e3scxq.fsf@red-bean.com> (raw)
In-Reply-To: <jwv4kyjewp5.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Sun, 01 Dec 2019 13:25:33 -0500")

On 01 Dec 2019, Stefan Monnier wrote:
>FWIW, I think that this is in the eye of the beholder.
>
>In my opinion, we should move towards an arrangement where the
>revert-buffer command focuses on synchronizing the buffer's state with
>the external world (e.g. text content, read-only-mode, VC state, ...)
>and then have another command for resetting the modes (probably
>normal-mode).

I think that would be a good direction to move in.  How would that differ, in essence, from my proposal (earlier in this thread) to have `revert-buffer' not reset modes by default?  After I proposed it, Eli persuaded me that that would be too big a change and that for compatibility reasons we shouldn't do it.

I'm easily unpersuaded from that recent persuasion, though... Frankly, I think we don't have much empirical knowledge about what users want/expect from `revert-buffer' beyond reverting files contents.  The fact that it clobbers modes seems somewhat random.  I suspect the mode-clobbering was probably designed for some specific use case, and afterwards as people created new modes they were almost never thinking about whether `revert-buffer' should revert their new mode or not, because they usually weren't aware that `revert-buffer' does that at all.

The `preserve-modes' argument was added by Richard (commit 9a30563f9) probably in order to help `vc-revert-buffer1' (commit e7ffe86a9068).  I wish at that point, in 1995, we had stopped to ask ourselves why `revert-buffer' was clobbering modes in the first place.  But we didn't, and now it's 24 years and about ten zillion new modes later :-), and we have no clear idea what lossage might ensue if we change the behavior.

But if you want to move to an arrangement where `revert-buffer' focuses on synchronizing the buffer with the outside world, and people use a different command for resetting the modes, that sounds okay to me.  It would certainly resolve the one thing that I *do* feel pretty sure is a bug here, which is that reverting a buffer reverts the text-scaling too.  If someone increased the text size, they did so for purely visual purposes: it's so they can see the contents better.  Their eyesight doesn't change when they revert the buffer's contents, and clearly they know how to scale the size down again if they want to (since they scaled it up in the first place).

>Currently, the revert-buffer's C-u is used to choose between "revert
>from file or revert from the auto-save file".  Personally I never use
>that (probably the most obvious reason is that I don't use auto-save
>files at all), so I'd gladly change this C-u to mean "and reset the
>modes".

I never use the "revert from auto-save" behavior either.  I'd be happy to have C-u mean "reset the modes" instead, but remember that would mean reversing the default behavior: instead of clobbering modes by default, it would preserve modes by default and clobber only on opt-in.

Even though Eli unconvinced me of that earlier, it turns out I'm weak-minded enough to have already fallen back into thinking it's a good idea now that you suggest it.  So I'm +1 on what you say, at least until Eli posts again?

Best regards,
-Karl



  reply	other threads:[~2019-12-02  2:01 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-29 20:24 Should `revert-buffer' preserve text-scaling by default? Karl Fogel
2019-11-29 20:39 ` Eli Zaretskii
2019-11-29 21:02   ` Karl Fogel
2019-11-30  7:24     ` Eli Zaretskii
2019-11-29 21:09   ` Stefan Monnier
2019-11-29 21:20     ` Karl Fogel
2019-11-30  7:22       ` Eli Zaretskii
2019-12-01  8:15         ` Karl Fogel
2019-12-01  9:47           ` Stefan Kangas
2019-12-01 10:24             ` Juanma Barranquero
2019-12-01 17:38               ` Eli Zaretskii
2019-12-01 10:27             ` Michael Albinus
2019-12-01 17:35               ` Karl Fogel
2019-12-01 18:25           ` Stefan Monnier
2019-12-02  2:01             ` Karl Fogel [this message]
2019-12-02 16:15               ` Eli Zaretskii
2019-12-02 17:19                 ` Karl Fogel
2019-12-02 17:42                   ` Eli Zaretskii
2019-12-02 22:29                     ` Karl Fogel
2019-12-02 22:49                       ` Stefan Monnier
2019-12-03  0:36                         ` Karl Fogel
2019-12-03 16:11                           ` Eli Zaretskii
2019-12-03 16:10                         ` Eli Zaretskii
2019-12-03 16:09                       ` Eli Zaretskii
2019-12-03 17:35                         ` Karl Fogel
2019-12-01 21:49 ` Juri Linkov

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=8736e3scxq.fsf@red-bean.com \
    --to=kfogel@red-bean.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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).