From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [External] : Turning on savehist-mode by default Date: Sun, 19 Nov 2023 11:24:34 +0200 Message-ID: <837cmeksdp.fsf@gnu.org> References: <87wmufm7r7.fsf@catern.com> <87edgmq601.fsf@posteo.net> <87jzqeybz8.fsf@posteo.net> <86cyw6wb27.fsf@mail.linkov.net> <83bkbqkv2u.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16508"; mail-complaints-to="usenet@ciao.gmane.io" Cc: juri@linkov.net, drew.adams@oracle.com, philipk@posteo.net, sbaugh@catern.com, emacs-devel@gnu.org To: Yuri Khan Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 19 10:25:42 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r4e3h-00043s-EC for ged-emacs-devel@m.gmane-mx.org; Sun, 19 Nov 2023 10:25:41 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r4e2z-0002Bf-4G; Sun, 19 Nov 2023 04:24:57 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r4e2x-0002BT-B2 for emacs-devel@gnu.org; Sun, 19 Nov 2023 04:24:55 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r4e2u-0000hE-MZ; Sun, 19 Nov 2023 04:24:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=//hg9/PIRP25w+jstNe8/TjYZ+J/owsnPMAipfy1O6A=; b=pRM3rJqmcLrO4ZgMeq55 uBj/zo6uUNLzc4xJZR25K5UYaSm1mW2EUVQtTnFez7q8UiIhClX2C6o95Bul/X2PClXId9AtHNQiY ZKRklkSq/RNGjjN6myNZB/t8NqYtllR4nBx+Nk1b+8JNwaOllA57CS50amBPjBP/Nmdkf9rJDQTff RHkDKeMZV9N95K9oxoHQi6xCn+FwDOnBTD6f7Ygry3Nk0qYJpXnK5eRXI1NKAnTzVYSVaV0CyaY5y +18w3MBFJzPR6jmxEuQjcOhKpbU5figbJqtoWoWeP2a5lw52IOy4LlDsAXOPinM/9lX8EN8uwOdgy xco+uCWHDg6xWA==; In-Reply-To: (message from Yuri Khan on Sun, 19 Nov 2023 16:06:17 +0700) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:312959 Archived-At: > From: Yuri Khan > Date: Sun, 19 Nov 2023 16:06:17 +0700 > Cc: juri@linkov.net, drew.adams@oracle.com, philipk@posteo.net, > sbaugh@catern.com, emacs-devel@gnu.org > > On Sun, 19 Nov 2023 at 15:26, Eli Zaretskii wrote: > > > > > Please don't forget there is also `desktop.el' > > > > that is a superset of `savehist.el' > > > > > > Is it though? I’m using ‘desktop-save-mode’, not observing > > > preservation of histories, and not seeing any user option in the > > > Desktop group that would shout to me “enable this to save all > > > histories”. I see ‘file-name-history’ in ‘desktop-globals-to-save’ but > > > I wouldn’t like to whitelist all the histories I care about. > > > > Why not? > > Why would I? Because some histories you care about, whereas others you don't? That's the situation here, FWIW. > Histories are user data. User data is precious. Losing > user data on a restart is a bug. (Slightly exaggerating.) The "slightly" part is already exaggerated. Not all histories are precious enough to save them. They don't come for free: you pay with memory for them, if not with longer search times. > I can see three reasons for *not* saving histories: (1) risk of > information disclosure if sensitive data such as passwords is stored > in histories; (2) reduced startup performance if too much history gets > accumulated; and (3) cross-process interference if the application is > typically running in multiple instances. (1) is solved by a blacklist > (opt-out for a few specific histories), (2) by pruning saved histories > to some configurable maximum depth, and (3) by saying Emacs is not > typically used like that[citation needed]. Well, I think you just explained why whitelisting history variables, and thus using desktop.el for that, is not such an outlandish idea. One other argument for using desktop.el is if you already use it for its other features. > > I do precisely that, FWIW. It's a one-time configuration, > > so not a lot of effort. > > It’s only a one-time configuration if your workflow is constant. If I > start using a feature I had not been using previously, its histories > will initially not be saved, and I’ll have to interrupt my work and > amend my configuration. So it’s a recurring cost. If you start using new features frequently enough, you haven't been using Emacs long enough ;-) Let's agree to disagree about the advantages and disadvantages of whitelisting vs blacklisting. Basically, both serve the same purpose, so the decision which one to use depends on the length of the white list vs the black list. Which means either method is fine, and there's no need to represent the other choice as something completely senseless.