From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Karl Fogel Newsgroups: gmane.emacs.devel Subject: Re: Should `revert-buffer' preserve text-scaling by default? Date: Sun, 01 Dec 2019 20:01:37 -0600 Message-ID: <8736e3scxq.fsf@red-bean.com> References: <87fti6toq7.fsf@red-bean.com> <83pnhao1re.fsf@gnu.org> <8736e6tm51.fsf@red-bean.com> <83imn1omkf.fsf@gnu.org> <87d0d8xxzu.fsf@red-bean.com> Reply-To: Karl Fogel Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="200522"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 02 03:02:23 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ibb2d-000q2N-G0 for ged-emacs-devel@m.gmane.org; Mon, 02 Dec 2019 03:02:23 +0100 Original-Received: from localhost ([::1]:57842 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ibb2b-0005Hz-RV for ged-emacs-devel@m.gmane.org; Sun, 01 Dec 2019 21:02:21 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55342) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ibb1z-0005Hq-3E for emacs-devel@gnu.org; Sun, 01 Dec 2019 21:01:44 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ibb1x-00031N-KM for emacs-devel@gnu.org; Sun, 01 Dec 2019 21:01:42 -0500 Original-Received: from mail-oi1-x233.google.com ([2607:f8b0:4864:20::233]:44278) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ibb1x-00030C-Dc; Sun, 01 Dec 2019 21:01:41 -0500 Original-Received: by mail-oi1-x233.google.com with SMTP id d62so6071494oia.11; Sun, 01 Dec 2019 18:01:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:reply-to:date:in-reply-to :message-id:user-agent:mime-version; bh=KYBQFVsCXzBaLGRsjh9LpQ8odUe63bWllEmSlGwf/jg=; b=Ab//3drFnB2/CFlDifYqsjZTscHgEEMPL6FKa3ILKRG0ruwwL25kaIy//EvTYac+U9 +5JZQ8hAHT6Wa3A3nDQuIZZyTRY8v4ynKDaoXUmnpYGa3h5p7WKd1LIX0xEmZUq+cKAs ni871JdjblAYTDY3HQ4l9P3lxsD+r/LxLaZrQJvxp4cYElM12CZ+si0t89FKY++gqfjo Jil9Zyioy9U7jr5DqKTDbc0YkHLT2k2nf7xjoLy+WBnhzu24M7jfjJjCmOdGAxe1Fh80 tiNOEz1qOkK3Hd1jaYsUguNNNUKbxJgrsnN4puofO3qmXSI4nUF8rzKnGWzT5UhVLE+E Nh4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:reply-to :date:in-reply-to:message-id:user-agent:mime-version; bh=KYBQFVsCXzBaLGRsjh9LpQ8odUe63bWllEmSlGwf/jg=; b=iEYUVmNjCDMSlsfg1EdiVNkIwctyFWbXXRpgZ6DTsxqvMKd13YigTZYsZ6AjLKtPCF MFgpJu/vd7aD7FKddMWtog+TXgS7TP02qK+1Dfh/EDE/5dLbuddcdmKWsOeaTShn9n+k 8UHr0fiyOwSF8w6QpGxMxls+M8KDv/K/338ro4m96zsfZZsHtScqcKfcb6/THjHU1FrK Ya4EYEiBC2MxQTj1njDjMMyRievJIooUcppD1OCW+Iuu99H0loDHLXI+3tDOAnoS8vU6 Rumtnk/1LFi7dzGmVQB25d/nqKKoHRpZXaCmX2iXL3n8x4iZ+2Kt7OlnP+oftwAWWwh9 1BIQ== X-Gm-Message-State: APjAAAVKvN7Qpec/3zSt+i6WV/Bw5y38OymUIwIY4DJkHhV2GKwgRiW/ VZOmb0bD9TplbT2ObemRKcPG0TS1 X-Google-Smtp-Source: APXvYqxEiP40tjbxk+9iUGRI8VILdA8H2zBt3MP+mZXc7pfIOmNbXzRv0H4emRA1IMbf9nUJKRlpDw== X-Received: by 2002:aca:3442:: with SMTP id b63mr18409995oia.36.1575252099185; Sun, 01 Dec 2019 18:01:39 -0800 (PST) Original-Received: from floss ([2602:306:3707:da30:ad07:41b7:9269:9552]) by smtp.gmail.com with ESMTPSA id a74sm4424889oii.37.2019.12.01.18.01.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Dec 2019 18:01:38 -0800 (PST) In-Reply-To: (Stefan Monnier's message of "Sun, 01 Dec 2019 13:25:33 -0500") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::233 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:242982 Archived-At: 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