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 0499F22078 for ; Thu, 21 Mar 2024 10:41:49 +0100 (CET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1711014109; b=b+euxEM0lQ1+ASWPWEIp72Ss5gmJgtkXXaHynweKCZik33lA7gzCeYNUZVk4c3JPJlc3doyPEU RRbV7sOJ0wLIBAIAe+zh0cE8mV/c0zgy6/jmJIjNUktdwaaFR8a06b35amV00URI+MZmMrxH3U hf7qiOmPEV1o2dQCcvw/+JYS0lYaPMRelgfjmbZMELXabw6NypgTC9lz/5ytD5sFCE45YZgQdB 2/tS03ZQmdt/igmiQSuQszmHtYwYjyw3tS6tdlKLYzvr/2rZKzpcJ0/FvZYgoC3aitpw3fXXPW CKNVQXRKZPHb3523vbQIk2mlpx0IKRSKLWzon1/WfJGuUA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mta-snd-w01.biglobe.ne.jp) smtp.remote-ip=27.86.113.17; dmarc=none header.from=kba.biglobe.ne.jp; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1711014109; bh=waWqUGuBEkSDffbq8ATqNI0AzXSu4TfjYM7K0BHXqes=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Message-ID:In-Reply-To:To:References:Date:Subject: MIME-Version:Content-Transfer-Encoding:Content-Type:From:DKIM-Signature; b=ZjqzsN4J2Ht79GdxVOOkA3/PxGAo+3T0KFZlUSqNZdC4tqb52d3XpAUb3i4E6sSygQDWp+Sl4M LXDuxlu6FZhf+WtePRpm6R+cMqioyReISCyr4A1qSNOcDGThOcybXWkkEdsBfTay5+TDufiE6/ 0elel7aWcY/XmPP29tYkK46hkbPgMg7F2CYpV6eRFAfBbbAyAswNo2fHcUTqejWi6KmO4FCaV8 Kt6bjEG1sRm7DiC2NF8XiIA/kElXbFVXf/XtjpYxoJIq3J7QJlvU6r4j/cT2BsxCQ1ckUCJZH1 oJvxb9BKeV0tXH/ddvbbNwMTxwguVzqz3ji1FsFUtfeO1g==; 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:Message-Id:In-Reply-To:To:References: Date:Subject:Mime-Version:Content-Transfer-Encoding:Content-Type:From: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=EPUHQXlD63XJDxv3s0In5sx6Df/sBBdfte9p3R4BYh8=; b=J9zAb4AkWSwZOmTqSAVPQXz2RD l1o5JbtoMbOv7ktWyD98xYYg3RJrjdkyDdv8/7WcHZL3l28vg3N537+YTGcAxi3rW8AJyko9HvwVx aKlNs6F7uWU3JUmTtAihhvZ73rSyctIM4q8iv0LdJAHSBNkJQ3IxinzM0Wa+jREf2dnlaPHP3tJ3e mliUZRnzT1L+KuLu/p+7w/MV8VmiSecgS/OnICO1N7h07dcsoColwXPPu52qB+5RUiaemRfXALK9H mZc1qxjirxlLJmiteZx51J4OvLlNVkWqZD0A0klVqV0QHGEZBLgKfmr3n7bBKdHLqUEIi1bmLjwde WgzJPRLg==; Received: by zero.zsh.org with local id 1rnEvl-000Pro-44; Thu, 21 Mar 2024 09:41:49 +0000 Authentication-Results: zsh.org; iprev=pass (mta-snd-w01.biglobe.ne.jp) smtp.remote-ip=27.86.113.17; dmarc=none header.from=kba.biglobe.ne.jp; arc=none Received: from mta-snd-w01.biglobe.ne.jp ([27.86.113.17]:63201) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1rnEvS-000PZe-Fz; Thu, 21 Mar 2024 09:41:32 +0000 Received: from mail.biglobe.ne.jp by omta1012.biglobe.ne.jp with ESMTP id <20240321094123184.TMKR.32237.mail.biglobe.ne.jp@biglobe.ne.jp> for ; Thu, 21 Mar 2024 18:41:23 +0900 From: Jun T Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Subject: Re: HIST_IGNORE_DUPS also ignores command lines that differ by a space between quotes Date: Thu, 21 Mar 2024 18:41:08 +0900 References: <20240313123817.GA3492761@cventin.lip.ens-lyon.fr> <20240315125317.GC3738413@cventin.lip.ens-lyon.fr> <20240319105745.GA4811@qaa.vinc17.org> <20240319123444.GB4811@qaa.vinc17.org> To: zsh-workers@zsh.org In-Reply-To: Message-Id: <8F03279D-3BFF-4612-92A6-78A2C119FBD3@kba.biglobe.ne.jp> X-Mailer: Apple Mail (2.3731.700.6) X-Biglobe-Sender: takimoto-j@kba.biglobe.ne.jp X-Seq: 52787 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: > 2024/03/21 14:36=E3=80=81Bart Schaefer = =E3=81=AE=E3=83=A1=E3=83=BC=E3=83=AB: >=20 > On Wed, Mar 20, 2024 at 10:23=E2=80=AFPM Jun T = wrote: >>=20 >> I think HIST_IGNORE_DUPS would work as expected even without >> HIST_REDUCCE_BLANKS if we use the information in chwords and >> hist_ring->words, as in the patch below, for example. >=20 > Doesn't that require HIST_LEX_WORDS to be set to poplulate ->words > when reading histfiles? I think ->words is always populated; without HIST_LEX_WORDS it may contain wrong info, but for HIST_IGNORE_DUPS only the last event in the history file matters. # If this is a problem, we may set uselex to true for the last event # from the hist file, near line 2821 in hist.c, in function = readhistfile(). > And further, would it not behave differently > for "print -s" vs. "print -S"? Sorry I can't understand this, but: print -S ': "a b"' and print -s : '"a b"' are equivalent. print -s : "a b" is different, but=20 % print -s : "a b" % history -1 1025 : a b # 'a b' is a single word % echo !1025:1 echo a b a b This is quite confusing. With my patch, even with HIST_IGNORE_DUP, % print -s : "a b" % : a b % history -2 1028 : a b # one arg 1029 : a b # two args This may make already confusing situation more confusing. Without my patch the event 1028 is overwritten by the correct one (with two args); somewhat better than with my patch? But anyway use of 'print -s' with args containing spaces is best avoided, I think. BUT: Do we really need the option HIST_REDUCE_BLANKS? I mean, how about making zsh behave always as if HIST_REDUCE_BLANKS is ON? Are there any user who want to keep unnecessary spaces in history? Or calling histreduceblanks() may slow down the interactive zsh?=