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 11852 invoked from network); 7 Sep 2022 00:14:15 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 7 Sep 2022 00:14:15 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1662509655; b=UpxIFu12cjSlwW5aVAT81MC9w8kdQog+iBXTwbaCzVEXjIna86Yiq3/30yUO5mhvSn6X5TjKHn kMEyQFOxzP3SLaF+e9PE9ygfi7HJiIsCoOUZmbIOqA16beiAg31HZ/rcMVpy6/tOBsEBmDXpEf s6+Rnh5ZLmXo8MmlszV8bsbYbhBTH0e2LDaXuk/6efQxAFfx9dIz5UNCBwAYDfhj6kxgzjNV9G NTWo3vOkQF9EPHbtyIypAWSvk2XqR/goGwVWlkRiUR+yIjIBZzUcGUYTioPlQZMkuZU1yFnDw9 l9ftdsPoYiTtWgKlHTSBIHzyfMOxNZgXJBolEEg94AgUXw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ej1-f49.google.com) smtp.remote-ip=209.85.218.49; 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=1662509655; bh=EKeEKfb9yyBMr/wxTQzICGSeyPP+N/9+B+N8nP3ijIg=; 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=Cw4tZmGpz/sca9KlR8aI1zZLLEER+ksy2VAJIJff/m2qM64t7kLvrI9drn6fjJkjPMkgzsU9Ko 52N9O35DDESN5nXua/liRgUf/NmMq2SzWDwjUB5xFi9OwNCXqlzRngTuTGAL3hY/CNdnH5Kk7V xLtp0PZguLPkz7+qhG/v1pd8kKkf+tjK5fafPSMW5wApxpXmJ1AAGVsllwEFaMFvzEhLiwuQk1 MlJedTRxd4bmI9EdgUSJXsx4Z8URAZEkiroRDRvjWqHMYzE7T6VKKK5LaAi//gaQ6z9UDWcQBG btmoNPH7LtTW4oMpvIqGcKQL7ANe9u6+JsDd1v0DEBqLIQ==; 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=5UZ0ejvVysJFp0cOEr1/UAbevvxSAobBpH+2LU1qtTU=; b=oCLnJ/d8j+rhmP2Qr1LCe02TdQ UjOizk+GraFUHSARm4euhpOqVRsp70ejj3Cb5b4oCNpEGdtdO+jl239JXoBhYeif556cM/yC6UEaV YJbURdO+oJab2IvVsAGnjI1EEcGbOdSUuNamaqi2/qtFJkaCj4qKFtvlBTLxDZ6swl1acDUlIlCdC rsSdTvAEPpNhBRQvmDXGj8hDWAfD7pqZ93uF0OqbRwgNNyg4eE8ipxbFcj9AgmSxtZjLmTgBrZ5s+ eBtgdXlW5iZw9DSkIY9VzGsrBIo0aRqnVeNGaBOWacJXh0zaeuVeVN1Jn4g29c7+pyJbIJfwrWujY xiNAr1cw==; Received: from authenticated user by zero.zsh.org with local id 1oVihp-000LEg-UN; Wed, 07 Sep 2022 00:14:13 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ej1-f49.google.com) smtp.remote-ip=209.85.218.49; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-ej1-f49.google.com ([209.85.218.49]:46626) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1oVici-000KnX-0y; Wed, 07 Sep 2022 00:08:56 +0000 Received: by mail-ej1-f49.google.com with SMTP id bj12so26728038ejb.13 for ; Tue, 06 Sep 2022 17:08:55 -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=5UZ0ejvVysJFp0cOEr1/UAbevvxSAobBpH+2LU1qtTU=; b=lP5VbDvN6AB610kwNvyj02EOR39jyqgkJL0vOyNzBwL0U61NR3jPWJvBwOSawX7PqN RnQj84+g0/w05vx5MKIey5EO/HJxQdsrXJe5nqs3RmvAsvBQ/VNffDLcISCJ8vQqviH6 1osllhoToR2zhXASwJTItNkc6ULR1qsU3en9omojANKZpi5+a9HCK5HRO9BzBWc945HN 1ncNAHHWtfS+4C91BcKQTt1v0y2Dtt+u1utv9iUtKBt1r3hB6sxwTJ/qCA5pzVamEU3F si40Mq3dbJ7ed+R4H2VP5X86X0myr7t0JoKXUJVA35/CPzvST/UsBtyqzJRGGfImZQQ+ N+Tg== 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=5UZ0ejvVysJFp0cOEr1/UAbevvxSAobBpH+2LU1qtTU=; b=C0wB2WZ1e0rYouc1SaorZcoyjvPfcXWxXwDByODAuAU21cS8/bds7ZwSlP9ga82/KX ydKDg6hVsdvcMXa5rM9o3OjF4iAPeHXMlIduF2eM/oskdk415wXn1xv35g/33UHFaQ5W vfzfSJqwN5PBuJiiNoCRguUYtBW94/yw6RYP9q1DYfzSxFX6LNtOQ1+prVZFryMp6yrO 6B3k71isVvdtN0WOlzQGNgsEKijGR/FoL6HMc3YJsBH3bvkdVtRsn1/u2XbD7T29ZkZJ wdrPSo9UTa5m4NSclWQoEQwazMrspwDVzfWsSLh6cj1XWQn7DbekcEXIrNtTg+oPTO60 5Y6A== X-Gm-Message-State: ACgBeo2ZcB7mM9BuJQfMTD9ZHU/2gMxYKETpkcW0Z/GkxALoD3F4xn9t umoMTnB/xb4lO5AG1mYAkLlOtkpUK6KLtMnpHXs= X-Google-Smtp-Source: AA6agR58wYgxTghkLC6mIS7tZDa5RLf3RQB0k32HRsh/q1hpHBSxCgVm6EKbTWIL0Bv9TUmiOJiOdR3p/x+YsANleUw= X-Received: by 2002:a17:907:94c7:b0:730:d5bc:14c with SMTP id dn7-20020a17090794c700b00730d5bc014cmr627852ejc.68.1662509335365; Tue, 06 Sep 2022 17:08:55 -0700 (PDT) MIME-Version: 1.0 References: <20220906195003.10408-1-felipe.contreras@gmail.com> <20220906195003.10408-2-felipe.contreras@gmail.com> In-Reply-To: From: Felipe Contreras Date: Tue, 6 Sep 2022 19:08:44 -0500 Message-ID: Subject: Re: [PATCH v2 1/1] Increase default HISTSIZE to 1000 To: Mikael Magnusson Cc: zsh-workers@zsh.org, Peter Stephenson , Daniel Shahaf , Bart Schaefer Content-Type: text/plain; charset="UTF-8" X-Seq: 50611 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 Tue, Sep 6, 2022 at 3:15 PM Mikael Magnusson wrote: > On 9/6/22, Felipe Contreras wrote: > > If the default is sensible then it's not necessary for the user to > > change it. > > > > Moreover, the FAQ is wrong: it says it's necessary to set HISTSIZE for > > the history to saved, but it isn't. HISTSIZE by default is 30 and that's > > enough to save the history, although not very useful. Therefore only > > *two* variables need to be set. > > > > This is even more clear after we remove HISTSIZE from the example, but > > then the text "The simplest possibility is to set it to the same as > > tt($HISTSIZE) as above" becomes problematic as the value of HISTSIZE is > > not readily available. > > > > The user doesn't need to know the value of HISTSIZE though, she can > > simply use $HISTSIZE instead. > > > > This has the advantage that if HISTSIZE is increased again in the future > > (as it probably should because most modern computers can easily afford > > orders of magnitude more), nobody needs to worry about SAVEHIST (neither > > in the FAQ, zsh-newuser-install, or existing zshrc files). > > > > Also, semantically makes more sense and carries less cognitive load. > > > > Signed-off-by: Felipe Contreras > > --- > > Etc/FAQ.yo | 17 +++++++---------- > > Functions/Newuser/zsh-newuser-install | 3 +-- > > StartupFiles/zshrc | 2 +- > > configure.ac | 2 +- > > 4 files changed, 10 insertions(+), 14 deletions(-) > > > > diff --git a/Etc/FAQ.yo b/Etc/FAQ.yo > > index 8c795685a..4c058c363 100644 > > --- a/Etc/FAQ.yo > > +++ b/Etc/FAQ.yo > > @@ -1626,19 +1626,16 @@ work?) > > sect(Why is my history not being saved?) > > label(321) > > > > - In zsh, you need to set three variables to make sure your history is > > + In zsh, you need to set two variables to make sure your history is > > written out when the shell exits. For example, > > verb( > > - HISTSIZE=200 > > HISTFILE=~/.zsh_history > > - SAVEHIST=200 > > - ) > > - tt($HISTSIZE) tells the shell how many lines to keep internally, > > - tt($HISTFILE) tells it where to write the history, and tt($SAVEHIST), > > - the easiest one to forget, tells it how many to write out. The > > - simplest possibility is to set it to the same as tt($HISTSIZE) as > > - above. There are also various options affecting history; see the > > - manual. > > + SAVEHIST=$HISTSIZE > > + ) > > + tt($HISTFILE) tells the shell where to write the history, and > > tt($SAVEHIST) > > + tells it how many lines to write out. The simplest possibility is to set > > it > > + to the same as tt($HISTSIZE) as above. There are also various options > > + affecting history; see the manual. > > NAK on the above hunk from me, making the FAQ less informative is not a goal. The goal of the FAQ is to answer common questions, and the goal of this entry is to answer the question "Why is my history not being saved?", not inform the user about history. That's already done in the user's guide Setting up history [1], and in the manual's roadmap Interactive Use [2]. If you want to inform the user about history, a link should be provided to either of those, not attempt to repeat the same information except in a poorer way. To answer the question at hand "Why is my history not being saved?" it's *not necessary* to explain HISTSIZE (yet again), and it's not desirable to answer something the user did not ask. > > sect(How do I get a variable's value to be evaluated as another variable?) > > > > diff --git a/Functions/Newuser/zsh-newuser-install > > b/Functions/Newuser/zsh-newuser-install > > index 9e911d07c..46b1639c5 100644 > > --- a/Functions/Newuser/zsh-newuser-install > > +++ b/Functions/Newuser/zsh-newuser-install > > @@ -790,9 +790,8 @@ ${(F)unparsed} > > > > __zni_history_config() { > > __zni_apply_defaults -p \ > > - HISTSIZE 1000 "Number of lines of history kept within the shell." \ > > HISTFILE $zdmsg/.histfile "File where history is saved." \ > > - SAVEHIST 1000 "Number of lines of history to save to \$HISTFILE." > > + SAVEHIST \$HISTSIZE "Number of lines of history to save to > > \$HISTFILE." > > > > if __zni_display_and_edit "History configuration"; then > > install_state[history]="Unsaved changes" > > Ditto here for the same reason. The reason "making the FAQ less informative is not a goal" doesn't apply here. The purpose of the zsh-newuser-install script is not to provide the user with information, again, that is already done in the user's guide and the manual. Neither is it to inform the user of all the history options in the manual [3] that the user might want to set, like EXTENDED_HISTORY, HIST_IGNORE_SPACE, INC_APPEND_HISTORY, or SHARE_HISTORY. The purpose of the script as it's clearly stated when you start it is "help you with a few settings that should make your use of the shell easier", not inform the user of all the settings, or even typical settings. [1] https://zsh.sourceforge.io/Guide/zshguide02.html#l17 [2] https://zsh.sourceforge.io/Doc/Release/Roadmap.html#Interactive-Use [3] https://zsh.sourceforge.io/Doc/Release/Options.html#Description-of-Options -- Felipe Contreras