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: Fri, 29 Nov 2019 15:20:42 -0600 Message-ID: <8736e6tm51.fsf@red-bean.com> References: <87fti6toq7.fsf@red-bean.com> <83pnhao1re.fsf@gnu.org> 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="126442"; 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 Fri Nov 29 22:24:42 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 1iankn-000WnU-Af for ged-emacs-devel@m.gmane.org; Fri, 29 Nov 2019 22:24:41 +0100 Original-Received: from localhost ([::1]:35240 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iankm-0003jl-3D for ged-emacs-devel@m.gmane.org; Fri, 29 Nov 2019 16:24:40 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46172) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ianh6-0002Xw-Cx for emacs-devel@gnu.org; Fri, 29 Nov 2019 16:20:53 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ianh2-0004mw-6N for emacs-devel@gnu.org; Fri, 29 Nov 2019 16:20:49 -0500 Original-Received: from mail-oi1-x234.google.com ([2607:f8b0:4864:20::234]:33221) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ianh1-0004Ub-Vg; Fri, 29 Nov 2019 16:20:48 -0500 Original-Received: by mail-oi1-x234.google.com with SMTP id x21so20043679oic.0; Fri, 29 Nov 2019 13:20:45 -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=SlR9rHqIek01tgaAW4GnssYACoGkJVKVF1il0STKA3M=; b=jL4BfRFHD/0+FJPrWtBiYt9DrtRog/jwPEeJAp4h3RRi+iizmTSaV3dtc5gaeUwb9T bbK7iUsfRcg3AKdMykQk0SMLXLDXaaA5b8D1kFrinqId9SJNj19fMuKDvh4CFnk2rJ9d DwXPszOkHRuaIkAlMXn8SW69p4NEfvpwG69S0K2rlOFAgsi23IFvCIuzsooItNqc/bC2 WpR/0GFC2NkQ9FXEN2BWgIznAay9AiGN14jcnkaXcd8HMf9rnSqNxyEF1SQ/oWPBUX3r AfBT50heXUs7CYzdbki9tyC3c+pdEPlUJV510MmTtCfJDCDTCo5WkY40qQisHb+7RnSw am1w== 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=SlR9rHqIek01tgaAW4GnssYACoGkJVKVF1il0STKA3M=; b=txA9Vu6P78OIOd+eu6gu/Y/v08x1D9u9lFXy3TnYlX3oysVvpYs/AG2VuBZQGcBgWv epecJfN1ti+Oqg2Ru8P/mNHG0X79g0bhLeZaiqXj33TSXexJHKWoTzRtkI+lN/SacxVH IzqKdmGfj9jadr5JOnkqX/1zYKDQb2vXWS27yI+PJXeRgIBXc6k4JHXl4EMW1V8hpU2c VWHpowslMbssM5aYYNggGt/hB5LirvqyJsWfJPLGevHZF7YZ9EzmD+lqegaEMIvnN1rP suiJ8CXFYvDetWe8mBps3wlos7GCnEVSM5yEHDT1Cnz8IWwLjgXSlM9a1pph4ojAeAYH hx9w== X-Gm-Message-State: APjAAAVQL2+ffvpjhIVLeH66qr6noIK1fjo1pNIOvr7OWOcbplPsyXkG P1LQY7r+/dT0meGGRLxHK72pWzhm X-Google-Smtp-Source: APXvYqxwNwyl/5N/OQnVWgKlNwyOoffjNV9v+jUi5BlzHrbP9zblTWHfkesOnms5NM83/pRo88tSqA== X-Received: by 2002:aca:4c57:: with SMTP id z84mr2061724oia.92.1575062444556; Fri, 29 Nov 2019 13:20:44 -0800 (PST) Original-Received: from floss ([2602:306:3707:da30:88:8959:f3b0:a36a]) by smtp.gmail.com with ESMTPSA id o64sm582459oib.47.2019.11.29.13.20.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Nov 2019 13:20:43 -0800 (PST) In-Reply-To: (Stefan Monnier's message of "Fri, 29 Nov 2019 16:09:31 -0500") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::234 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:242899 Archived-At: 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