all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Mauger <mmauger@protonmail.com>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: Michael Mauger <michael@mauger.com>,
	Alex Harsanyi <alexharsanyi@gmail.com>,
	"pierre.techoueyres@free.fr" <pierre.techoueyres@free.fr>,
	"simenheg@gmail.com" <simenheg@gmail.com>,
	"emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: Re: syntax based indentation for SQL files (ELPA package proposal)
Date: Sun, 16 Sep 2018 01:11:11 +0000	[thread overview]
Message-ID: <LDdvSJzB4262d3TJn6Hx_Kl8lLddrEGJAfTQe6R1L-1KRDgyFQNiorm6cgw5i6lX6xnqU4YJvr_U9_8tVI-lFg==@protonmail.com> (raw)
In-Reply-To: <jwv4lewkz9o.fsf-monnier+emacs@gnu.org>

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Tuesday, 11 September 2018 08:16, Stefan Monnier <monnier@IRO.UMontreal.CA> wrote:

> >> 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).
> > > I'm happy to see that sql-indent was added to ELPA last year, but I
> > > agree with Stefan that it would be even better if SQL mode offered
> > > automatic indentation by default, like major modes usually do.
> >
> > I could make an attempt to integrate it with SQL mode, with an option to
> > turn it off, if there is interest for it?
>
> The main prerequisite for that would be to move sql-indent from elpa.git
> to emacs.git. I think it's a good idea to bring sql.el and
> sql-indent.el closer to each other (an alternative would be to move
> sql.el to elpa.git, but that's probably not gonna fly), but it's rather
> a question for Alex, Michael, and Emacs's maintainers.
>
> Stefan

Apologize for the delay... My thought was that we can add default support
with the two modules in different repositories (although I have no concern
about either proposal made by Stefan: sql, sql-indent both to emacs.git or
to elpa.git). Below is an initial attempt to perform the integration that
could be added to sql.el. In addition, the initial values of `sql-mode-hook'
and `sql-interactive-mode-hook' would be set to '(sql-indent-enable).

Code (un-tested)::

    ;; SQL indent support
    (defcustom sql-use-indent-support t
      "If non-nil then use the SQL indent support features of sql-indent.
    The package must be available to be loaded and activated.")

    (defun sql-is-indent-available ()
      "Check if sql-indent module is available."
      (when (locate-library "sql-indent")
        (require 'sql-indent)
        (fboundp 'sqlind-minor-mode)))

    (defun sql-indent-enable ()
      "Enable `sqlind-minor-mode' if available and requested."
      (when (sql-is-indent-available)
        (sqlind-minor-mode (if sql-use-indent-support +1 -1))))

I'd also recommend we add a large comment block to sql.el recommending
the installation of sql-indent if not installed by default.

--
MICHAEL@MAUGER.COM // FSF and EFF member // GNU Emacs sql.el maintainer





  reply	other threads:[~2018-09-16  1:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-06  2:42 syntax based indentation for SQL files (ELPA package proposal) Alex Harsanyi
2017-08-06  4:05 ` Stefan Monnier
2017-08-06  6:35   ` Steinar Bang
2017-08-06 13:30   ` Alex Harsanyi
2017-08-06 17:54     ` Stefan Monnier
     [not found]       ` <j3XyL-aaKw13ov6PDSlK6YTLNYM6WwKGtS-OW5wgKzI9C4QQ1lDjHvosCxVSOEbqEaQOThHg4DKnPLVJO9ogqg==@protonmail.com>
2017-08-14  9:51         ` Stefan Monnier
2017-08-14 20:47           ` John Wiegley
2018-09-11 10:09       ` simenheg
2018-09-11 12:16         ` Stefan Monnier
2018-09-16  1:11           ` Michael Mauger [this message]
2018-09-16 21:30             ` Stefan Monnier
2018-10-01 12:56               ` Michael Mauger
2018-10-01 18:24                 ` Stefan Monnier
2018-10-01 22:31                 ` Andy Moreton
2018-10-02 12:57                   ` Stefan Monnier
2018-10-02 13:48                     ` Andy Moreton
2018-10-02 14:24                       ` Van L
2018-10-02 16:07                       ` Stefan Monnier
2018-10-02 13:49                     ` Thomas Fitzsimmons

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='LDdvSJzB4262d3TJn6Hx_Kl8lLddrEGJAfTQe6R1L-1KRDgyFQNiorm6cgw5i6lX6xnqU4YJvr_U9_8tVI-lFg==@protonmail.com' \
    --to=mmauger@protonmail.com \
    --cc=alexharsanyi@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=michael@mauger.com \
    --cc=monnier@IRO.UMontreal.CA \
    --cc=pierre.techoueyres@free.fr \
    --cc=simenheg@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.