Function: antlr-insert-option-existing
antlr-insert-option-existing is a byte-compiled function defined in
antlr-mode.el.gz.
Signature
(antlr-insert-option-existing OLD VALUE)
Documentation
Insert option value VALUE at point for existing option.
For OLD, see antlr-insert-option-do.
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/antlr-mode.el.gz
;;;===========================================================================
;;; Insert options: the details (used by `antlr-insert-option-do')
;;;===========================================================================
(defun antlr-insert-option-existing (old value)
"Insert option value VALUE at point for existing option.
For OLD, see `antlr-insert-option-do'."
;; no = => insert =
(unless (car old) (insert antlr-options-assign-string))
;; with user input => insert if necessary
(when value
(if (cdr old) ; with value
(if (string-equal value (buffer-substring (car old) (cdr old)))
(goto-char (cdr old))
(delete-region (car old) (cdr old))
(insert value))
(insert value)))
(unless (looking-at "\\([^\n=;{}/'\"]\\|'\\([^\n'\\]\\|\\\\.\\)*'\\|\"\\([^\n\"\\]\\|\\\\.\\)*\"\\)*;")
;; stuff (no =, {, } or /) at point is not followed by ";"
(insert ";")
(backward-char)))