From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [ELPA] New package: rec-mode Date: Thu, 12 Nov 2020 13:38:16 -0500 Message-ID: References: <8lm0yh7dqq4w5h.fsf@iki.fi> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32616"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: jemarch@gnu.org, emacs-devel@gnu.org To: Antoine Kalmbach Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Nov 12 19:42:49 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kdHYX-0008NZ-5k for ged-emacs-devel@m.gmane-mx.org; Thu, 12 Nov 2020 19:42:49 +0100 Original-Received: from localhost ([::1]:52034 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kdHYW-0007H7-5H for ged-emacs-devel@m.gmane-mx.org; Thu, 12 Nov 2020 13:42:48 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48336) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kdHUG-0002Vf-7P for emacs-devel@gnu.org; Thu, 12 Nov 2020 13:38:24 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:50445) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kdHUD-0006Qe-PY; Thu, 12 Nov 2020 13:38:23 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id B0BA7441037; Thu, 12 Nov 2020 13:38:19 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id B0277441026; Thu, 12 Nov 2020 13:38:17 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1605206297; bh=i98fHVrh4302xL21fMskkrVBcSvPrs+TG3bIwsHRnbk=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=FcEQ21bVmM70lbCzq1iZAZaZzWTpldEc6EEuaT3EWuWiOigEkmzmoXN0/5I+dWTKl jSMNrQkXU/H3mlu35ZCtaclrS9gYlW3LZSbCIR+NJuLnUWGH0KQWxUemfbblwvvSGg zIsoPKpLecaKNxX64NF6L2+mTm4YuFG1oGdetcZSiFca58JTBNW4M/IrJaTF0O/CGP aGaveWX3Tmfy9ByXowOAScOF43Kkc1CmmwbDfqG6la/Ej4o1O7Z1XWoqGU5PBmg3Wt /ntALO/InF+4me+unlatpOCyAxjcTjLyKmQWgf6TbgVwUE2cvptk6/B41//Dg73lMB 3+8dR9nU/8u1Q== Original-Received: from alfajor (unknown [157.52.9.240]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 8053A1203D6; Thu, 12 Nov 2020 13:38:17 -0500 (EST) In-Reply-To: <8lm0yh7dqq4w5h.fsf@iki.fi> (Antoine Kalmbach's message of "Thu, 12 Nov 2020 14:06:18 +0200") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/12 13:38:19 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:259099 Archived-At: > Here it is: https://git.savannah.gnu.org/cgit/recutils/rec-mode.git Thanks, installed in elpa.git. It should appear in a GNU ELPA near you soonish. >> See patch below if you want some inspiration. > Thanks. That was... quite some inspiration. I applied your patch. > Then, I fixed most checkdoc errors, font locking, and some of the > FIXMEs. I think now the package is ready to be pulled into ELPA. Great, thanks. > We haven't folded ob-rec.el into rec-mode.el, though. I'm working on > adding Flymake/Imenu/ElDoc support, I'll fold it in after that. BTW, of the remaining FIXMEs, I think 2 are plain bugs: - The one in `rec-parse-type`. - The one about looking-at in `rec-check-type`. I'm just not familiar enough with the system to be able to trigger/test them to confirm my understanding of the code. The "obvious" fix would look like the patch below. Stefan diff --git a/rec-mode.el b/rec-mode.el index fb6dacbf73..d94d7da8e1 100644 --- a/rec-mode.el +++ b/rec-mode.el @@ -1199,8 +1199,8 @@ manual." (rec-type--create (intern kind) str nil))) ((equal kind "size") (when (looking-at "[ \n\t]*\\([0-9]+\\)[ \n\t]*$") - ;; FIXME: A missing `'type'? Should it call `rec-type--create'? - (list (intern kind) str (string-to-number (match-string 1))))) + (rec-type--create' (intern kind) str + (string-to-number (match-string 1))))) ((equal kind "range") (when (or (looking-at "[ \n\t]*\\(-?[0-9]+\\)[ \n\t]*$") @@ -1250,7 +1250,7 @@ manual." ((equal kind 'range) (let ((min (car data)) (max (cadr data))) - (when (looking-at "-?[0-9]+$") ;FIXME: `type' relates to text at point? + (when (string-match "\\`-?[0-9]+\\'") (let ((number (string-to-number (match-string 0)))) (and (>= number min) (<= number max)))))) ((equal kind 'real)