Function: LaTeX-check-insert-macro-default-style

LaTeX-check-insert-macro-default-style is a macro defined in latex.el.

Signature

(LaTeX-check-insert-macro-default-style &rest BODY)

Documentation

Check for values of TeX-insert-macro-default-style and current-prefix-arg.

This is a utility macro with code taken from TeX-parse-arguments. It should be used inside more complex function within AUCTeX style files where optional and mandatory arguments are queried and inserted. For example, check the function LaTeX-arg-bicaption-bicaption defined in style/bicaption.el.

Source Code

;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/latex.el
;; Utilities:

(defmacro LaTeX-check-insert-macro-default-style (&rest body)
  "Check for values of `TeX-insert-macro-default-style' and `current-prefix-arg'.
This is a utility macro with code taken from `TeX-parse-arguments'.  It
should be used inside more complex function within AUCTeX style files
where optional and mandatory arguments are queried and inserted.  For
example, check the function `LaTeX-arg-bicaption-bicaption'
defined in style/bicaption.el."
  `(unless (if (eq TeX-insert-macro-default-style 'show-all-optional-args)
               (equal current-prefix-arg '(4))
             (or
              (and (eq TeX-insert-macro-default-style 'show-optional-args)
                   (equal current-prefix-arg '(4)))
              (and (eq TeX-insert-macro-default-style 'mandatory-args-only)
                   (null (equal current-prefix-arg '(4))))
              TeX-last-optional-rejected))
     ,@body))