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,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 12665 invoked from network); 16 Dec 2022 18:05:43 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 16 Dec 2022 18:05:43 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1671213943; b=F2V+wL3dglQEwcyUiDx/H+hX4ATyMqeslhaHGCFnarIz/V+JMj6ZUL3+FcMfZCHCZcNEeLT7BF 2KDI7cWbFnr/Zn+RPdmlrX4vP3G9zvbv1f36X1525vqAXlzmDzk9p+GPEQTfhEnhDgsFGLq1tv /3CYOF48bbklIYe354yiobcufzm4km1LkfILEty/utJPeRX6ju0nyX0RL5aEHbnB1SWqHmbhZG In63yCg+gc+1Wv5Av38Ja53uLiEQidy5efcIx/79tmb/NppCCBWekVmRhsZmv6MRv+hrESd4nA XXN0s2lwUOH+CTn16jq3iT4GgAcMrVjww/1QzCTrJUlwtA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (smtpq2.tb.ukmail.iss.as9143.net) smtp.remote-ip=212.54.57.97; dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256; dmarc=pass header.from=ntlworld.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1671213943; bh=D5scY4EP5kL4m/4ifKwzyTvuCCu6GNH1h4H4AF/TX6Q=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:MIME-Version:Content-Type: References:In-Reply-To:Date:To:From:Subject:Message-ID:DKIM-Signature: DKIM-Signature; b=WxuPEVuM7eMOqkN3wzWe1R0bXB+h1dO5Kt7wv+A1kVOFcgleyr7Fnc+K03/2HaLhR2pHdk6zOV 18/eWiob957QWeEs80KZSdruPuLSTrKt9Y4UBsG+QTeKCFk0i46aw2j8bVQ9PwPYvmk+FDSFku NdL27jysnZm62VnRtKFZrO3rf9DoxO9XfzefCrp5A4rTJ7LNzIgTSKqqn0UWFmOP/8bQHMXJm6 Lsug4jSO+Sf7KRTSVdEmW5zQ/1M5D6+fwJKskVmzMxgDyC16WRHPBm/siu3hiu2Ssdp5rHJtAP D1emE2OWuw8rJWJuOIJJcdA6cnYcnvz4ElngBA3uJpFe9g==; 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: Mime-Version:Content-Type:References:In-Reply-To:Date:To:From:Subject: Message-ID:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=JhVF8LMDgfWan0yjGvcYVvidrp5Ugz8HbPUG6OzKL+8=; b=PKohQI9LA+WafSwCtI6+zuak7b PHNB+hi1ZMiGmKGy9S5zMe8CXwxiw+Xbmebn0hWP/AbMqbvON7fC1VY0lNV5nLDJsMBy0f1d1eru4 lzrVnB62HgU5CasXImgPgu34MFNmdamUaKfV2oJM6zbscs/UlUc9KT6/zNLkgnqS9d+vvxsiXHax0 HKaOjnRzczu9MCJQhwuc634VQskyfbaPmD/w+a104t/8Em3Xv/IYObaNdkUQEZKP2bawsSXA5NvJn zz6rj/bEfyZYjmw5RmHzyFDm2W+ha/t3zaVex8/LseK+7Gm3CpuGG8j6jm0oNgzNeY5smKYIka/0J 6wcrKdIA==; Received: by zero.zsh.org with local id 1p6F5a-000GLv-Nc; Fri, 16 Dec 2022 18:05:42 +0000 Authentication-Results: zsh.org; iprev=pass (smtpq2.tb.ukmail.iss.as9143.net) smtp.remote-ip=212.54.57.97; dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256; dmarc=pass header.from=ntlworld.com; arc=none Received: from smtpq2.tb.ukmail.iss.as9143.net ([212.54.57.97]:51448) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1p6F5N-000G4Q-Vf; Fri, 16 Dec 2022 18:05:32 +0000 Received: from [212.54.57.107] (helo=csmtp3.tb.ukmail.iss.as9143.net) by smtpq2.tb.ukmail.iss.as9143.net with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6F5N-0001hU-Ry for zsh-workers@zsh.org; Fri, 16 Dec 2022 19:05:29 +0100 Received: from pws-Zeus ([82.1.229.179]) by cmsmtp with ESMTPA id 6F5Npy3XMEJRl6F5Np5Jo1; Fri, 16 Dec 2022 19:05:29 +0100 X-SourceIP: 82.1.229.179 X-Authenticated-Sender: p.w.stephenson@ntlworld.com X-Spam: 0 X-Authority: v=2.4 cv=JcB672GV c=1 sm=1 tr=0 ts=639cb369 cx=a_exe a=W4rGJ7PGCSRRUvufKHO8Dg==:117 a=W4rGJ7PGCSRRUvufKHO8Dg==:17 a=IkcTkHD0fZMA:10 a=sHyYjHe8cH0A:10 a=4SgtltaDbZqZD7gTOdAA:9 a=QEXdDO2ut3YA:10 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ntlworld.com; s=meg.feb2017; t=1671213929; bh=JhVF8LMDgfWan0yjGvcYVvidrp5Ugz8HbPUG6OzKL+8=; h=Subject:From:To:Date:In-Reply-To:References; b=GDKnGC5AxxKw7Xb85L5G1LUwupQT7Mcp1BnD6+1O1FkW4m44Py2C1BAj0SroEOFw0 d+YjKSILdMMrUZMX34Mc/Mks6fT3WrPNpq/rIrDisZMP7+uOkWmjyKja+UnxrecUxB 2lE1Ds1nv4fqIxuzc7N5HYBHIDI4MFKM8zDU5BuKcbJ5i4XXdUy/xvU7tz7uVkX8Zt rSzzjYBC6ktlRzDYW32FyVZOmYdr6M8eoTP+HVa2PXHtZMh5A9nazUK0hhL2vqSDib WL85W655G3umNawGaYmTKkCd+CsVQ4tpGGitmMOgy4CL3vdeGfGzwwZYGO6G0GHU8I IBh8haQxeseyA== Message-ID: <7029e4b9dd41e95b61a8cb3ab78aaf4bc254e3ab.camel@ntlworld.com> Subject: Re: zsh_error_db --- hash-based database of error messages From: Peter Stephenson To: zsh-workers@zsh.org Date: Fri, 16 Dec 2022 18:05:29 +0000 In-Reply-To: <20221216174605.GE8411@tarpaulin.shahaf.local2> References: <527664940.183302.1671208973242@mail.virginmedia.com> <20221216174605.GE8411@tarpaulin.shahaf.local2> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4xfOK6GXdOnJV43XztNITGvZCGvwdpxzLuFZ16QhsEyibSKiTnNmAhI48QE9jO1ZZhneFItKUHJLVRmlZPrGqDg90ugq0jGqBVcEQH9RizV7r2b3sL1/S7 +5sehRd+cr5/4Q5CU1Y0geqyWjpri/03runzSIaDi1pOwIkVdrwVjaNxxdJCDEc+urFOkpT50luFWQ== X-Seq: 51226 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, 2022-12-16 at 17:46 +0000, Daniel Shahaf wrote: > Peter Stephenson wrote on Fri, Dec 16, 2022 at 16:42:53 +0000: > > Following on from the retread of the discussion on error messages, > > here's a very simply proof of concept for a hash-based database of > > error messages. Even if it's adopted I don't intend the C code > > to get much larger as the point is to allow it to be able to do > > everything in shell code. > > > > So, tl;dr: > > - Every error message would get an E42 identifier in the source string. > > - The "E42" will be looked up as a string key in a well-known assoc, > where the value will be a more elaborate error message. > > - The more elaborate message, if there is one, will be used instead of > the default message. Yes, that's it in a nutshell; any further complexity would ideally be in shell code. I think at least we need something better than E to try to avoid duplicates, for example E . It's easy to search the file for a duplicate, a bit more of a pain to search the entire codebase. Maybe a two letter code, so we can have ZW for zle_word.c? > Code review below. I think those are all accurate, I'll update for the next version. pws