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 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 25151 invoked from network); 10 Mar 2023 03:38:15 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 10 Mar 2023 03:38:15 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1678419495; b=TzUs1adqr35IPJJyeJP62/Ijlx8vaaavrVlQDpn4jQ1S7m41BJZP6CDwAs9TKu5h5Y7jq+nRSL EGgsqeu5IafFbWO98pFfV+9wpuWR+Mb3LvBnaJw+GMfa3ozFEjQ7J0IvD+dP9W5pvHA5e7+m5x 3XS4qO/iCwSLAfLP7Vo180aDfWrzscWjJt6S2oFPMYV3VP55Fv/TfJiPD23CiuGFoeNSVUP6BN raIU5sNsm5+/n8vhbS8A9AFidPT4TeqBdL7voxKc8NYiv1uKewSDV648/qzdH2x6hv18a0zuzq 3bjN9mRmRET4rxm/EtHRLbcxEgEQVNjQtYTE7tDCc0KOvQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ed1-f49.google.com) smtp.remote-ip=209.85.208.49; dkim=pass header.d=gmail.com header.s=20210112 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=1678419495; bh=ChVcWQOguLd2Ob48jWl6/dKKHFGOc9FPlgGxTIzQKh4=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:References: In-Reply-To:MIME-Version:DKIM-Signature:DKIM-Signature; b=F5tUmK+QHLcy7MXMFjVyPI/kDXJ8YAk7iraTmpJS2v9uak0wZOtc8cdW4FojuCclLHtCyUEsCp snufvRN3MtJdrNo8X2uAOF2CWkUspeM9FK9lVYbcq9NVZlR/Mq/yXzg3VnWt1rtNvKNqtFug8Y mX/C6uFUkrb3kMqdpBOF+N054qToBScU3UidtohPxqewGla/k2UNB5C9xu9brMXk3ZjjqgVKcH Zsi4L8AkJIS9AXFT3arjJmuIvnYjb9abVzxUZd3m1wBUWtQQ6Qn7NYJzyIk5V8oAA2rXxEtPMI ydnLTRl+1s0B+MSiWnf0KKDUuhgKMVwTaz5oy0WDuuoSfA==; 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:Cc:To:Subject:Message-ID :Date:From:References:In-Reply-To:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=vszV/SI2dT46C+LKhjYP0GfMIJo2RAMTmjmwFCAy9to=; b=S7n3t5l+nlbJp5TpNmCe5um3dX 5Td6Qli7a4Kk5aMHBY6rT81ZzcucUU+qd4nPUHLWCuUifZMbu7w77uZYRMB8oM4zSNZ2RZ/r9Ax82 eANwcr3rlI2/PaB+EFasv6FFbD+ck4yB1vVvCXpRRlzNICmEMsmHGWcyJIULCYKIlwC/55hYwL7q1 xRz/pQxDP72dfirexeC0ztE1A0yXSfvMxaYmUpDc6vI/B/LjiEP0HvFUC05otJ6Q3oCE0m0WWKBAI CwNYi4Wmnbud5NxPZLSPawqsXeyPhL892R1HPgR2cKFbRtQqGfU8et5Rg5E1YKfbTvpFW5VqoJ+Pl WnXdzxDg==; Received: by zero.zsh.org with local id 1paTa9-000Ppj-72; Fri, 10 Mar 2023 03:38:13 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ed1-f49.google.com) smtp.remote-ip=209.85.208.49; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-ed1-f49.google.com ([209.85.208.49]:42620) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1paTZZ-000PWc-08; Fri, 10 Mar 2023 03:37:38 +0000 Received: by mail-ed1-f49.google.com with SMTP id o12so15276012edb.9 for ; Thu, 09 Mar 2023 19:37:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678419456; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=vszV/SI2dT46C+LKhjYP0GfMIJo2RAMTmjmwFCAy9to=; b=ESjui/Ub5XN7eRo+uoEBzodL8FZnVTwt8SYv4JSu/OEHJ7T/h+kXraMuPbKQvDsDgc Ur6rxjl7spG5uVFwh9A+mEyCyT+VXv3X6FoSgzteFU4cWMQ/VbUEulgce5sYBPAMSgTP SVT/gPE7D4Y5jSeGCyCOr7m4X11AFmdeRA+aZNH2s1WKSslnETRBs7CNeKlh251gaDvs f4wMSh9+rEt8lWFLNi1iFiAq4u/QRkCpw0/qRJvXXNxa5h2RAySDucjKBlY2FOkMGqu/ BkQrT58Az2wfMYehqYyVKJAWoX+e7Vm5S86evzCyZ7Viqj/HB7Vu2H0UY3H08uBa8e+H Nn9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678419456; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=vszV/SI2dT46C+LKhjYP0GfMIJo2RAMTmjmwFCAy9to=; b=wa5XwMS9yi+Zj2o7ZkgSw59FDGbMRURXgP5/wKKmTpFtW1nyfbNZtlkXyO2wSphZFp zNA3d75Xi45PVOD0CoOjD08WxEDrpCG3adGjpP5TcsUFCK7l8onaAk4gJa20AfO+q0vc 6AisFBGpxHDwhGagg5mfGRgq7kXRPnrJmpucarVbWFZyIaqxS+uVBvzEWf/p3MTIINvp dXVLVgcEh0Usg1ZAHdQNuqONtzKd1ZF8AMM9hmqGeuV/g2795msXGSnjvEk3oloULclB pHtdqLHfrpfdBqFTXxbMYacvZm4aEevNxrn9gWbOLftq2mgvmecJLoermMDOa+/vNHeV ZbcQ== X-Gm-Message-State: AO0yUKWpA/pcSZoTEJ9CkhUhajVNKWQd55ui2EOLl0jmCf2qV+i3B7Kz QF9c9XdARJc67dBah0SOae36p76PqY2g0FCTOus= X-Google-Smtp-Source: AK7set/+NDe2TS49hJr83ivM8NKMcHlWdFaPBSdL/bMlexZ8xbaLWHqqd0LjxEelNm88Z7wCJnGFc3Tbo/f9Mjnxd/A= X-Received: by 2002:a17:906:a14:b0:8b2:d30:e728 with SMTP id w20-20020a1709060a1400b008b20d30e728mr12380444ejf.1.1678419456181; Thu, 09 Mar 2023 19:37:36 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a17:907:6d9e:b0:8fc:2473:c0d5 with HTTP; Thu, 9 Mar 2023 19:37:35 -0800 (PST) In-Reply-To: <20230309174316.11290-1-ufh8945@gmail.com> References: <20230309174316.11290-1-ufh8945@gmail.com> From: Mikael Magnusson Date: Fri, 10 Mar 2023 04:37:35 +0100 Message-ID: Subject: Re: [PATCH] correct: add support for colemak layout To: Nikita Romanyuk Cc: zsh-workers@zsh.org Content-Type: text/plain; charset="UTF-8" X-Seq: 51547 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 3/9/23, Nikita Romanyuk wrote: > Colemak is a modern alternative to the QWERTY and Dvorak layouts, > designed for efficient and ergonomic touch typing in English. It would be nice to not introduce another weird tri-state thing here, eg what should happen when both dvorak and colemak are set, why is qwerty not a named option, etc. Perhaps it would be nicer to just let the user set the layout in some special (namespaced?) parameter for scalability and deprecate the dvorak option. We could have some helper function in the distribution that sets this parameter for various known layouts. > Signed-off-by: Nikita Romanyuk > --- > Doc/Zsh/options.yo | 8 ++++++++ > Src/options.c | 1 + > Src/utils.c | 14 ++++++++++++++ > Src/zsh.h | 3 ++- > 4 files changed, 25 insertions(+), 1 deletion(-) > > diff --git a/Doc/Zsh/options.yo b/Doc/Zsh/options.yo > index 443676b..cda4b33 100644 > --- a/Doc/Zsh/options.yo > +++ b/Doc/Zsh/options.yo > @@ -1235,6 +1235,14 @@ Use the Dvorak keyboard instead of the standard > qwerty keyboard as a basis > for examining spelling mistakes for the tt(CORRECT) and tt(CORRECT_ALL) > options and the tt(spell-word) editor command. > ) > +pindex(COLEMAK) > +pindex(NO_COLEMAK) > +pindex(NOCOLEMAK) > +item(tt(COLEMAK))( > +Use the Colemak keyboard instead of the standard qwerty keyboard as a > basis > +for examining spelling mistakes for the tt(CORRECT) and tt(CORRECT_ALL) > +options and the tt(spell-word) editor command. > +) > pindex(FLOW_CONTROL) > pindex(NO_FLOW_CONTROL) > pindex(FLOWCONTROL) > diff --git a/Src/options.c b/Src/options.c > index a1fe918..8f9fe85 100644 > --- a/Src/options.c > +++ b/Src/options.c > @@ -280,6 +280,7 @@ static struct optname optns[] = { > {{NULL, "stdin", OPT_ALIAS}, /* ksh */ SHINSTDIN}, > {{NULL, "trackall", OPT_ALIAS}, /* ksh */ HASHCMDS}, > {{NULL, "dvorak", 0}, DVORAK}, > +{{NULL, "colemak", 0}, COLEMAK}, > {{NULL, NULL, 0}, 0} > }; > > diff --git a/Src/utils.c b/Src/utils.c > index 62bd3e6..b3d09d7 100644 > --- a/Src/utils.c > +++ b/Src/utils.c > @@ -4607,10 +4607,24 @@ spdist(char *s, char *t, int thresh) > \t\"<>PYFGCRL?+\t\ > \tAOEUIDHTNS_\n\t\ > \t:QJKXBMWVZ\n\n\t\ > +\n\n\n\n\n\n\n\n\n\n\n\n\n\n"; > + const char colemakkeymap[] = > + "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\ > +\t1234567890-=\t\ > +\tqwfpgjluy;[]\t\ > +\tarstdhneio'\n\t\ > +\tzxcvbkm,./\t\t\t\ > +\n\n\n\n\n\n\n\n\n\n\n\n\n\n\ > +\t!@#$%^&*()_+\t\ > +\tQWFPGJLUY:{}\t\ > +\tARSTDHNEIO\"\n\t\ > +\tZXCVBKM<>?\n\n\t\ > \n\n\n\n\n\n\n\n\n\n\n\n\n\n"; > const char *keymap; > if ( isset( DVORAK ) ) > keymap = dvorakkeymap; > + else if ( isset( COLEMAK ) ) > + keymap = colemakkeymap; > else > keymap = qwertykeymap; > > diff --git a/Src/zsh.h b/Src/zsh.h > index 40f9ea5..93f3c8c 100644 > --- a/Src/zsh.h > +++ b/Src/zsh.h > @@ -2547,7 +2547,8 @@ enum { > XTRACE, > USEZLE, > DVORAK, > - OPT_SIZE > + OPT_SIZE, > + COLEMAK OPT_SIZE should always go last in this list. > }; > > /* > -- > 2.39.2 > > > -- Mikael Magnusson