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 7255 invoked from network); 27 Oct 2022 05:34:58 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 27 Oct 2022 05:34:58 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1666848898; b=sNzMazJokSzFYDCZVaLC6lWb5L36MwPniUiHk1qhmKh+I4IAKI+QAsL2556E5wz1uzkWUc544L 5TgBlt3mhDTrjdvfuvZiUn1yfES4Z7g0ewyc7raSgbwBHKqYRUkvC9qLEsxG9nrvg6EIJssQKf MO1/SqBo+lPFl2kOV8dB93HvqMfLPy24nHuO4/rR/Yagdh1r7kv0p57qpl1ZdvEqgs/C/MBwL4 RQPSuZgiP48VBY1Rm65xJWSe7NtaT+qH8J3LcCzQwgMyC4K3CgIiLlG90rRs64AZCxtrvIz8Y7 oDN94cqfnLOnjlt4Zh8gQpI5/Ju7gzN/wWHNPvL/As1MWw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (snd00013-bg.im.kddi.ne.jp) smtp.remote-ip=27.86.113.13; 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=1666848898; bh=gcYpHF+UuTkVup2ucIxMRb07/MQDnRRwGg/8oL+en+g=; 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=el5aKaNZzvw2Ljl0HHffYp26ldTsb+NQqnn54m42EQJAIm5CNgsntO0mgm0lKmHhJL5ieP9kdH D8ewO7/TNFKzpjT9J4Mu11DeRPo4CDKxJ0L9rRtsDASN5PnxEHiWJoNuWSlAIYtAKXRIB4YT94 tjJTaO48WCDoPBhpU1t9juD8YNl8ee53PY4DhK161KU7Ya5chct+Ga8Mc8D2p/cU/PfNyso7EG cnQIeQv60PLLy8XacjTQtkbkmEoZAuKbAC26aoQJucJ2UrA0rlmNv5xyTtCnuRruogRSPAWX7f C7pbYueOo0Hd/GGW6WBzyhF5KF7mTZpknf6W21l74ASh+Q==; 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=wSPniGOSx2bweQa1QZDUlElrj6DEAU0WmIGuPKCJNJM=; b=GvsKG3Gk7ZO/Q0MQa48EdvptYs pZTbSs0uVu5AREHKtFA/XwS8EyhGfsX8Rd/KgoBXhfSqYyO5bHWtW/+Y6PnnxS8N3KgX+9HxYINs0 147ytXxi9WWA51ADARt2z1M1bTvrKSeDWCnBdKHJojK0t8OEDjzv8DTznjbBYYcZifL4mAKBHUzDl rMiPlst3WRis5KCS5e28uosBAjjbdszbOyS/1b14qSYucGDOIM/9jOEW60Pa3LtatoBVEyh0fZ+CQ SLobABXYcHZkqXRfiPB7jt17WU18HVWeIz7QYS9WpruOOXFhwKp1l/vnv8uyZDgeKHzlS5HGVNHkV OyH6i7SQ==; Received: by zero.zsh.org with local id 1onvXd-000H6C-5D; Thu, 27 Oct 2022 05:34:57 +0000 Authentication-Results: zsh.org; iprev=pass (snd00013-bg.im.kddi.ne.jp) smtp.remote-ip=27.86.113.13; dmarc=none header.from=kba.biglobe.ne.jp; arc=none Received: from snd00013-bg.im.kddi.ne.jp ([27.86.113.13]:16224 helo=dfmta0009.biglobe.ne.jp) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1onvX1-000Gme-Hd; Thu, 27 Oct 2022 05:34:21 +0000 Received: from mail.biglobe.ne.jp by omta0009.biglobe.ne.jp with ESMTP id <20221027053412351.GZYC.128985.mail.biglobe.ne.jp@biglobe.ne.jp> for ; Thu, 27 Oct 2022 14:34:12 +0900 From: Jun T Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.21\)) Subject: Re: [PATCH] out of memory error after "edit-command-line" Date: Thu, 27 Oct 2022 14:34:11 +0900 References: <16F15191-2C2A-4292-8DC7-7134C024E417@kba.biglobe.ne.jp> To: zsh-workers@zsh.org In-Reply-To: <16F15191-2C2A-4292-8DC7-7134C024E417@kba.biglobe.ne.jp> Message-Id: <2D734D59-80DF-464C-8536-7301E5C53D1F@kba.biglobe.ne.jp> X-Mailer: Apple Mail (2.3445.104.21) X-Biglobe-Sender: takimoto-j@kba.biglobe.ne.jp X-Seq: 50851 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: > 2022/10/19 18:12, Jun T wrote: >=20 > Instead of fixing this problem, I feel it is better to do > nothing for 'setopt localoptions emacs'. Here is a revised patch. Do nothing for EMACS/VI options, and add a few comments in the description of these options in options.yo. diff --git a/Doc/Zsh/options.yo b/Doc/Zsh/options.yo index bf73664c9..445052617 100644 --- a/Doc/Zsh/options.yo +++ b/Doc/Zsh/options.yo @@ -2550,10 +2550,12 @@ pindex(NO_EMACS) pindex(NOEMACS) item(tt(EMACS))( If ZLE is loaded, turning on this option has the equivalent effect -of `tt(bindkey -e)'. In addition, the VI option is unset. +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. This option is -provided for compatibility; tt(bindkey) is the recommended interface. +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. ) pindex(OVERSTRIKE) pindex(NO_OVERSTRIKE) @@ -2582,10 +2584,12 @@ pindex(NO_VI) pindex(NOVI) item(tt(VI))( If ZLE is loaded, turning on this option has the equivalent effect -of `tt(bindkey -v)'. In addition, the EMACS option is unset. +of `tt(bindkey -v)'. In addition, the tt(EMACS) option is unset. Turning it off has no effect. The option setting is -not guaranteed to reflect the current keymap. This option is -provided for compatibility; tt(bindkey) is the recommended interface. +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. ) pindex(ZLE) pindex(NO_ZLE) diff --git a/Src/exec.c b/Src/exec.c index f2911807c..c8bcf4ee5 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -5961,11 +5961,23 @@ doshfunc(Shfunc shfunc, LinkList doshargs, int = noreturnval) emulation =3D funcsave->emulation; sticky =3D funcsave->sticky; } else if (isset(LOCALOPTIONS)) { + /* we need to call inittyptab() if these options change */ + int init_typtab =3D +#ifdef MULTIBYTE_SUPPORT + funcsave->opts[MULTIBYTE] !=3D opts[MULTIBYTE] = || +#endif + funcsave->opts[BANGHIST] !=3D opts[BANGHIST] || + funcsave->opts[SHINSTDIN] !=3D opts[SHINSTDIN]; + /* take care of SUNKEYBOARDHACK but not of EMACS/VI */ + if (funcsave->opts[SUNKEYBOARDHACK] !=3D = opts[SUNKEYBOARDHACK]) + keyboardhackchar =3D funcsave->opts[SUNKEYBOARDHACK] ? = '`' : '\0'; /* restore all shell options except PRIVILEGED and = RESTRICTED */ funcsave->opts[PRIVILEGED] =3D opts[PRIVILEGED]; funcsave->opts[RESTRICTED] =3D opts[RESTRICTED]; memcpy(opts, funcsave->opts, sizeof(opts)); emulation =3D funcsave->emulation; + if (init_typtab) + inittyptab(); } else { /* just restore a couple. */ opts[XTRACE] =3D funcsave->opts[XTRACE]; diff --git a/Src/options.c b/Src/options.c index a1fe918fc..a994b563e 100644 --- a/Src/options.c +++ b/Src/options.c @@ -904,7 +904,11 @@ dosetopt(int optno, int value, int force, char = *new_opts) keyboardhackchar =3D (value ? '`' : '\0'); } new_opts[optno] =3D value; - if (optno =3D=3D BANGHIST || optno =3D=3D SHINSTDIN) + if ( +#ifdef MULTIBYTE_SUPPORT + optno =3D=3D MULTIBYTE || +#endif + optno =3D=3D BANGHIST || optno =3D=3D SHINSTDIN) inittyptab(); return 0; }