Function: auto-insert-mode

auto-insert-mode is an autoloaded, interactive and byte-compiled function defined in autoinsert.el.gz.

Signature

(auto-insert-mode &optional ARG)

Documentation

Toggle Auto-insert mode, a global minor mode.

When Auto-insert mode is enabled, when new files are created you can insert a template for the file depending on the mode of the buffer.

This is a global minor mode. If called interactively, toggle the Auto-Insert 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 (default-value \=auto-insert-mode)'.

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

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/autoinsert.el.gz
;;;###autoload
(define-minor-mode auto-insert-mode
  "Toggle Auto-insert mode, a global minor mode.

When Auto-insert mode is enabled, when new files are created you can
insert a template for the file depending on the mode of the buffer."
  :global t :group 'auto-insert
  (if auto-insert-mode
      (add-hook 'find-file-hook 'auto-insert)
    (remove-hook 'find-file-hook 'auto-insert)))