File: cfengine.el.html
Provides support for editing GNU CFEngine files, including font-locking, Imenu and indentation, but with no special keybindings.
By default, CFEngine 3.x syntax is used.
You can set it up so either cfengine2-mode (2.x and earlier) or
cfengine3-mode (3.x) will be picked, depending on the buffer
contents:
(add-to-list 'auto-mode-alist '("\\\\.cf\\\\'" . cfengine-auto-mode))
OR you can choose to always use a specific version, if you prefer it:
(add-to-list 'auto-mode-alist '("\\\\.cf\\\\'" . cfengine3-mode))
(add-to-list 'auto-mode-alist '("^cf\\\\." . cfengine2-mode))
(add-to-list 'auto-mode-alist '("^cfagent.conf\\\\'" . cfengine2-mode))
It's *highly* recommended that you enable the eldoc minor mode:
(add-hook 'cfengine3-mode-hook 'eldoc-mode)
You may also find the command cfengine3-reformat-json-string
useful, just bind it to a key you prefer. It will take the current
string and reformat it as JSON. So if you're editing JSON inside
the policy, it's a quick way to make it more legible without
manually reindenting it. For instance:
(global-set-key [(control f4)] 'cfengine3-reformat-json-string)
This is not the same as the mode written by Rolf Ebert
<ebert@waporo.muc.de>, distributed with cfengine-2.0.5. It does
better fontification and indentation, inter alia.
Defined variables (21)
cfengine-cf-promises | The location of the cf-promises executable. |
cfengine-indent | Size of a CFEngine indentation step in columns. |
cfengine-mode-abbrevs | Abbrevs for CFEngine2 mode. |
cfengine-mode-debug | Whether ‘cfengine-mode’ should print debugging info. |
cfengine-mode-syntax-cache | Cache for ‘cfengine-mode’ syntax trees obtained from ‘cf-promises -s json’. |
cfengine-parameters-indent | Indentation of CFEngine3 promise parameters (hanging indent). |
cfengine2-actions | List of the action keywords supported by Cfengine. |
cfengine2-imenu-expression | ‘imenu-generic-expression’ for CFEngine mode. |
cfengine2-mode-abbrev-table | Abbrev table for ‘cfengine2-mode’. |
cfengine2-mode-hook | Hook run after entering CFE2 mode. |
cfengine2-mode-map | Keymap for ‘cfengine2-mode’. |
cfengine2-mode-syntax-table | Syntax table for ‘cfengine2-mode’. |
cfengine3-defun-full-re | Regexp matching full defun declaration (excluding argument list). |
cfengine3-defuns | List of the CFEngine 3.x defun headings. |
cfengine3-defuns-regex | Regex to match the CFEngine 3.x defuns. |
cfengine3-fallback-syntax | Fallback CFEngine syntax, containing just function definitions. |
cfengine3-mode-abbrev-table | Abbrev table for ‘cfengine3-mode’. |
cfengine3-mode-hook | Hook run after entering CFE3 mode. |
cfengine3-mode-map | Keymap for ‘cfengine3-mode’. |
cfengine3-mode-syntax-table | Syntax table for ‘cfengine3-mode’. |
cfengine3-vartypes | List of the CFEngine 3.x variable types. |