Function: antlr-language-option-extra
antlr-language-option-extra is a byte-compiled function defined in
antlr-mode.el.gz.
Signature
(antlr-language-option-extra PHASE &rest DUMMIES)
Documentation
Change language according to the new value of the "language" option.
Call antlr-mode if the new language would be different from the value
of antlr-language, keeping the value of variable font-lock-mode(var)/font-lock-mode(fun).
Called in PHASE after-insertion, see antlr-options-alists.
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/antlr-mode.el.gz
(defun antlr-language-option-extra (phase &rest _dummies)
"Change language according to the new value of the \"language\" option.
Call `antlr-mode' if the new language would be different from the value
of `antlr-language', keeping the value of variable `font-lock-mode'.
Called in PHASE `after-insertion', see `antlr-options-alists'."
(when (eq phase 'after-insertion)
(let ((new-language (antlr-guess-language)))
(or (null new-language)
(eq new-language antlr-language)
(let ((font-lock (and (boundp 'font-lock-mode) font-lock-mode)))
(if font-lock (font-lock-mode 0))
(funcall major-mode) ; TODO: do differently?
(and font-lock (null font-lock-mode) (font-lock-mode 1)))))))