all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alex Harsanyi <alexharsanyi@gmail.com>
To: emacs-devel@gnu.org
Subject: smart indentation for SQL files
Date: Mon, 21 Dec 2015 19:42:18 +0800	[thread overview]
Message-ID: <CAH-ciFogkPiOkTfX17iUmNRd6ECnTfCTWnimXFDK-jQ35CNzNg@mail.gmail.com> (raw)

Hello,

About 10 years ago I had to edit many SQL files and the sql-mode that shipped
with GNU Emacs did not provide any smart indentation.  At the time, I wrote a
small indentation package, which I used for several months but never released
publicly.

Shortly after, I changed jobs and didn't have to look at SQL files again until
recently. I noticed that the SQL indentation support is still missing from
Emacs and to my surprise my old code worked just fine.

I cleaned up the old code a bit, added suport for indenting WITH statements
and uploaded it to Github at:

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

The code is similar to cc-mode, in that it separates the "parsing" of the SQL
code from the indentation and the indentation rules can be modified by the
user to conform to local indentaiton guidelines or preferences.

I think this code would be a nice addition to sql.el.

Best Regards,
Alex.



             reply	other threads:[~2015-12-21 11:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-21 11:42 Alex Harsanyi [this message]
2015-12-22  5:39 ` smart indentation for SQL files John Wiegley
2015-12-23 12:27   ` Alex Harsanyi
2015-12-23 17:35     ` John Wiegley
  -- strict thread matches above, loose matches on Subject: below --
2017-05-03  9:12 Alex Harsanyi
2017-05-03 21:32 ` Stefan Monnier
2017-05-04 10:15   ` Alex Harsanyi
2017-05-04  0:55 ` Clément Pit-Claudel

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=CAH-ciFogkPiOkTfX17iUmNRd6ECnTfCTWnimXFDK-jQ35CNzNg@mail.gmail.com \
    --to=alexharsanyi@gmail.com \
    --cc=emacs-devel@gnu.org \
    /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.