From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.devel Subject: Re: Turning on savehist-mode by default Date: Sat, 16 Dec 2023 23:49:56 -0800 Message-ID: References: <461a0999-6005-4aa4-a4b3-988123855f92@alphapapa.net> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40101"; mail-complaints-to="usenet@ciao.gmane.io" Cc: eliz@gnu.org, emacs-devel@gnu.org, sbaugh@catern.com To: Adam Porter , luangruo@yahoo.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Dec 17 08:50:44 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 1rElvA-000AG5-CH for ged-emacs-devel@m.gmane-mx.org; Sun, 17 Dec 2023 08:50:44 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rEluV-0004Lt-6a; Sun, 17 Dec 2023 02:50:03 -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 1rEluT-0004La-1P for emacs-devel@gnu.org; Sun, 17 Dec 2023 02:50:01 -0500 Original-Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rEluR-00070L-C6; Sun, 17 Dec 2023 02:50:00 -0500 Original-Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-55114c073b8so2408187a12.1; Sat, 16 Dec 2023 23:49:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702799397; x=1703404197; darn=gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=+1PHyUTZabF47F8OWjL6bCRah+kvNztTW3coFQnorOk=; b=PzmYk6sdS8wuHeBgGtoEggSRblAtxcEuV0/LrVtD5DYLOMHfDcW/Ua0KaGxVZ9ae/M IqDaDiRLsIty6qDpzOy3/W0APpR55h+t4yzhD7HilSM5vGRuc8UDSA5LxAB7lFifq9pl TsAnkuIiTOtHbS+sBB9by4gscJrH2gPeYUsHf1ssSjpvCjAuZBulwQ4laIhGuBwfi77W 7Z9vNS2fv85W2BAtj2pleSLiOrTZu3nbAEPFbip4Is/ZjuM2dzwpRrQP6V18RsJVFZ4R TGNQT+nPO9uL1yFPuu92lL7m8lpIsKWvs9DlU17/cTKXlZgwCVnT2qrfDogAh4qqN8tp x4Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702799397; x=1703404197; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+1PHyUTZabF47F8OWjL6bCRah+kvNztTW3coFQnorOk=; b=otZ5MnGVTsV8QjYcejRJXdp99kdLgnh5bavjqm0/9CySIGGl8Lop2pnXfkHBEt0rjI BnUXSJ83AGBAFKe4CQD1tybVFtGzLxYuf4xGg5VHX/Pq81r+SQbnq0VkW8KV5+4+yLuH jSAKtq6ldyZPkeFsi5WJnGVRfjVcLaeDFhZMVt1TmDtP8JWvlUHhWQATR2k0Rxn4N3VV GmhlCu0SGuUb2NQcUY65pv7+S55UNak1KzP/jZkrOhuMe9XSFiGSSCEX6+ZPiqNkWcfl PdWIOyggLitaE1Le73sswLVfwMQAiIit4KYMRCsb4CzfIBTLzCyiZupKT5tVrr5qBor2 mItA== X-Gm-Message-State: AOJu0Yy7HUVsiT0DmwAdp2IXpWJ8U65CZIvZT9utM+zCdPN8dUBJpwoi CNU/wicyJUJTUVaWR2m4k2nMzzeCnhjtFr3DOIcqXj8cFPf3vw== X-Google-Smtp-Source: AGHT+IE0vFN0AyHqYMuVDHnVQWBIZ5AekWKKmU1V/kgXNr9eVSUwKtQqUyPZL7KfoPBpJMH0SUq1NGyYccwIXQUHRug= X-Received: by 2002:a50:8713:0:b0:54a:f4ac:9b09 with SMTP id i19-20020a508713000000b0054af4ac9b09mr5484858edb.35.1702799397035; Sat, 16 Dec 2023 23:49:57 -0800 (PST) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sat, 16 Dec 2023 23:49:56 -0800 In-Reply-To: <461a0999-6005-4aa4-a4b3-988123855f92@alphapapa.net> Received-SPF: pass client-ip=2a00:1450:4864:20::531; envelope-from=stefankangas@gmail.com; helo=mail-ed1-x531.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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:313904 Archived-At: Adam Porter writes: > In addition to what Po said, I'd like to gently reiterate what I said > earlier in this thread: Given my experience with savehist causing > unexpected and hard-to-debug performance problems[0], I'd guess that > there are more such cases in the wild waiting to be triggered. If, e.g. > Emacs 30.1 enabled it by default, I can imagine a number of users > suddenly encountering weird pauses, and they'd probably blame GC > initially[1]. > > As well, I have some concerns about savehist's having the potential to > cause weird bugs in other libraries: The savehist-save function seems to > comment out individual elements of savehist-minibuffer-history-variables > that it determines are unreadable. That's understandable from its > perspective, but what effect will that have on libraries that may not be > expecting for their data structures to have certain parts disappear > after restarting Emacs? I can just imagine the bug reports from users > showing apparently corrupted or elided data structures, and having no > clue as to what is mutating them, because the code isn't within the > library having a bug reported against it. > > IMHO, a feature like this is indeed expected and overdue in Emacs, but I > don't think savehist is a good way to enable it, given its current > implementation. ISTM that something built on top of the new > multisession library would be more appropriate and (at least, have the > potential to be) more robust. Thanks, this is clear and compelling. It seems to me that savehist-mode is *not* ready for being enabled by default. I think the best we can do at this point is to start working on improve and/or replace it. Would anyone like to volunteer to do that? > 0: https://github.com/alphapapa/ement.el/issues/216 Did you think about how issues like the above could be solved (in general, not necessarily in savehist specifically)? > 1: Which may, in fact, be part of the problem, considering how > savehist-save works: it prints a Lisp object to a buffer, then tries to > read it to determine whether it's readable--doesn't that generate > garbage? Now consider doing that every 1-5 minutes and upon exit. savehist (or it's replacement) could also be smarter about it, for example you could skip re-serializing history variables that have not been touched.