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: Sat, 07 Nov 2020 15:38:44 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> The major mode, rec-mode[1], is currently distributed as a part of the main
> recutils tarball.  It makes sense also to offer this package via ELPA as
> well.  The source code for this package is available on Savannah[2].

Sounds good.

> The major mode would most likely be maintained as either a subtree or
> external,

Nowadays we prefer `external`.

> a development version will anyway be hosted in the
> recutils.git repository.

That's going to be inconvenient unless you keep it in a separate branch
(otherwise, you can't just push/pull between elpa.git and recutils.git,
so you end up fighting to convince Git to keep the history of
rec-mode.el without bringing along all the history of recutils, plus
ignore all the other files plus remember that `etc/rec-mode.el` in one
is just `rec-mode.el` in the other, etc...).

> Some minor things that need to be addressed before the package can be
> submitted formally, but these are fairly trivial to address:
>
>   * Use of `cl' rather than `cl-lib'
>   * Adding required package.el headers for the major mode

Actually, we can fix those afterwards.  If you want help with that, just
ask (but beware that I'll also change it to lexical-binding and won't
be able to resist making various other cosmetic changes like using
`define-derived-mode`).

> Then it comes down to copyright assignment: we need to check if
> committers to rec-mode.el have given copyright assignment to FSF for
> GNU Emacs.

Actually it doesn't have to be "for GNU Emacs", but rather for their
contribution (i.e. it could be covered by another assignment such as one
for the recutils package, tho AFAIK there are no such assignments).

> This is true for authors Jose E. Marchesi (maintainer of
> GNU Recutils), Daiki Ueno, and yours truly.  Author Julio C. M. Ramirez
> does not have Emacs copyright assignment.  The question remains, is the
> change in his commit[3] small enough to be considered trivial?  I would
> say so.

The patch is mostly reindentation (find below its
`diff-ignore-whitespace` rendering), so it's definitely trivial enough.

Side question: Can we fold ob-rec.el into rec-mode.el?
(I'm not familiar with org-babel's way of working, but it would seem
like a natural arrangement, just like major modes contain support code
for font-lock, imenu, indentation, completion, ...)

diff --git a/etc/rec-mode.el b/etc/rec-mode.el
index aa24849..65d1e61 100644
--- a/etc/rec-mode.el
+++ b/etc/rec-mode.el
@@ -1860,12 +1860,14 @@
       (rec-beginning-of-record))
     (rec-goto-next-field)))
 
-(defun rec-cmd-goto-next-rec ()
+(defun rec-cmd-goto-next-rec (&optional n)
   "Move the pointer to the beginning of the next record in the
 file.  Interactive version."
-  (interactive)
+  (interactive "P")
+  (when (null n) (setq n 1))
   (widen)
   (let ((record-type (rec-record-type)))
+    (dotimes (i n)
     (if (save-excursion
           (and (rec-goto-next-rec)
                (equal (rec-record-type) record-type)
@@ -1877,16 +1879,18 @@
       (if (not (rec-record-type))
           (message "No more records")
         (message "%s" (concat "No more records of type "
-                              (rec-record-type))))))
+                               (rec-record-type)))))))
   (unless rec-editing
     (rec-show-record)))
 
-(defun rec-cmd-goto-previous-rec ()
+(defun rec-cmd-goto-previous-rec (&optional n)
   "Move the pointer to the beginning of the previous record in
 the file.  Interactive version."
-  (interactive)
+  (interactive "P")
+  (when (null n) (setq n 1))
   (widen)
   (let ((record-type (rec-record-type)))
+    (dotimes (i n)
     (if (save-excursion
           (and (rec-goto-previous-rec)
                (equal (rec-record-type) record-type)
@@ -1898,7 +1902,7 @@
       (if (not (rec-record-type))
           (message "No more records")
         (message "%s" (concat "No more records of type "
-                              (rec-record-type))))))
+                               (rec-record-type)))))))
   (unless rec-editing
     (rec-show-record)))
 




reply via email to

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