From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 13585 invoked from network); 6 Sep 2022 20:13:45 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 6 Sep 2022 20:13:45 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1662495225; b=WAcFhkM6JKyhWeEGBIiHjayJf8TJ+uRq85MmHPe9A+0g1pF6BFONO25+/BrUMa40eT2d4yAVqK d9H+/QpAJ+v7rhAjvfQdur/Byi02IK671ASKJQN/WLtCma96aMUcD2VfFS23Q4SW+W2gZm+qXv tBRHfFcyL7znk1kZL1wlo0GbBmuMnikKqFYig5tAFU5XTTvf2MsgRlvEqbbcQDHDL8aJwSrVS/ LN/V7P7UdIuZOUahLTU4QQWqBdCMkDAockNotWehFUz15B6FhsEL3bvsanqltOX2o+6nYUBDyS SFizGmwtAcPZIwtDmemTeM1Yxcs7lZvWqgq03mWJ+a50dQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ed1-f44.google.com) smtp.remote-ip=209.85.208.44; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1662495225; bh=2TM7YMlqAy8GfS9aYfCWz07ZcJBUyDNjAldjhTMxW5E=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=EMXJMelNhCeO3ACVhos7E0geDQfgFs5zAWoU6un6UZNk0znxyhRRVDBDaU7KgfWBoqUE/ZDGqk g+yChce6yLKQzsAE++84gZfa48ph5P8K8iWyAOFjd4jgLpr14KRup0gzTiBILoYjrS+bJinn7R hlIzBa2zIIPNJaww48TE4qZlxRozLzvvuKSSLeNt7KupFshLn8PdrNS7ykN68Zjcc0yO/+pn+Z AefPLTCvXWsDyUelAhM0m0KLKBxRI9ZemW0QCud6YH9WbEHNxyf4TXYIjfxMByyquh1v9lthJ1 Sn1hcMLHXxhXn7igmmKnI3w02YgMl07RtROeOYPlsDGP8A==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=mVBW9J80fLsyvk49yqYW7V9K4ODy8ZuwMK/c76gJGbE=; b=XgXu/3Q+L5ZtfwGQHJyLYaG2Bs pTAuG9+qG7TPdrQWvwEuFv7KXPRpitcuqE5ZGIQTMlFLlZ1TRQ3EkTD4Ktxh/+SGqpPjxt+LZg/DZ YlY5GkWHek2KP6Op97NUbo33Y/UDRQR4K/9CApRN0rgO13TdvAc9ogzWne18ODomMSdwNNUDs9Kuc Qvl0jcuOBuzz7DL9g4brMh/SZeeqtMXY0LA1gMW8WbXSE7hU6tIvEOFasolOdBFftrZje7S3n+wWE IJWnExed7udE5ySp5bfNJ7fgghPW4NjDvyYkSvzBebJw6bfhL05PFFa3mQuMubIry0/yFTcOwXHXQ AWcr6+uQ==; Received: from authenticated user by zero.zsh.org with local id 1oVex6-000EeF-9l; Tue, 06 Sep 2022 20:13:44 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ed1-f44.google.com) smtp.remote-ip=209.85.208.44; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-ed1-f44.google.com ([209.85.208.44]:46630) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1oVewq-000EKO-EP; Tue, 06 Sep 2022 20:13:29 +0000 Received: by mail-ed1-f44.google.com with SMTP id s11so16612809edd.13 for ; Tue, 06 Sep 2022 13:13:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=mVBW9J80fLsyvk49yqYW7V9K4ODy8ZuwMK/c76gJGbE=; b=PNFx8ZGVC5WZKI1xIxYCffnewn6A1K4SNJHlII31dMNf1XJeGogmXHTn1hWUzRYUwa uCPhjmSty5z+L0TbLObA871BksOWs/RQ8K1XLztmDwCpM3Ms2TT8Ellx+Aqzm3VpJMIH np9QyK/2u9T/gN7yk1cyEQKgBQfIt/yStvoWOD7v/Gnuh+53oC+gXXkUakHZKyUKPAH9 0MYCTmpsTCpIBir6gYQ/Ho5RL32m5enmZueaievUaysx239yVp5QCE/o+QEYiez4Zfjr jStYAJ7jC/jk5adc+Lqu3fgX9am110CtfrE/bEAg73JMuXUN6VIDrnXqvFHKff9d9IXl ZvWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=mVBW9J80fLsyvk49yqYW7V9K4ODy8ZuwMK/c76gJGbE=; b=AVfyaw51Dum3Z0tkoKnoQ3mxQxmgh9q8aeEDxBf1l51Q9ot3Nije6qk5Z6Wi/ul4+5 XmhbGEFUz8cGl4226oln3MszTrlWpK/Mq/JG/QN2PTWDqN+c4x/XfaECLhrO5SW1W8CQ Fje9uta2TpCk0tPBqBvTcLiDzf1zDTQsPbmCx16MG+VqU5EHMSyxEte5QpoFDFbVcOWq IAgL5iM+xxEi4LqW8x488I1otK5f5wSIlk2s+u+NHbqSihHg8pPwFMTx0s/NwGAuQy+X 5u313KX7WExmHt3l7u68/T37hn5Yt3m1vKggnd7Hcyu4rBhAbHgNZj2K31YxBV8NWq6B EdUA== X-Gm-Message-State: ACgBeo2O3nxIHojBuxQ367aCPALO8NnfplZVTGI0oRoQIR3q8YiB6Cw8 WeSM0EGcg0dDijziK+PHUxBT45nXo1UoDHh/W7nOOQ6wxzlYAg== X-Google-Smtp-Source: AA6agR7NQ6sWTRmY0RKiaO4IQ4XT79tOy6DBiGAqdhmDBHgcSwBNmirfNjMapKdLOQb6ZP19tyh90J3cbtYtY1T3N28= X-Received: by 2002:aa7:dcd2:0:b0:44e:69f3:edd1 with SMTP id w18-20020aa7dcd2000000b0044e69f3edd1mr266150edu.244.1662495207893; Tue, 06 Sep 2022 13:13:27 -0700 (PDT) MIME-Version: 1.0 References: <20220831031854.27312-1-felipe.contreras@gmail.com> <20220831031854.27312-2-felipe.contreras@gmail.com> <20220902085904.GF5920@tarpaulin.shahaf.local2> <20220902100135.GL5920@tarpaulin.shahaf.local2> In-Reply-To: From: Felipe Contreras Date: Tue, 6 Sep 2022 15:13:17 -0500 Message-ID: Subject: Re: [PATCH 1/2] Set SAVEHIST to $HISTSIZE by default To: Daniel Shahaf Cc: zsh-workers@zsh.org Content-Type: text/plain; charset="UTF-8" X-Seq: 50609 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On Fri, Sep 2, 2022 at 8:25 AM Felipe Contreras wrote: > On Fri, Sep 2, 2022 at 5:01 AM Daniel Shahaf wrote: > > Felipe Contreras wrote on Fri, Sep 02, 2022 at 04:29:30 -0500: > > > On Fri, Sep 2, 2022 at 3:59 AM Daniel Shahaf wrote: > > > > Felipe Contreras wrote on Tue, Aug 30, 2022 at 22:18:53 -0500: > > > > > If they are the same, this makes it clearer that they are the same. > > > > > > > > > > Signed-off-by: Felipe Contreras > > > > > --- > > > > > Etc/FAQ.yo | 2 +- > > > > > Functions/Newuser/zsh-newuser-install | 2 +- > > > > > 2 files changed, 2 insertions(+), 2 deletions(-) > > > > > > > > > > diff --git a/Etc/FAQ.yo b/Etc/FAQ.yo > > > > > index 8c795685a..dd573767e 100644 > > > > > --- a/Etc/FAQ.yo > > > > > +++ b/Etc/FAQ.yo > > > > > @@ -1631,7 +1631,7 @@ label(321) > > > > > verb( > > > > > HISTSIZE=200 > > > > > HISTFILE=~/.zsh_history > > > > > - SAVEHIST=200 > > > > > + SAVEHIST=$HISTSIZE > > > > > > > > Personally, I'm not going to commit this since I find the increased > > > > semantic precision / DRY compliance to be outweighed by the reduced > > > > readability (both here and in the code below, but for different > > > > reasons). > > > > > > But you only need to read it *once* and forget about it forever (or at > > > least as long as you keep the same history strategy). > > > > You're summing over the wrong variable. This isn't jrandom's zshrc; > > this is the FAQ. So, don't sum over how often jrandom will read this > > passage of their zshrc, but over how often this part of the FAQ will be > > read by existing and prospective users. > > First of all the text is wrong, setting HISTFILE is not necessary to > save history, the default is 30, and that works fine. > > Now, let's imagine a world in which the text is fixed and HISTSIZE is > not mentioned, what value do we recommend our users to set? By inertia > we would do what we are currently doing, but there's a discrepancy: > > The simplest possibility is to set it to the same as tt($HISTSIZE) as above. > > Why is it the simplest possibility? Well, because if you have one next > to the other, you can simply set both to the same value. But now > that's not true, because we don't have the value of HISTSIZE at hand. > We could explain what is the default value of HISTSIZE, and recommend > the users to set that, but it's 30, which is not very useful, we would > want something at least the current recommended value, so this works: > > HISTFILE=~/.zsh_history > SAVEHIST=200 > > But what happens if the default value of HISTSIZE is increased? (as it > happens in patch 2) If the value is bigger than 200, it will basically > be ignored, so if the new HISTSIZE is 1000, you potentially could lose > 800 entries. Therefore the usefulness of the new default is lost. > > And what happens in the year 2050 when computers have 8 TB of RAM and > we decide our users can probably afford a default HISTSIZE of 10000? > Are we going to update the FAQ yet again? Are we going to recommend > users to increase the SAVEHIST accordingly? > > None of this is *necessary* for what the objective of the text > initially was, which is to explain why the history is not being saved. > > The answer is simple: the history is not saved because SAVEHIST isn't > set and the simplest way to set it is to $HISTSIZE. There is no need > to care what the value of HISTSIZE is, or whether the user sets it or > not, setting SAVEHIST to $HISTSIZE just works, now and forever. OK. Since I didn't get a reply to my arguments, I went ahead and increased HISTSIZE first: https://www.zsh.org/mla/workers/2022/msg00938.html All my arguments should be more obvious now. -- Felipe Contreras