emacs-libpq icon indicating copy to clipboard operation
emacs-libpq copied to clipboard

Try to submit module to GNU Emacs

Open gnusupport opened this issue 6 years ago • 32 comments

Could you please submit your module for inclusion into GNU Emacs?

It works well, so why not submit it directly to inclusion into GNU Emacs?

https://lists.gnu.org/archive/html/help-gnu-emacs/

gnusupport avatar Jun 24 '19 12:06 gnusupport

I didn't think there was widespread enough interest in a postgres client interface to consider getting something upstream in the first place. Also, I'm afraid the current module form is probably not the right format to do that. After all, the module interface was designed to allow independent distribution, and the lack of any modules being shipped with emacs seems to confirm that.

@marsam appears to have experimented with getting it distributed via ELPA? I don't see any modules already in ELPA, though - is it even possible to distribute modules with the current ELPA infrastructure?

Another blocker might be that the FSF needs copyright assignments to get things into either emacs or ELPA. I do have an assignment on file, but not sure @marsam does…

anse1 avatar Jun 24 '19 18:06 anse1

If there is or not, does not matter. But this module is making wonders. I am managing my database with this module and helm. I have personal contact management or CRM system to manage with this module. It iwll create impact.

I suggest that you try to include it into GNU Emacs by writing to the list.

Yes FSF needs copyright assignments, why not.

gnusupport avatar Jun 25 '19 14:06 gnusupport

I am making application based on emacs-libpq and asking on emacs-devel how to include module as such. I would have several applications to be submitted to ELPA based on this module.

One application is like hyperlink management in tabular mode, that is so much similar to browsing something like gopher, it could browse from server to server all by using PostgreSQL, it is similar to augment from Engelbart.

Other applications would be like invoice and other customer management systems, marketing, mailings, and similar.

gnusupport avatar Oct 19 '20 07:10 gnusupport

Thanks for the nice words. I also got requests via other channels and it seems there is more demand for this module than I anticipated. I also read rumors that there are already some packages in ELPA that include C code. I just merged a pull request from @tgbugs in that direction, but I need to read up more on the ELPA machinery...

I was hoping @marsam could confirm he has files with the FSF for contributions to Emacs and its extensions. But maybe it can still be argued his was a minor contribution and thus okay without a copyright assignment on file.

anse1 avatar Oct 19 '20 18:10 anse1

Hi, sorry for the delay. I don't have a copyright assignment yet, I'll try to get one tonight.

marsam avatar Oct 19 '20 19:10 marsam

Thanks for the nice words. I also got requests via other channels and it seems there is more demand for this module than I anticipated. I also read rumors that there are already some packages in ELPA that include C code. I just merged a pull request from @tgbugs in that direction, but I need to read up more on the ELPA machinery...

I was hoping @marsam could confirm he has files with the FSF for contributions to Emacs and its extensions. But maybe it can still be argued his was a minor contribution and thus okay without a copyright assignment on file.

You can look into emacs-vterm module how they made it that module is installable and that it builds and compiles the software.

It would be so great to have PostgreSQL module in GNU ELPA, that people can develop various applications. I have some of them.

You may write to emacs-devel AT gnu.org mailing list and make any questions about that.

gnusupport avatar Oct 19 '20 19:10 gnusupport

Hi, sorry for the delay. I don't have a copyright assignment yet, I'll try to get one tonight.

Any progress?

Do you need help?

gnusupport avatar Oct 28 '20 15:10 gnusupport

@marsam please send email to emacs-devel AT gnu.org and you will get copyright assignment form. That is message I have got today from there.

gnusupport avatar Nov 01 '20 15:11 gnusupport

Sorry for the delay. The past week, Craig from gnu kindly guided me through the process. I already sent my signed assignment form to assign AT gnu.org, and IIUC I've to wait to FSF to sign it.

I don't want to block the release in elpa. If you can place my contributions as minor, and okay without a copyright assignment, please go ahead.

marsam avatar Nov 01 '20 16:11 marsam

Sorry for the delay. The past week, Craig from gnu kindly guided me through the process. I already sent the my signed assignment form to assign AT gnu.org, and IIUC I've to wait to FSF to sign it.

Nonetheless, I don't want to block the release in elpa. If you can place my contributions as minor, and okay without a copyright assignment, please go ahead.

That is such a great news to hear Mario!

I cannot place that, maybe I can help with checks for the package and then you will do it. You may read Tips in the Emacs Lisp manual.

It will open a spectrum of applications to be served straight from main Emacs.

gnusupport avatar Nov 01 '20 19:11 gnusupport

I just received my copyright assignment :)

marsam avatar Nov 06 '20 14:11 marsam

I just received my copyright assignment :)

That is great news. What is next step?

gnusupport avatar Nov 06 '20 18:11 gnusupport

GNU Support writes:

I just received my copyright assignment :)

Thank you very much ^^

That is great news. What is next step?

I did look at how emacs-vterm distributes their module via ELPA in the meantime. They just invoke their cmake based build when the module is not available while loading the package. I am surprised that ELPA itself doesn't have any module awareness...

While this is more ad-hoc than I expected I guess I'll just arrange that. Maybe adding autoconf to reduce the risk that people have to adjust the Makefile when installing from elpa. If that's done, I'll do the coming-out thing mentioned in the ELPA docs.

anse1 avatar Nov 06 '20 19:11 anse1

While this is more ad-hoc than I expected I guess I'll just arrange that. Maybe adding autoconf to reduce the risk that people have to adjust the Makefile when installing from elpa. If that's done, I'll do the coming-out thing mentioned in the ELPA docs.

You may start now as sooner you start you will get support on emacs-devel to polish better.

Please just start.

gnusupport avatar Nov 10 '20 13:11 gnusupport

Is there anything left to include it? I would like to help on this I just don't know how. It will greatly enhance Emacs and cause many new modules to come into ELPA. I have already several candidates.

gnusupport avatar Apr 27 '21 09:04 gnusupport

See video here: https://open.tube/videos/watch/822b0367-d6d1-456f-a592-9b078d69cead

I could submit then modules for example, for invoice making, address book, DB backed version control system, SMS mass communication, and so on.

gnusupport avatar Apr 27 '21 10:04 gnusupport

That looks really nice. I am going to work on this issue in this weekend :)

marsam avatar Apr 27 '21 14:04 marsam

I'd like to add this to GNU ELPA. AFAICT all the contributors have signed copyright paperwork, and I assume you understand and agree that it implies getting copyright paperwork from all future contributors before you can accept their code.

Any objection? [ There will be a few technical things to adjust to make the package easier to install, but ... one step at a time. ]

monnier avatar Feb 14 '22 13:02 monnier

No objections here. Happy to help in any way.

tgbugs avatar Feb 14 '22 18:02 tgbugs

No objections here. Happy to help in any way.

Great. Then:

  • Please replace (require 'pq-core) with (if t (require 'pq-core)) so that we don't get a silly compilation error when installing the package (where Emacs tries to compile pq.el and fails because there's no pq-core, the if t avoids running the require during compilation).

  • Could you clarify which URL is the official upstream? I see we're discussing this here in https://github.com/anse1/emacs-libpq yet pq.el says

      ;; URL: https://github.com/tgbugs/emacs-libpq
    
  • The readme says "An Emacs 25 modules ....", so pq.el should probably say something like:

    ;; Package-Requires: ((emacs "25"))
    

monnier avatar Feb 14 '22 20:02 monnier

Could you clarify which URL is the official upstream?

Yes. It is anse1. At the time pq.el didn't exist on anse1 so I used the url to point to my fork. I will submit a PR with the correction along with the other bits mentioned here.

tgbugs avatar Feb 14 '22 21:02 tgbugs

Tom Gillespie [2022-02-14 13:08:15] wrote:

Could you clarify which URL is the official upstream? Yes. It is anse1. At the time pq.el didn't exist on anse1 so I used the url to point to my fork. I will submit a PR with the correction along with the other bits mentioned here.

Great, please also adjust the copyright lines to say that the copyright has been transferred to the FSF, i.e. replace the "Copyright ... by Tom Gillespie" with something like:

;; Copyright (C) 2020-2022  Free Software Foundation, Inc.

for pq.el. Also please add the copyright+license blurb at the beginning of pq-core.c.

[ Next will be figuring out how to make it easy for the user to compile the module. Also, it'd be nice to add support for bignums, available since Emacs-27. ]

monnier avatar Feb 14 '22 21:02 monnier

I've adjusted the copyright and added the copyright and blurb to pq-core.c. I'm not going to be of much use getting the bignum support implemented. IIRC from this thread @anse1 had taken a look at how to build the module an a more if it was not found. It looks like emacs-zmq might provide inspiration in addition to vterm? https://github.com/nnicandro/emacs-zmq/blob/master/zmq.el#L659-L693

tgbugs avatar Feb 14 '22 22:02 tgbugs

I've adjusted the copyright and added the copyright and blurb to pq-core.c.

I see this is still waiting in the pull request. Anything blocking it?

monnier avatar Feb 18 '22 14:02 monnier

I think we are just waiting on @anse1 at this point.

tgbugs avatar Feb 22 '22 20:02 tgbugs

Tom Gillespie writes:

I think we are just waiting on @anse1 at this point.

merged.

monnier writes:

[ Next will be figuring out how to make it easy for the user to compile the module. Also, it'd be nice to add support for bignums, available since Emacs-27. ]

I'll try to look into the former next week. I made a separate issue #22 for the bignum-support.

thanks, andreas

anse1 avatar Feb 25 '22 11:02 anse1

Andreas Seltenreich [2022-02-25 03:20:34] wrote:

Tom Gillespie writes:

I think we are just waiting on @anse1 at this point. merged.

Thanks. The resulting tarball should appear shortishly at

http://elpa.gnu.org/devel/pq.html

But I'll note a few more cosmetic issues that should be fixed:

  • test.el is too generic a name. I currently marked it as excluded from the tarball, but for those who install directly from Git it would still be good to rename it, for example to pq-test.el.

  • test.el and pq-core.c lack a proper copyright and license (GPLv3+) header.

  • pg_type.h should come with some license information, maybe just an SPDX line.

I'll try to look into the former next week. I made a separate issue #22 for the bignum-support.

Thanks, I'll try to find some time to look at the "automate the module build" packaging issue.

monnier avatar Feb 25 '22 17:02 monnier

But I'll note a few more cosmetic issues that should be fixed:

  • test.el is too generic a name. I currently marked it as excluded from the tarball, but for those who install directly from Git it would still be good to rename it, for example to pq-test.el.

  • test.el and pq-core.c lack a proper copyright and license (GPLv3+) header.

  • pg_type.h should come with some license information, maybe just an SPDX line.

These still need to be fixed.

I'll try to look into the former next week. I made a separate issue #22 for the bignum-support. Thanks, I'll try to find some time to look at the "automate the module build" packaging issue.

Could you try the patch below see if it works for you?

    Stefan

diff --git a/.gitignore b/.gitignore index 9f8c20a9e2..2c16467025 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,7 @@ .so ##

+*.elc +/pq-autoloads.el +/pq-pkg.el

diff --git a/pq-compile.el b/pq-compile.el new file mode 100644 index 0000000000..574aa4c0bc --- /dev/null +++ b/pq-compile.el @@ -0,0 +1,61 @@ +;;; pq-compile.el --- Compile the pq-core module -- lexical-binding: t; -- + +;; Copyright (C) 2022 Free Software Foundation, Inc. + +;; Author: Stefan Monnier @.***> +;; Keywords: + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see https://www.gnu.org/licenses/. + +;;; Commentary: + +;; + +;;; Code: + +(defvar pq--compile-directory

  • (file-name-directory
  • (or
  • (if (fboundp 'macroexp-file-name) (macroexp-file-name)) ;Emacs≥28
  • load-file-name
  • buffer-file-name
  • (locate-library "pq"))))

+(defun pq--compile-module ()

  • "Compile the `pq-core' module."
  • (with-temp-buffer
  • (setq default-directory pq--compile-directory)
  • (let* ((exitcode (call-process "make" nil t)))
  •  (if (zerop exitcode)
    
  •      (message "Compilation of `pq-core' succeeded")
    
  •    (let ((out (buffer-string)))
    
  •      (with-current-buffer (get-buffer-create "*pq-compile*")
    
  •        (setq default-directory pq--compile-directory)
    
  •        (let ((inhibit-read-only t))
    
  •          (erase-buffer)
    
  •          (insert out))
    
  •        (compilation-mode)
    
  •        (pop-to-buffer (current-buffer))
    
  •        (error "Compilation of `pq-core' failed")))))))
    

+(defun pq--compile-maybe ()

  • ;; FIXME: Should we first try it silently (i.e. without prompting the user)?
  • (if (not (y-or-n-p "PQ needs to compile the `pq-core' module. Do it now?"))
  •  (message "Continuing without `pq-core'; some operations may fail")
    
  • (pq--compile-module)
  • (require 'pq-core)))

+(provide 'pq-compile) +;;; pq-compile.el ends here diff --git a/pq.el b/pq.el index b7a943355b..796c09ced7 100644 --- a/pq.el +++ b/pq.el @@ -1,8 +1,8 @@ -;;; pq.el --- libpq binding +;;; pq.el --- libpq binding -- lexical-binding: t; --

;; Copyright (C) 2020-2022 Free Software Foundation, Inc.

-;; Author: Tom Gillespie +;; Author: Tom Gillespie @.***> ;; URL: https://github.com/anse1/emacs-libpq ;; Version: 0.01 ;; Package-Requires: ((emacs "25")) @@ -26,7 +26,25 @@

;;; Code:

-(if t (require 'pq-core)) +(require 'pq-core nil t) ;Don't signal an error if the module is absent. + +;; Try and compile the `pq-core' module when we compile the PQ package. +(eval-when-compile

  • (unless (or (featurep 'pq-core)
  •          ;; Try and avoid running this code when we're just
    
  •          ;; loading the uncompiled `pq.el'.
    
  •          (and (fboundp 'macroexp-compiling-p) ;Emacs≥28
    
  •               (not (macroexp-compiling-p))))
    
  • (require 'pq-compile)
  • (declare-function pq--compile-module "pq-compile" ())
  • (ignore-errors (pq--compile-module))))

+;; Try and compile the `pq-core' module when the PQ package is loaded. +(unless (featurep 'pq-core)

  • (require 'pq-compile)
  • (declare-function pq--compile-maybe "pq-compile" ())
  • (pq--compile-maybe))

(provide 'pq)

monnier avatar Apr 06 '22 21:04 monnier

Ping?

monnier avatar May 05 '22 21:05 monnier

Will take a look.

tgbugs avatar May 05 '22 21:05 tgbugs