Function: sqlind-minor-mode

sqlind-minor-mode is an interactive and natively compiled function defined in sql-indent.el.

Signature

(sqlind-minor-mode &optional ARG)

Documentation

Toggle SQL syntactic indentation on or off.

With syntactic indentation, hitting TAB on a line in a SQL buffer will indent the line according to the syntactic context of the SQL statement being edited.

A set of alignment rules are also enabled with this minor mode. Selecting a region of text and typing M-x align RET will align the statements. This can be used, for example, to align the as column aliases in select statements.

This is a minor mode. If called interactively, toggle the sqlind minor mode mode. If the prefix argument is positive, enable the mode, and if it is zero or negative, disable the mode.

If called from Lisp, toggle the mode if ARG is toggle. Enable the mode if ARG is nil, omitted, or is a positive number. Disable the mode if ARG is a negative number.

To check whether the minor mode is enabled in the current buffer, evaluate the variable sqlind-minor-mode(var)/sqlind-minor-mode(fun).

The mode's hook is called both when the mode is enabled and when it is disabled.

Key Bindings

This command is not in any keymaps.

Source Code

;; Defined in /nix/store/jxjf2h9nnkdqnn1w1mr0ag8bqng2rlrs-emacs-packages-deps/share/emacs/site-lisp/elpa/sql-indent-1.7/sql-indent.el
;;;###autoload
(define-minor-mode sqlind-minor-mode
    "Toggle SQL syntactic indentation on or off.
With syntactic indentation, hitting TAB on a line in a SQL buffer
will indent the line according to the syntactic context of the
SQL statement being edited.

A set of alignment rules are also enabled with this minor mode.
Selecting a region of text and typing `M-x align RET' will align
the statements.  This can be used, for example, to align the `as'
column aliases in select statements."
  :lighter " sqlind"
  ;; :group 'sqlind  ;;FIXME: There's no such group!
  :global nil
  :init-value nil
  (if sqlind-minor-mode
      (progn
        (set (make-local-variable 'indent-line-function) #'sqlind-indent-line)
        (set (make-local-variable 'align-mode-rules-list) sqlind-align-rules))
    (progn
      (kill-local-variable 'indent-line-function)
      (kill-local-variable 'align-mode-rules-list))))