emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ELPA] New package: rec-mode


From: Stefan Monnier
Subject: Re: [ELPA] New package: rec-mode
Date: Thu, 12 Nov 2020 13:38:16 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> 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)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]