Function: sqlind-right-justify-clause
sqlind-right-justify-clause is a natively compiled function defined in
sql-indent.el.
Signature
(sqlind-right-justify-clause SYNTAX BASE-INDENTATION)
Documentation
Return an indentation which right-aligns the first word at anchor of SYNTAX with the first word in the curent line.
This is intended to be used as an indentation function for select-clause, update-clause, insert-clause and update-clause syntaxes
Source Code
;; Defined in /nix/store/jxjf2h9nnkdqnn1w1mr0ag8bqng2rlrs-emacs-packages-deps/share/emacs/site-lisp/elpa/sql-indent-1.7/sql-indent.el
(defun sqlind-right-justify-clause (syntax base-indentation)
"Return an indentation which right-aligns the first word at
anchor of SYNTAX with the first word in the curent line.
This is intended to be used as an indentation function for
select-clause, update-clause, insert-clause and update-clause
syntaxes"
(save-excursion
(let ((clause-length 0)
(statement-keyword-length 0)
offset)
(back-to-indentation)
(when (looking-at "\\sw+\\b")
(setq clause-length (- (match-end 0) (match-beginning 0))))
(goto-char (cdar syntax)) ; move to ANCHOR
(when (looking-at "\\sw+\\b")
(setq statement-keyword-length (- (match-end 0) (match-beginning 0))))
(setq offset (- statement-keyword-length clause-length))
(if (> offset 0)
(+ base-indentation offset)
base-indentation))))