Variable: prog-indentation-context

prog-indentation-context is a variable defined in prog-mode.el.gz.

Value

nil

Documentation

When non-nil, provides context for indenting embedded code chunks.

There are languages where part of the code is actually written in a sub language, e.g., a Yacc/Bison or ANTLR grammar can also include JS or Python code. This variable enables the primary mode of the main language to use the indentation engine of the sub-mode for lines in code chunks written in the sub-mode's language.

When a major mode of such a main language decides to delegate the indentation of a line/region to the indentation engine of the sub mode, it should bind this variable to non-nil around the call.

The non-nil value should be a list of the form:

   (FIRST-COLUMN . REST)

FIRST-COLUMN is the column the indentation engine of the sub-mode should use for top-level language constructs inside the code chunk (instead of 0).

REST is currently unused.

View in manual

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/prog-mode.el.gz
(defvar prog-indentation-context nil
  "When non-nil, provides context for indenting embedded code chunks.

There are languages where part of the code is actually written in
a sub language, e.g., a Yacc/Bison or ANTLR grammar can also include
JS or Python code.  This variable enables the primary mode of the
main language to use the indentation engine of the sub-mode for
lines in code chunks written in the sub-mode's language.

When a major mode of such a main language decides to delegate the
indentation of a line/region to the indentation engine of the sub
mode, it should bind this variable to non-nil around the call.

The non-nil value should be a list of the form:

   (FIRST-COLUMN . REST)

FIRST-COLUMN is the column the indentation engine of the sub-mode
should use for top-level language constructs inside the code
chunk (instead of 0).

REST is currently unused.")