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 11:01:22 -0800 Message-ID: References: <87wmufm7r7.fsf@catern.com> 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="36040"; mail-complaints-to="usenet@ciao.gmane.io" To: sbaugh@catern.com, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Dec 16 20:02:27 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 1rEZve-00097G-5Z for ged-emacs-devel@m.gmane-mx.org; Sat, 16 Dec 2023 20:02:26 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rEZum-0001sz-F1; Sat, 16 Dec 2023 14:01:32 -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 1rEZui-0001sY-Cw for emacs-devel@gnu.org; Sat, 16 Dec 2023 14:01:30 -0500 Original-Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rEZuf-0004RH-KB for emacs-devel@gnu.org; Sat, 16 Dec 2023 14:01:28 -0500 Original-Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a1f8a1e9637so312442766b.1 for ; Sat, 16 Dec 2023 11:01:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702753283; x=1703358083; darn=gnu.org; h=to:subject:message-id:date:mime-version:references:in-reply-to:from :from:to:cc:subject:date:message-id:reply-to; bh=mAngVyN2ESXcGPZXhx8JyW3u2Kt4ZST0Xzn0CAOzwBw=; b=SMajEaFx6xHnKhXGRqAWwPyb+HcwP2WceD3XZUOmyQyxjVnrQiFbDJejOp9QV/mBiL dk0LzwDg9UIOur/K84IdYXEepBlM1R4aD2HRSmwxc+aji6JQUvu59LmW+187XdK8pzDv 6jr13/29pNiWiovLkxSGIwPjjpufo7AEhKXNizzOExxfSnOz8LDXhONNAwAXAK6mQHZf kTKqF0HYck8u4Fe1N4nAHBiF6SPgcSURxJC44l5/aBuLqq6XzBA3sR9m1UYm4DscjOqn +Q5dURqWXoFLpvGNr4Ers/dt0MVsdPSO1PqMw6qUuszbnu5Jg6Xo64clwnjy9XHUPuJ0 vc+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702753283; x=1703358083; h=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=mAngVyN2ESXcGPZXhx8JyW3u2Kt4ZST0Xzn0CAOzwBw=; b=R8EeaI2FL5M09nfc1Zg1MT/V9/6k/ffS6jg5QPlXL2F3IPQXrtQk3sECODjLyXYfCI axNO/ubJQMTWuq5ssIcUyKS5la7CfQXaQZ0RxfvnVUS0YTlzLOa5YXt8hBtpHyqKovJc KZo15CKxPBzARdIVinSa+LvV+/JdGl9B2bFdgqH+7TwC3FLhwcT9WRX8OjplxNDi5VSK /SFwHRhAv+/5R9kQfD1kGuly4+nnFv74GhVQMDnuWIjSeawEyCYt/SqUJ1inlWwFbmDX I9Yw4fs0bMXWXZ2NT5GYQIF/rnNCIyZ8Me7kr+VX+rJkWHPA5zPAEel+7racOVh6GXSq FGJg== X-Gm-Message-State: AOJu0YzPuO/yxuD3o2HMCyhuB+XFwBLRTtUR0YhZ8ZfB3NLTNx5YahiS jjbrn4t7k6JmaeFl9jN0p0BkXyobFrF0JxxvRZDf1pKkOMA2vg== X-Google-Smtp-Source: AGHT+IGMmO4cEjgTY/vAa9ceaHzxMvWT2HGIr71oE8TV2m9c1MDJe2jJBVE55bKRVSiH1sElJ0rj0XV+ASZ4GDgquXI= X-Received: by 2002:a17:907:1361:b0:a1f:7486:b977 with SMTP id yo1-20020a170907136100b00a1f7486b977mr13484898ejb.23.1702753283573; Sat, 16 Dec 2023 11:01:23 -0800 (PST) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sat, 16 Dec 2023 11:01:22 -0800 In-Reply-To: <87wmufm7r7.fsf@catern.com> Received-SPF: pass client-ip=2a00:1450:4864:20::62c; envelope-from=stefankangas@gmail.com; helo=mail-ej1-x62c.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:313881 Archived-At: sbaugh@catern.com writes: > savehist-mode is a useful mode which is turned on by many Emacs > users. [1] It matches the default behavior of programs like bash and > vim, which save command history by default. I suggest that we should > find some way to enable savehist by default. Yes, good idea. This functionality seems to be expected in modern software, so I don't see why we shouldn't provide it. I saw some discussion about desktop.el as an alternative. To me that's a separate discussion. (FWIW, I'd rather see that we unified savehist-mode and desktop.el instead of maintaining duplicate functionality. I have no idea if that can be done in a reasonable way.) I didn't see any serious objections, so perhaps we could move forward with this proposal. Eli, WDYT? > By default savehist creates a timer which saves the history every 5 > minutes. I suggest that by default we should just have behavior like: > (add-hook 'kill-emacs-hook #'savehist-autosave) > If the user explicitly runs (savehist-mode 1) then that would enable the > timer-based saving. Having only the `kill-emacs-hook' seems like a good step forward, but why not have both the timer and the hook? Otherwise, if Emacs crashes, the user will lose her command history. That's not what we want, I think. BTW, and this is a bit of a tangent, but the "every 5 minutes" default could probably safely be lowered a little bit (1-3 minutes or so).