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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 28845 invoked from network); 6 Mar 2023 22:45:15 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 6 Mar 2023 22:45:15 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1678142715; b=PvvRekTq2X0ZjCGnQO4gyCw7Xs5p1mTB92IxYlD3nAj+u2MuCMkIhGtP/IS99IT5rSXNmo4cTT YEfLV+GvumE1Qzp6dkS77ItEYKzDpUvlvqaAueleRZG+KAYMqtlf1KZ6Yz7UX3gWmJOrB1DiIP ugQWOC+VqiEcyZuyOtOPzl2mxq6pkrXcgjKFi1tOoSbT1HjB1zz+2rFq8O48AOBWp0jVfzVnKA Le+bj1NkzbLXBMeNDsSch+iXCodhmOCG2dhdAFIoGvr1dYU6Wm/7Fss4Jaw1A9m3RU6qD9EB8X 79i2ycXFKCMV4RjC5FQNnyRKUmPOzv9O0SYH9NiMYPDwqg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ed1-f45.google.com) smtp.remote-ip=209.85.208.45; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1678142715; bh=70r3KX6u4SGI5etIWc42HF7fAjVtfDASWFNWuZi00Es=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:MIME-Version: DKIM-Signature:DKIM-Signature; b=msG8MVsPqN7ikzs+Ax++4rmtKcJqSOAKPDL7tIvTCrBdk2+oMHjPO2ZzILJm0hdT2Hmb6bQOAK LGImamZbGl08a2m3OsmUPsdmUEKBepoGkZcZEaN2K8FXZyFuwIonZDlHPwr4v6rZbOF7BZszhp TCe2HO7cW3Pmc3L8LXPRaWGqalFIn3LXAfMIVQ1McfX2sm6n9KvI0H5nFCFKe7VlW13+wDyekx YUtR068uEqT5/GDglV0Za0RqoSOCHakigi+98FJsHtWRRfMgsOqnqIuqsPqIlIbf6Kh/FKzdyH KkHyjJE0lTIQ9z7i6HO/UHvkF1ngi+Wb92xpf3OBTqVtNw==; 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:To:Subject:Message-ID: Date:From:MIME-Version:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References; bh=mjJflblYjSnIccwGPdLCiWOyvsvCmalddXTCtYzMSXk=; b=LjK5KVUeZAfIqMum6YGPEKSMKF 8+aOfbqpmq1Q15JoZnCzhfFkOO1BuKfoGVsDQJfMNILSbIqbq/zhEGN0vdgg09fPZ5xY87IlIbStD 7rMcJQesG8lcLP7k1SDf3SQ0hMQiHn6GIKrw+/VdmfFDVW5zMu2Y+Tx6seCvFJkTaH7E+KdoEGoCn OLnjbz9xI+HH27MC2d3bMH1DpeXuMkHLVU5XeaPQH6e3XWV9f9i31wJ38jHYNKbYnjHa3xF8I0uoz ILnQbfknI8wZf5ENyZ3clzFkWU1OuwyrCKTFNTSX5WEY3rA0tKQL62qUwDt166DRrxM+KqrhGYUB4 JeGbzdcw==; Received: by zero.zsh.org with local id 1pZJZy-00039T-4n; Mon, 06 Mar 2023 22:45:14 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ed1-f45.google.com) smtp.remote-ip=209.85.208.45; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ed1-f45.google.com ([209.85.208.45]:35440) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1pZJZN-0002pp-7R; Mon, 06 Mar 2023 22:44:37 +0000 Received: by mail-ed1-f45.google.com with SMTP id u9so45356549edd.2 for ; Mon, 06 Mar 2023 14:44:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20210112.gappssmtp.com; s=20210112; t=1678142676; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=mjJflblYjSnIccwGPdLCiWOyvsvCmalddXTCtYzMSXk=; b=7FjdX8D7eFiSsAJHplItA0zhQciFW47AM8UBLzYzyzCmFPVyWrNnV1ujNiY1GbQ1m0 jKbeZy8d0kYzdw7iT4BmjI/JrhzWiMgTqNDj8MetVTEqyglyk8p1nZZ72C2jmqReuNAA iGWPXe9Keh9/HZPWP7QWko9qGh+EJfH2m1G4lLnMSZq7I94Dva4SagGVsIOx4OE0ZGri GXID4sO+x+TIF855Ish867rUZ2Z5UQazugibXqe9xQyRcx4AcFTADn6yEo7gT/iS1V0g AZmOAGmtojsr5oExAR6L+q/l5AP8aScX4767+GYakUjA9yrlaoDoPTE6JZrYGyEePs2z gPIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678142676; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=mjJflblYjSnIccwGPdLCiWOyvsvCmalddXTCtYzMSXk=; b=JhlLCHxfRNrbqTVxVZUL/lPHwWTt4wtbZCf6S0NVtmmobki5GNIggkr371ZZ/48t9h vqA/ooCJt+vd+c3qAWXzcerSN0FFqHoqlipdPsiI47fiD7VW25txrfSyxmY1UOXuZSPm DUMdXMttAMK1mho0174swHV5b3mOB9SO5gbug0SHlVtwYmZC87OOJBnpL+Adqg0SEe0l khirNy9HMNBsmXq1bVcBUvcEHHOFZ85EFqfwS49Na6oRS4Kd2g165VrqbtHlF79u4s28 6U8JZ0gbn8Hoij4c6bXkxq+7ntLAUL5UDtnZd0DA+PHrG5pZCm+9qwZuf6k5fdprYlrc T6Gw== X-Gm-Message-State: AO0yUKXK9aE8Q7+mefldj8DkAMfxe0qXn8CkdSNeYFTJz2gZoBn/obC+ mQemRZ48m7DIsQ3sCK6pyTbILSER8lSUZ1A08X/19Ml06GakRRnxu0Y= X-Google-Smtp-Source: AK7set/rknu/3RCRRBQPuOvzBZQD1QPgmbkqajAneAQ9ebpUc9lOMnrZMZ7b1lDKAVyPySd8VVaCLBN5JcOVvU5Lo1o= X-Received: by 2002:a17:906:d51:b0:8b1:cd2e:177a with SMTP id r17-20020a1709060d5100b008b1cd2e177amr6219452ejh.6.1678142676296; Mon, 06 Mar 2023 14:44:36 -0800 (PST) MIME-Version: 1.0 From: Bart Schaefer Date: Mon, 6 Mar 2023 14:44:05 -0800 Message-ID: Subject: setopt emacs / vi again To: Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 51525 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: Back in workers/50729, Jun T wrote: > Use of EMACS/VI should be highly discouraged, since turning them off > has no effect, and they are meaningless if a user-defined keymap > is in use. There was a subsequent patch in workers/50851 that includes some doc updates: > item(tt(EMACS))( > If ZLE is loaded, turning on this option has the equivalent effect > +of `tt(bindkey -e)'. In addition, the tt(VI) option is unset. > Turning it off has no effect. The option setting is > +not guaranteed to reflect the current keymap, and the tt(LOCALOPTIONS) > +option does not work correctly. This option is provided only for > +compatibility, and its use is highly discouraged. tt(bindkey) is the > +recommended interface. > ) and similar wording for setopt vi, along with some code changes so that bindkey commands force the option settings to match the selected main keymap. (It's still a bit of a shortcoming that there is no way to query which keymap is currently linked.) > In doshfunc() we can't tell to which keymap we should link the 'main' > keymap because both EMACS and VI may be off in the saved opts[]. As is probably obvious from recent patches, I've been noodling around with ksh93, and consequently I re-discovered the origin of the emacs and vi setopts: ksh has set -o vi set -o emacs set -o gmacs (the latter probably more recent than the zsh attempt to copy them). The key point in relation to the zsh options is that, in ksh93, if none of these options is set, then line editing is completely disabled -- the zsh equivalent of "unsetopt zle". There's no question of which keymap to link, because there isn't any keymap at all. I'm not suggesting that we actually do this in zsh -- I think the current state is likely the best we can do. However, if we again discuss deprecating these setopts, it may be useful to know where they came from and how they affect ksh emulation.