syntax based indentation for SQL files (ELPA package proposal)

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

syntax based indentation for SQL files (ELPA package proposal)

Alex Harsanyi
Hello,

I wrote a package that adds support for syntax based indentation for
SQL files: TAB indents the current line based on the syntax of the SQL
code on previous lines.  This works similar to the indentation for
cc-mode.  The current sql-mode does not provide indentation
functionality, and my package implements a minor mode that can be
added to sql-mode to provide syntactic indentation.

I'd like to propose to include the package into ELPA

You can find the source of the package here:

     https://github.com/alex-hhh/emacs-sql-indent

I already posted twice on this mailing list about this package (see
links below).   While the response seemed positive to me, the package
was not added to ELPA but I also I did not receive a definite "not
interested" answer.  I after some thought, I decided to post about
this one last time.

    https://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00075.html
    https://lists.gnu.org/archive/html/emacs-devel/2015-12/msg00943.html

Best Regards,
Alex.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: syntax based indentation for SQL files (ELPA package proposal)

Stefan Monnier
> I already posted twice on this mailing list about this package (see
> links below).   While the response seemed positive to me, the package
> was not added to ELPA but I also I did not receive a definite "not
> interested" answer.  I after some thought, I decided to post about
> this one last time.

>     https://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00075.html
>     https://lists.gnu.org/archive/html/emacs-devel/2015-12/msg00943.html

I think this is very interesting and should either make it into
sql-mode.el or GNU ELPA (or both).  I'll be happy to help, regardless of
the option you choose.


        Stefan


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: syntax based indentation for SQL files (ELPA package proposal)

Steinar Bang
>>>>> Stefan Monnier <[hidden email]>:

> I think this is very interesting and should either make it into
> sql-mode.el or GNU ELPA (or both).  I'll be happy to help, regardless
> of the option you choose.

(FWIW I've felt that the lack of indentation support in the current SQL
mode is unexpected behaviour, so I think that inclusion into sql-mode.el
would be the best thing from a user perspective.)


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: syntax based indentation for SQL files (ELPA package proposal)

Alex Harsanyi
In reply to this post by Stefan Monnier
On Sun, Aug 6, 2017 at 12:05 PM, Stefan Monnier
<[hidden email]> wrote:

>> I already posted twice on this mailing list about this package (see
>> links below).   While the response seemed positive to me, the package
>> was not added to ELPA but I also I did not receive a definite "not
>> interested" answer.  I after some thought, I decided to post about
>> this one last time.
>
>>     https://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00075.html
>>     https://lists.gnu.org/archive/html/emacs-devel/2015-12/msg00943.html
>
> I think this is very interesting and should either make it into
> sql-mode.el or GNU ELPA (or both).  I'll be happy to help, regardless of
> the option you choose.
>

Hi Stefan,

I'm not sure what are the next steps for this?

I already have signed copyright assignment for GNU Emacs contributions
in the past.  The package has another contributor, Pierre T├ęchoueyres,
I'm not sure if he has signed the copyright assignment papers or not
(I just sent him an email asking this).

I don't have commit privileges for either the ELPA or the GNU Emacs
sources, so I cannot add the package myself.

I think this should be a separate package, at least initially.  Based
on feedback from Michael who maintains sql.el, there might be people
who prefer the way sql-mode works now, as it has been like this for a
long time.

Best Regards,
Alex.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: syntax based indentation for SQL files (ELPA package proposal)

Stefan Monnier
> I'm not sure what are the next steps for this?

I think the main question is whether it can/should be included in
sql.el.  Maybe the best strategy is the following:

- add sqlindent.el more-or-less as-is into Emacs's `master` branch as
  lisp/progmodes/sqlindent.el
- change sql.el to use that indentation package by default.

Michael, what do you say?  Do you want to include sqlindent.el directly
into sql.el?

> I already have signed copyright assignment for GNU Emacs contributions
> in the past.  The package has another contributor, Pierre T├ęchoueyres,
> I'm not sure if he has signed the copyright assignment papers or not
> (I just sent him an email asking this).

Yes, he has already signed paperwork for Emacs.

> I think this should be a separate package, at least initially.  Based
> on feedback from Michael who maintains sql.el, there might be people
> who prefer the way sql-mode works now, as it has been like this for a
> long time.

I believe the default behavior should be to enable automatic
indentation.  We can provide some way for the user to disable it, of
course (actually, I think it would make sense to offer a generic minor
mode which provides "dumb" indentation in any major mode).


        Stefan


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: syntax based indentation for SQL files (ELPA package proposal)

Stefan Monnier
> Totally in agreement: include as a separate file and have sql.el use it for indenting by default.

OK.
Should we include it in GNU ELPA (and make sql.el use it only when
available), or should we include it in Emacs?


        Stefan

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: syntax based indentation for SQL files (ELPA package proposal)

John Wiegley
>>>>> "SM" == Stefan Monnier <[hidden email]> writes:

SM> OK. Should we include it in GNU ELPA (and make sql.el use it only when
SM> available), or should we include it in Emacs?

I would prefer ELPA.

--
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2

Loading...