Function: sqlind-lineup-to-clause-end
sqlind-lineup-to-clause-end is a natively compiled function defined in
sql-indent.el.
Signature
(sqlind-lineup-to-clause-end SYNTAX BASE-INDENTATION)
Documentation
Line up the current line with the end of a query clause.
This assumes SYNTAX is one of in-select-clause, in-update-clause, in-insert-clause or in-delete-clause. It will return an indentation so that:
If the clause is on a line by itself, the current line is
indented by sqlind-basic-offset, otherwise the current line is
indented so that it starts in next column from where the clause
keyword ends.
Argument BASE-INDENTATION is updated.
Source Code
;; Defined in /nix/store/jxjf2h9nnkdqnn1w1mr0ag8bqng2rlrs-emacs-packages-deps/share/emacs/site-lisp/elpa/sql-indent-1.7/sql-indent.el
(defun sqlind-lineup-to-clause-end (syntax base-indentation)
"Line up the current line with the end of a query clause.
This assumes SYNTAX is one of in-select-clause, in-update-clause,
in-insert-clause or in-delete-clause. It will return an
indentation so that:
If the clause is on a line by itself, the current line is
indented by `sqlind-basic-offset', otherwise the current line is
indented so that it starts in next column from where the clause
keyword ends.
Argument BASE-INDENTATION is updated."
(cl-destructuring-bind ((_sym clause) . anchor) (car syntax)
(save-excursion
(goto-char anchor)
(forward-char (1+ (length clause)))
(skip-syntax-forward " ")
(if (or (looking-at sqlind-comment-start-skip)
(eolp))
;; if the clause is on a line by itself, indent this line with a
;; sqlind-basic-offset
(+ base-indentation sqlind-basic-offset)
;; otherwise, align to the end of the clause, with a few exceptions
(current-column)))))