From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id 7F9A829921 for ; Tue, 19 Mar 2024 11:58:27 +0100 (CET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1710845906; b=opIDcZC85e7adI0CpCByLL/ZiDtKpyjouwm+ZC16Fd5gEzvDYkjRI4tEAaaUzo/9RDZ8QxAVYk 8vrFOoMEDlx/YyFgcDCscQYoyYzsplKatiEo4JHqfN9wUY6t2BMn1IjpUG23uC8E9IfMd04107 iCs+yyBB1A9cRK59vF0u+UDTq2ACebQfUCbY446Zy0NBiUhi3ynEIHkPhu+MXyVblkS72nyZzx gkX/aP7UuRopS0VY8WHBaiTQxU3UEFYvLQuajpKnM7AnbG81QcDcqDC50saD/j1saV2FZXEhJX 2IpVMd6hHOaqfHQxlPK9lxZsKniXaD8vOoThNhOszg1vow==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (joooj.vinc17.net) smtp.remote-ip=155.133.131.76; dmarc=none header.from=vinc17.net; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1710845906; bh=jql1YYO/axmgfSyL+yZCuPJbsdM7ssb1q5vBg2glPgA=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Transfer-Encoding:Content-Type: MIME-Version:References:Message-ID:Subject:To:From:Date:DKIM-Signature; b=f2iqy84C6y8aYGwAqkPpHllD17PHwKUSeBkySGxW7/xnM7aF0gtQzgcWPYBmyJELNArnQNCxHj 7L4RAm0bnimMXX44cgKdn2bGzU4zm+icdg3hERx86KHhPCY/gYKecJur2yAdYLofhjePGIEj+g fInCvcQuEIneesj7l8MWn4wAab+5sTcRIaEe8XOjv6ezh9y5KLiugsv3nKukpDhQSK7XNm6ZnD 2vmGszegKrAuzGLLRLsgsBxS2KKEIP3kQlRTqYvK7tpygrzvjKWgK2hoUs44gWwY9uk7wSyqYq vNh+As3q7KWwHQfY0U/F6LkbpMf0DxTEjIu6qXJOAANOKQ==; 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:In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:To:From:Date: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=fl0cWRYvlIoVjT48EbIYUfe5KGaojpJ9Ho7ZKpUfwYg=; b=HuZop0HePszDMKQyjlpG8FSx1y +Ilb0m8b7f0cCVMjT0KKodqnUlCLwY1myKIZdK5Ng35S3+Ewkl87j0uHUGtpaX/8rZFESD60mnzBI vsqi3LiHm3sWSgkL5FPLIu/B9jZrzYC8NgrLgyCKwgIHkQx1Xvrpf9Cb9XJXgLoEYaA/fDnMNHHhr dmK3W/degju4Hp5BbSuKyW/xwICP/hPrLPEJKpCyvv+7qDqL/0O6Oow9RYQPNf0q0e1FEVrJWaaCp mucJvWijJryo3kK1fReVYNPkIdjGZ39EEHgIOHuqGQkt46owD3/w4vZCoFSskCEBQ/hZb+Ss5eH4a qxFIT9YQ==; Received: by zero.zsh.org with local id 1rmXAm-000Kfj-UU; Tue, 19 Mar 2024 10:58:24 +0000 Authentication-Results: zsh.org; iprev=pass (joooj.vinc17.net) smtp.remote-ip=155.133.131.76; dmarc=none header.from=vinc17.net; arc=none Received: from joooj.vinc17.net ([155.133.131.76]:46824) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1rmXAA-000KKv-9D; Tue, 19 Mar 2024 10:57:47 +0000 Received: from smtp-qaa.vinc17.net (135.197.67.86.rev.sfr.net [86.67.197.135]) by joooj.vinc17.net (Postfix) with ESMTPSA id AAFC04E5; Tue, 19 Mar 2024 11:57:45 +0100 (CET) Received: by qaa.vinc17.org (Postfix, from userid 1000) id 71763CA00AB; Tue, 19 Mar 2024 11:57:45 +0100 (CET) Date: Tue, 19 Mar 2024 11:57:45 +0100 From: Vincent Lefevre To: zsh-workers@zsh.org Subject: Re: HIST_IGNORE_DUPS also ignores command lines that differ by a space between quotes Message-ID: <20240319105745.GA4811@qaa.vinc17.org> Mail-Followup-To: zsh-workers@zsh.org References: <20240313123817.GA3492761@cventin.lip.ens-lyon.fr> <20240315125317.GC3738413@cventin.lip.ens-lyon.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/2.2.12+69 (354c5b11) vl-149028 (2023-12-10) X-Seq: 52771 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 2024-03-16 09:00:28 -0700, Bart Schaefer wrote: > On Fri, Mar 15, 2024 at 5:53 AM Vincent Lefevre wrote: > > Note that spelling correction, which occurs *before* the line is put > > in the history, detects quoted text and won't try to correct it. > > Spelling correction is actually performed by the lexer, at the same > time as alias expansion. > > > it seems that "quoted status" can be taken into account at that point. > > Not without separately storing both the original and lexed state of > the text. I don't understand what you mean. The original text does *not* seem to be used, as what is put in the history is the contents *after* spelling correction. Moreover, the difference concerning spaces between word splitting and quoted text is already taking into account for HIST_REDUCE_BLANKS (which I'm using). I don't see why it cannot be used for HIST_IGNORE_DUPS too. qaa:~> echo fil "foo bar" zsh: correct 'fil' to 'file' [nyae]? y file foo bar Recalling the command from the history: qaa:~> echo file "foo bar" As you can see, in the history, "fil" has changed to "file" as corrected, and the 3 spaces after "fil"/"file" have been squashed to a single one due to HIST_REDUCE_BLANKS. > Which is in fact done internally, but for hopefully obvious > reasons is not done in the history file, which (during > reading/writing) is where most duplicate elimination has to occur. The history file is not concerned here. This happens with "zsh -f", where there is no history file: qaa:~> zsh -f qaa% setopt HIST_IGNORE_DUPS qaa% echo "a b" a b qaa% echo "a b" a b qaa% history 1 setopt HIST_IGNORE_DUPS 2 echo "a b" BTW, the zshoptions(1) man page correctly says "history list", not "history file": HIST_IGNORE_DUPS (-h) Do not enter command lines into the history list if they are duplicates of the previous event. -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)