Function: antlr-python-indent-action-line

antlr-python-indent-action-line is a byte-compiled function defined in antlr-mode.el.gz.

Signature

(antlr-python-indent-action-line BOA)

Documentation

Indent the current line in a Python action.

Argument BOA is the start position of the action.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/antlr-mode.el.gz
(defun antlr-python-indent-action-line (boa)
  "Indent the current line in a Python action.
Argument BOA is the start position of the action."
  (let (leftouter)
    (save-excursion
      (goto-char boa)
      (setq leftouter (current-indentation))
      (forward-char)
      (skip-chars-forward " \t")
      (setq boa (and (eq (char-after) ?\n) (point))))
    ;; a multi-line Python action does not start in its own line: this is a bad
    ;; idea -> we do not touch those actions
    (when (and boa
               (eq antlr-indent-comment t) ; indent-region
               (boundp 'prog-indentation-context)) ; Emacs 24.5 or later
      ;; FIXME: These vars don't exist any more.
      (defvar syntax-ppss-cache) (defvar syntax-ppss-last)
      (let ((syntax-ppss-cache nil) ;#dynamic, in older Emacs...
            (syntax-ppss-last nil) ;#dynamic, in older Emacs...
            ;; TODO: do we also need to call `syntax-propertize' or
            ;; `syntax-ppss-flush-cache'?  and/or bind
            ;; `syntax-propertize-function'?
            (prog-indentation-context ;#dynamic
             (list (+ leftouter c-basic-offset) (list (1+ boa)))))
        (narrow-to-region (1+ boa) (point-max))
        (python-indent-line (eq this-command 'antlr-indent-command))))))