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: Turning on savehist-mode by default Date: Wed, 29 Nov 2023 14:31:04 +0200 Message-ID: <83ttp47ncn.fsf@gnu.org> References: <83a5qy7xjx.fsf@gnu.org> <7a6d16c5-90ff-4c5b-be0f-cd19c272eada@alphapapa.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29686"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org, public@thanosapollo.org To: Adam Porter Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Nov 29 13:31:51 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 1r8JjK-0007Yo-Vt for ged-emacs-devel@m.gmane-mx.org; Wed, 29 Nov 2023 13:31:51 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r8Jin-0001HA-Fl; Wed, 29 Nov 2023 07:31:17 -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 1r8Jim-0001Gw-JS for emacs-devel@gnu.org; Wed, 29 Nov 2023 07:31:16 -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 1r8Jim-000230-02; Wed, 29 Nov 2023 07:31:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=qP7bTvqWy22CqfM/AL43WNZmrgGtBsSfRHM7kH0BXzM=; b=bxkbd8ME/ITu Ej/IyoMcu6mN+FqSc8L7KEdNjyoQzHxpHPMir7atdgmdyj+twbLGAvOr7LmAfqonQNquCudDAMW9d f+ZShFN5MuS4NeNdZOd4SL/7S7OBCAejD/e+LRUguQ0dCTgQcSJr7Kv+5Gea/AzzhStzYVR1g7V7y 5sFp+KENPCp8gGifIwEU83dhofuDaLxo+Iy6vn4zeTgNNDns1JqM3NRbHtYpE2EhwSfb2Jxlww5cU dlVQm6tC+2SZkBbZ4YN91GeparUdFVAjMTqakzysckTdWnwTEoSyLeBVwGteTzaadiGytWM7tqO61 2wJNCGbtT7H+zdZzOIvUpw==; In-Reply-To: <7a6d16c5-90ff-4c5b-be0f-cd19c272eada@alphapapa.net> (message from Adam Porter on Tue, 28 Nov 2023 15:07:46 -0600) 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:313356 Archived-At: > Date: Tue, 28 Nov 2023 15:07:46 -0600 > Cc: emacs-devel@gnu.org, public@thanosapollo.org > From: Adam Porter > > FWIW, IME, it may not be a good idea to enable savehist-mode by default. > As an example, see this issue report on Ement.el's repository: > > https://github.com/alphapapa/ement.el/issues/216 > > The gist is that, for users who enabled savehist, it was saving the > variable command-history, which included some complex commands whose > arguments (from interactive completion) included large data structures > (which are hidden from the user when called interactively). This > resulted in savehist files hundreds of MB in size and very noticeable > pauses whenever savehist saved its data, from timers and upon Emacs exit. > > The worst part was how long it took to discover the source of the > problem. There were intermittent reports of weird pauses for months, > without any discernible reason, until a user finally narrowed it down to > using savehist. Then we had to add this hacky workaround in Ement to > try to automatically avoid the problem. > > Such cases may be rare (or not--I can't say), but when it happens, it > seems to be a bear to deal with, being very unintuitive. For myself, > even having written a number of Emacs packages, I wasn't yet aware of > the command-history variable and how it saves arguments, and certainly > not the implications of using savehist as well. savehist provides a customizable ability to limit the number of history entries saved for each variable. We could also add a new feature which limits the size of individual entry: entries longer than that will not be saved. Patches welcome.