diff options
Diffstat (limited to 'src/elisp')
-rw-r--r-- | src/elisp/urweb-mode.el | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/elisp/urweb-mode.el b/src/elisp/urweb-mode.el index 9bfa0c96..5e217e1a 100644 --- a/src/elisp/urweb-mode.el +++ b/src/elisp/urweb-mode.el @@ -512,6 +512,12 @@ If anyone has a good algorithm for this..." (beginning-of-line) (current-indentation))) +(defconst urweb-sql-starters + '("FROM" "WHERE" "GROUP" "ORDER" "HAVING" "LIMIT" "OFFSET")) + +(defconst urweb-sql-starters-re + (urweb-syms-re urweb-sql-starters)) + (defun urweb-calculate-indentation () (save-excursion (beginning-of-line) (skip-chars-forward "\t ") @@ -566,6 +572,11 @@ If anyone has a good algorithm for this..." (urweb-indent-default 'noindent) (current-column)))) + (and (looking-at urweb-sql-starters-re) + (save-excursion + (and (re-search-backward urweb-sql-starters-re nil t) + (current-indentation)))) + (and (setq data (assoc sym urweb-close-paren)) (urweb-indent-relative sym data)) |