Function: ansible-mode

ansible-mode is an interactive and natively compiled function defined in ansible.el.

Signature

(ansible-mode &optional ARG)

Documentation

Ansible minor mode.

This is a minor mode. If called interactively, toggle the Ansible 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 ansible-mode(var)/ansible-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.

Aliases

ansible(var)/ansible(fun) (obsolete since 2024-11-28)

Source Code

;; Defined in /nix/store/ihs1wd4idvapzygy87ss7ddr2pwcpsxg-emacs-packages-deps/share/emacs/site-lisp/elpa/ansible-20260607.1852/ansible.el
;;;###autoload
(define-minor-mode ansible-mode
  "Ansible minor mode."
  :lighter " Ansible"
  :group 'ansible
  (if ansible-mode
      (progn
        (setq minor-mode-map-alist
              (cons (cons 'ansible ansible-key-map)
                    minor-mode-map-alist))
        (ansible-dict-initialize)
        (ansible-remove-font-lock)
        (ansible-add-font-lock)
	(when (featurep 'yasnippet)
	  (add-to-list 'yas-snippet-dirs ansible-snip-dir t)
	  (yas-load-directory ansible-snip-dir))
	(add-hook 'kill-buffer-hook #'ansible-maybe-unload-snippets nil t)
        (run-hooks 'ansible-hook))
    (ansible-remove-font-lock)
    (ansible-maybe-unload-snippets 0)))