From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Antoine Kalmbach <ane@iki.fi>
Cc: jemarch@gnu.org, emacs-devel@gnu.org
Subject: Re: [ELPA] New package: rec-mode
Date: Thu, 12 Nov 2020 13:38:16 -0500 [thread overview]
Message-ID: <jwvk0uqwhso.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <8lm0yh7dqq4w5h.fsf@iki.fi> (Antoine Kalmbach's message of "Thu, 12 Nov 2020 14:06:18 +0200")
> 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)
next prev parent reply other threads:[~2020-11-12 18:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-07 20:01 [ELPA] New package: rec-mode Antoine Kalmbach
2020-11-07 20:38 ` Stefan Monnier
2020-11-08 10:56 ` Antoine Kalmbach
2020-11-08 14:02 ` Stefan Monnier
2020-11-12 12:06 ` Antoine Kalmbach
2020-11-12 18:38 ` Stefan Monnier [this message]
2020-11-13 15:27 ` Antoine Kalmbach
2020-11-13 15:39 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvk0uqwhso.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=ane@iki.fi \
--cc=emacs-devel@gnu.org \
--cc=jemarch@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).