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,NICE_REPLY_A, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 32626 invoked from network); 10 Mar 2023 04:47:45 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 10 Mar 2023 04:47:45 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1678423665; b=UGJIPHXP9kzJDUHbWohiM3WluqHBS7j96mfUcD9EftmImFvV/frbI6hxZ9ksJihDM1Xe31l3bZ VomuGGm6ououGEre/GSwKSLJ1sTGqn3lKF7PIs3Q+Cw4e9vvzrGET9hIB85flIYqYDhKZqQ/ZV IgkHTI3hUHNpuQl2SThv9DPv6D+N3FJ8PcQA5Jd8plMWx/4Y0qfFiZosHr5eZsxslxnPGfJsQu 9w6gWURL6fUS83bNbEqwZoCe0cfT5pH+jixu2fXz6alGU1aIfF8ChsLlQ4M+0I+DsUDKwDkvAK AavcJr+Phy7NtojBuObHVUhxdSdz/P400NU1HejdHURkSw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lf1-f51.google.com) smtp.remote-ip=209.85.167.51; 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=1678423665; bh=tRhhqGUQJi5/cL7uu8AWNG3PHrfVmKZdQL+xZddJ1Ss=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:In-Reply-To:Subject: From:References:Cc:To:MIME-Version:Date:Message-ID:DKIM-Signature: DKIM-Signature; b=qXSCZZRA6bJmNJzBZQ88BaZndJ+NPbNei6O5qBRmeU2C0C8Y+bcifuLBlkflGQb4CRW2xxAc0T 16AbXMto917CnOkkjAH+T4SmOirMges4VWUvOW8K5wwcgAEsT4f8VZr3QhxRDhgsEdqqKP7REN O4oNd06sOvUrKmIKfAY1At+rAfuVadOhfJP0uT05JaQmPJxWVIhZLhDIlwWmTTFJ8SmkKWQv/h 24ixZg40Z4/VXCjlq9svUM8dKPTKTRg2RGrVlC7hbxYpncEddUfxVNKgQWORd9bICYW7eduWF2 gqj1+21HLi+/LuqPZtUxTh5A07jCZycxVkZc0Lt9GpnxlQ==; 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:In-Reply-To:Subject:From:References:Cc:To:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=3PVcGK9Jx56N9aDy3As11DTFHKbBO3mC8+pgsBjhh+A=; b=RAIlzBfcKf0F3JWpt9iS68rFpt eVwiFygY7dcrWnAVBA9Uh/nhIQU9iTnsfDAMaCMvFtI1KIqHACzKtqZEBonyylTYSkdnc2/xlDCTx yEnEWwkF+RT42xJpyFNoIhy8J9azU8Rn8o+IgdCMvue1/DSCZmQQJlanZd7Wr9vIBhndTXMJnuZwh Cf/LKhpskJVixhoxbPyn3DvXOfmNE2ypujJ2BJZCtoTzmytthyXLmxF2p7rvfea/zaoaNRIQWI6XF lnc4hYoVpZ71yw+uwSMJGQ/RiI4PGpPCtMUm583pbUgqKbMtpUczWms/1XU5NA3J1qqMRD2ymdpkF FB3G+IGQ==; Received: by zero.zsh.org with local id 1paUfQ-00023a-Jk; Fri, 10 Mar 2023 04:47:44 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lf1-f51.google.com) smtp.remote-ip=209.85.167.51; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-lf1-f51.google.com ([209.85.167.51]:43969) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1paUf8-0001lQ-SE; Fri, 10 Mar 2023 04:47:27 +0000 Received: by mail-lf1-f51.google.com with SMTP id r27so5072165lfe.10 for ; Thu, 09 Mar 2023 20:47:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678423646; h=content-transfer-encoding:in-reply-to:subject:from:content-language :references:cc:to:user-agent:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=3PVcGK9Jx56N9aDy3As11DTFHKbBO3mC8+pgsBjhh+A=; b=F6C5TA8gVOqZLYziAx8LLWs2u296Q6yO25JWDczEH9csK/Qc6FHlQblqMwkHegradf 5+aHrKHwa7AfPVhXyzQMT8RsSKDdV6KBqW1eDG06So1GzH1Vif9yCNTUHi2Hdfcje2XC HkySxCBgOlqtJVoLG+EUbcSOST/TGwh0Lv7eZDzgFdtV/bEO+q9j3udPFRtaDHg5294g SoB+lxOewUrscmxcanI/AS1XixhXiDqf/aQ9FuTxryHXsArhb02s4FwpPNhIMSTrJFhY 5auQHs5FhILyosD+BlT2ZPdgny8v5UGCYCwY6k4bziBUrFXtpJSZhNnas7JZEz5RHYdI mTdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678423646; h=content-transfer-encoding:in-reply-to:subject:from:content-language :references:cc:to:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=3PVcGK9Jx56N9aDy3As11DTFHKbBO3mC8+pgsBjhh+A=; b=KT/B5/z09/ZhjzHY8yuLMNCwn0Qmyai3JZCx6Yb/M+w8pxNApDsLA5JV62k3vi5u68 WM2FLaIKWURjkO/+mPhxlVo19R3Jffyw4WStJWkt22nvqADK7O6NwSeMMfpohQC5Xo0D eh7f3tevMC+gNVzjO6K4aMT/8WpxVEaLqd73dV5b7KdN+KawqKE2XguzOyNoKaPLUlkb kpmt5xObVJtTwtLf9N1GSmLjSVnWRN7BCCMqqPFANg1hYG2/ADWe/dDri7cO5Rw6gDlM Ym61TON6Px0A6mycGKTH1LXFRhzgOsXP8MPKUptCfOGlp0ZiUmHtc634QRN0EGxkQB7I +jQA== X-Gm-Message-State: AO0yUKWGX5AEwt/1zvNW3m+PmNhKDnhw+SJtkAqY1YuzbknOirP/3xCT 2byzf5ry7FD+uhXyf6OrE/I= X-Google-Smtp-Source: AK7set9fcow296lPPCW8eWJfXFHG32RHgO/GHh8hydSibPvQOeEdQP/QztpZVMA2SkHBBBjVP/ba6Q== X-Received: by 2002:ac2:4c0d:0:b0:4e0:fe29:9313 with SMTP id t13-20020ac24c0d000000b004e0fe299313mr6519823lfq.15.1678423645761; Thu, 09 Mar 2023 20:47:25 -0800 (PST) Received: from ?IPV6:2a00:62c0:c1e:c900:2814:4cff:fe04:80b? ([2a00:62c0:c1e:c900:2814:4cff:fe04:80b]) by smtp.gmail.com with ESMTPSA id f2-20020ac24e42000000b0049c29389b98sm121373lfr.151.2023.03.09.20.47.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 Mar 2023 20:47:25 -0800 (PST) Message-ID: <56087c9f-b450-1520-37d9-6209f681d960@gmail.com> Date: Fri, 10 Mar 2023 07:47:23 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 To: Mikael Magnusson Cc: zsh-workers@zsh.org References: <20230309174316.11290-1-ufh8945@gmail.com> Content-Language: en-US From: Nikita Romanyuk Subject: Re: [PATCH] correct: add support for colemak layout In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Seq: 51548 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: If I understood correctly, we shouldn't use setopt for changing keyboard layouts because it's not expandable. Better, there should be a separate builtin function. How should it be called? "setlayout"? "setkblayout"? Thanks, I didn't put any brain activity into this enum. > OPT_SIZE should always go last in this list. I'm going to send another patch later, but with these options as builtins. On 3/10/23 06:37, Mikael Magnusson wrote: > 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 >> >> >> >