emacs-devel
[Top][All Lists]
Advanced

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

Re: [ELPA] New package: kixtart-mode


From: Stefan Monnier
Subject: Re: [ELPA] New package: kixtart-mode
Date: Wed, 09 Nov 2022 17:04:17 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Hi Morgan,

> I'd like to submit language support for KiXtart as a GNU ELPA package
> (patch is attached).

Thanks, looks good.  Find below my sig a suggested patch to fix a few
minor issues I found along the way (the main one is arguably the way
`kixtart-tempo-tags` is passed to `tempo-define-template`).

> There is a slight complication in that there is an old kixtart-mode
> package on MELPA which just provided some font locking. I do have
> permission from the author of this previous package to take over the
> package name, effectively replacing the MELPA package with the new GNU
> ELPA package. See confirmation from the author of the previous package
> here: https://github.com/ryrun/kixtart-mode/issues/2

Looks fine from here.

> I have gone through the FSF copyright assignment process and received
> confirmation that it was successfully completed.

The only issue on my side is that your name doesn't yet appear in the
`copyright.list` file I can get from the FSF.  Sometimes the FSF clerk
forgets to update the file on the server, so it's nothing to worry about
(and sometimes it's a mismatch in the names I use which make my searches
fail).

> Would there be any issues in adding the package?

There is one issue, yes: is KiXtart Free Software?
According to Wikipedia, the license is "Closed source Careware".
And indeed, I can't find any source code on http://www.kixtart.org/.
If that's indeed proprietary code, then I think we probably wouldn't
want to host `kixtart-mode` on (Non)GNU ELPA.


        Stefan


diff --git a/kixtart-mode.el b/kixtart-mode.el
index 0cb8b9edc4..72b7dc6724 100644
--- a/kixtart-mode.el
+++ b/kixtart-mode.el
@@ -848,7 +848,7 @@ removed when template insertion is interactive."
                  (remove 'p template)
                template))))
 
-(defconst kixtart-tempo-tags nil
+(defvar kixtart-tempo-tags nil
   "Tempo tags for KiXtart Mode.")
 
 (define-abbrev-table 'kixtart-mode-abbrev-table nil
@@ -863,18 +863,17 @@ TAG, DOCUMENTATION, and ELEMENTS are passed directly to
 `tempo-define-template'.  TAG is also used as the abbrev string
 which will be expanded to the template."
   (declare (indent 2))
-  (let ((template (gensym)))
-    `(let ((,template (tempo-define-template (concat "kixtart-" ,tag)
-                                             (quote ,@elements)
-                                             ,tag
-                                             ,documentation
-                                             kixtart-tempo-tags)))
-       (define-abbrev kixtart-mode-abbrev-table ,tag "" (identity ,template)
+  (let ((funname (intern (concat "kixtart-template-" tag))))
+    `(progn
+       (defalias ',funname
+         (tempo-define-template (concat "kixtart-" ,tag)
+                                (quote ,@elements)
+                                ,tag
+                                ,documentation
+                                'kixtart-tempo-tags))
+       (define-abbrev kixtart-mode-abbrev-table ,tag "" #',funname
          :system t)
-       (put (identity ,template) 'no-self-insert t)
-       (defalias (intern (concat "kixtart-template-" ,tag))
-         (identity ,template)
-         ,documentation))))
+       (put ',funname 'no-self-insert t))))
 
 (kixtart--define-template
     "while"
@@ -962,16 +961,16 @@ which will be expanded to the template."
     (define-key map (kbd "C-c C-t C-b") #'tempo-backward-mark)
     (define-key map (kbd "C-c C-t C-f") #'tempo-forward-mark)
     (define-key map (kbd "C-c C-t C-t") #'tempo-complete-tag)
-    (define-key map (kbd "C-c C-t I") 'kixtart-template-ifelse)
-    (define-key map (kbd "C-c C-t c") 'kixtart-template-case)
-    (define-key map (kbd "C-c C-t d") 'kixtart-template-do)
-    (define-key map (kbd "C-c C-t e") 'kixtart-template-foreach)
-    (define-key map (kbd "C-c C-t f") 'kixtart-template-for)
-    (define-key map (kbd "C-c C-t i") 'kixtart-template-if)
-    (define-key map (kbd "C-c C-t l") 'kixtart-template-else)
-    (define-key map (kbd "C-c C-t s") 'kixtart-template-select)
-    (define-key map (kbd "C-c C-t u") 'kixtart-template-function)
-    (define-key map (kbd "C-c C-t w") 'kixtart-template-while)
+    (define-key map (kbd "C-c C-t I") #'kixtart-template-ifelse)
+    (define-key map (kbd "C-c C-t c") #'kixtart-template-case)
+    (define-key map (kbd "C-c C-t d") #'kixtart-template-do)
+    (define-key map (kbd "C-c C-t e") #'kixtart-template-foreach)
+    (define-key map (kbd "C-c C-t f") #'kixtart-template-for)
+    (define-key map (kbd "C-c C-t i") #'kixtart-template-if)
+    (define-key map (kbd "C-c C-t l") #'kixtart-template-else)
+    (define-key map (kbd "C-c C-t s") #'kixtart-template-select)
+    (define-key map (kbd "C-c C-t u") #'kixtart-template-function)
+    (define-key map (kbd "C-c C-t w") #'kixtart-template-while)
     (define-key map (kbd "C-c C-u") #'kixtart-up-script-block)
     map))
 




reply via email to

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