Function: sqlind-column-definition-start

sqlind-column-definition-start is a natively compiled function defined in sql-indent.el.

Signature

(sqlind-column-definition-start POS LIMIT)

Documentation

Find the beginning of a column definition in a select statement.

POS is the current position of the line to be indented, assumed to be in a 'select-column-continuation syntax.

LIMIT is the limit of the search, the beginning of the select statement.

Source Code

;; Defined in /nix/store/jxjf2h9nnkdqnn1w1mr0ag8bqng2rlrs-emacs-packages-deps/share/emacs/site-lisp/elpa/sql-indent-1.7/sql-indent.el
           (= (nth 0 ppss-point) (nth 0 ppss-start)))))) ; same nesting

(defun sqlind-column-definition-start (pos limit)
  "Find the beginning of a column definition in a select statement.
POS is the current position of the line to be indented, assumed
to be in a \\='select-column-continuation syntax.

LIMIT is the limit of the search, the beginning of the select
statement."
  (save-excursion
    (goto-char pos)
    (catch 'found
      (while (re-search-backward "," limit 'noerror)
	(when (sqlind-same-level-statement (point) limit)
	  (forward-char 1)
	  (sqlind-forward-syntactic-ws)
	  (throw 'found (point))))
      ;; nothing was found in (while ...) so try to find the first column definition.
      (goto-char limit)
      (forward-sexp)
      (sqlind-forward-syntactic-ws)
      (point))))