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 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 10584 invoked from network); 1 Dec 2023 18:27:47 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 1 Dec 2023 18:27:47 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1701455267; b=O5A7AlC3kLHFcCmVD3zdEi49OnOs9B3WS8fqUKceQsIP9bDcwbIy+wj/NB9crs8ZW4E6N2f1uq Gh+AX6z8SpAZdb2cHgrNJDqEyxF4zMALX4dsnyALaKTdG5xqjqTb3fkLN7cB14aQTb3rTyaOIG 6iu0qEnSs3YfPqsxxER0hjksVYR0gcvugeYI7vsYRjnEy1iIvhvBpR/xyraFOyr5p2G/HQJNCU wqfhAL7VzLD7CndGKxqrRVfO0RiW1h4aKGPhBAHAjHtrs9SL2eq+H1ZZfycwx3kPynI6sRhpBm o0YaLsOat/OV1VVlKH3GI11GgxcqOKOdmPCLG+FXjoY00w==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lj1-f171.google.com) smtp.remote-ip=209.85.208.171; dkim=pass header.d=gmail.com header.s=20230601 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=1701455267; bh=RN4panOH+ZbEJ+vlIb+b+bBTge0p/hjVjOiI0GWcUDI=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Cc:To:Subject: Message-ID:Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature: DKIM-Signature; b=RA9JrPV8HAMX88AMQXgXxmK70swC9u851nz3IxxWahx8GgdxXz6g97JJyweb1d5ZJcarvtJQAN pEVVYhQhmSLQ03pg08DzChpa5ICN/9ZKcUHvW/tEpp2/rlSyFwW03LSXn7zT9EHgr/3q0pUIJt THiuVMz0P6k/ubdCZ7YjFrTZWoHJZXZhP557Hjf3eg9Eq63/SqzjlPaeidzjfKj6rStNqhAX7c Xf8ffN7xfS6vy4dZwtuE7m5kOUs91Qk4A8bnrDgdl99w1Tz2gfPORAQSFcJ4gTttwlxl3TWk4V LBXsZw9QnUM1buba7G3dDeuYql7v9NoXIBz4X4CBppcpFg==; 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-Transfer-Encoding: Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=RN4panOH+ZbEJ+vlIb+b+bBTge0p/hjVjOiI0GWcUDI=; b=dum871d4ER1goXoFpFGqOfh4aT ZpC4BcMFz2BKIjY5dOWK+cBa4iEaKXsREUviC8y/o8i9XCfHQFn21FCg2pBsv9KLNnu23LHXoXEiA lAgEfZMTHuG9RzmkF0b7TAJmLLi+RNecOfUy01R7OSEear3Fh65mVXjYmrYrPAOBNpr/2gZ1SMdD4 lbu8sNtQNgfr2ULtrLs1YbCFC6O/3N4BR7t/gs5AqODxsrO5q8Ulc0F7VB5nnoM8R3Ht+i771Ffed iQl8frWavMtF/Z2P39LIi+BTv43dycTKwvRlE2kRapo6fYcl5P4kI2sGMxXfRTVUSVvreRN6Ye0cr +g/sRT3Q==; Received: by zero.zsh.org with local id 1r98Et-000Enx-2R; Fri, 01 Dec 2023 18:27:47 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lj1-f171.google.com) smtp.remote-ip=209.85.208.171; dkim=pass header.d=gmail.com header.s=20230601 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-lj1-f171.google.com ([209.85.208.171]:44508) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1r98Ed-000EUi-Oh; Fri, 01 Dec 2023 18:27:33 +0000 Received: by mail-lj1-f171.google.com with SMTP id 38308e7fff4ca-2c9c1e39defso30775411fa.1; Fri, 01 Dec 2023 10:27:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701455251; x=1702060051; darn=zsh.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=RN4panOH+ZbEJ+vlIb+b+bBTge0p/hjVjOiI0GWcUDI=; b=CYiwymD57RMUm5TC/CLWgtUYm5VWQfX/f2nkVEOGxYiQucykHNLN5u/2rPm5nkW00Z CMO6x9ahFj/z2CQDDd1fHRSXc4bC+LM9q6/su0sy+G8MmmAWtOGqG37qA10v6MM2ufdR eZix1dO+mdahkjRvHv8lP/iHaUEQoYKDrb+qn4TRkgjM0LiKJFQzDBKu4zaiirHZDoFW sseDRgCQfaBApMLs9EbBCdsnqGKmL2TOq6CPlzeqm4lCIr84MxW0PrZNV6hEQBjz741q pCbyux5nzHgJTvnC1taNTqjLtOFDJNf5nZg6kq9CX2o5Zjh24LZh/ryU17pKQG59U5aE wkBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701455251; x=1702060051; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RN4panOH+ZbEJ+vlIb+b+bBTge0p/hjVjOiI0GWcUDI=; b=Olm29BWXwMQRFFI3RT/KKp5h0D2vWG2lsAVUNOg7H4NwPUsP/COWyWGnquwGldO5Cq HzmpV+nfP82Yo7392Wl4J08raWK8lDPLyfhsLj6jURuZawpens8d6AdNEWOcXOpnr24v 6ujLeGd/U/whI1vYPLUAdgcsx6Nt8Pt9NeikrWsuOL6T+ZnPkYb5jgScMauNsu2wxuXy n0+2bG63rWgNhSkiYXrXXm+emoixSUJ+LG99EvBcK71nl1Nttgfvz//JO+ICbuFYPmfb NOLWkotUM3v4HkCAwCz4SqYpEgBt+c+D7rApRrXLckTNrAm2zxUu02DkuJ28s2a8EppQ 4NwQ== X-Gm-Message-State: AOJu0Yxc3OeCpJCh/w9m2tcl5FVpzfa6W/A+ISK6Wtpub/B8Yqbfxu3t wFf5s4qosP8wPXBxJ5Uzl/oyR5hgAkda+OVjGm9TchSU X-Google-Smtp-Source: AGHT+IHBIw1Iex7U2iAnaj26GaJ8VbI/F1jePS8LiBOa0/uHncWFD3qfTYY4C+4BhVAgIWL5QJob/lYH3QOHdEBZSnU= X-Received: by 2002:a2e:b3d7:0:b0:2c9:d874:6f04 with SMTP id j23-20020a2eb3d7000000b002c9d8746f04mr1007054lje.97.1701455250445; Fri, 01 Dec 2023 10:27:30 -0800 (PST) MIME-Version: 1.0 References: <3uINOrbo4IXmuxTPyOMY6U_gv4-qULOThBv5Hd01KcO76FK9AvEFOOIo02fy5VQBIrudqP7rz__wEo1FOG2X2cMLkJzV1wp-1fYkCKYID_8=@protonmail.com> <72dcfda2-9b2b-4c76-8e53-ee3332553edc@app.fastmail.com> In-Reply-To: <72dcfda2-9b2b-4c76-8e53-ee3332553edc@app.fastmail.com> From: Roman Perepelitsa Date: Fri, 1 Dec 2023 19:27:19 +0100 Message-ID: Subject: Re: [PATCH] cd: Append 2nd argument to CWD if 1st is empty To: =?UTF-8?Q?Lawrence_Vel=C3=A1zquez?= Cc: Julian Prein , zsh-workers@zsh.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 52353 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, Dec 1, 2023 at 7:23=E2=80=AFPM Lawrence Vel=C3=A1zquez wrote: > > On Fri, Dec 1, 2023, at 8:32 AM, Julian Prein wrote: > > My motivation to submit this patch was primarily the assumption that sp= ecifying > > an empty argument is an edge case that is not well defined in the docum= entation > > and that the current behaviour is limited in its use cases. To me an ap= pendix > > seems more flexible in the ways a user can utilize this. > > FWIW the current behavior -- while undocumented -- is aligned with > that of ksh, and this change would break that alignment and become > one more thing for ksh emulation to handle. What I like about the current behavior is that it does not require additional documentation. The existing documentation is sufficient. What happens when the first argument is empty is consistent with what happens when it's not: the first matching substring is replaced, which in the case of an empty substring means the beginning of the string. The patch changes a rare case that I don't personally care about, but it also adds a special case, and I do care about special cases in general -- I do not like them. Roman.