Function: reftex-ref-style-toggle

reftex-ref-style-toggle is a byte-compiled function defined in reftex.el.gz.

Signature

(reftex-ref-style-toggle STYLE &optional ACTION)

Documentation

Activate or deactivate the referencing style STYLE.

With the optional argument ACTION a certain action can be forced. The symbol activate will activate the style and deactivate will deactivate it.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/reftex.el.gz
(defun reftex-ref-style-toggle (style &optional action)
  "Activate or deactivate the referencing style STYLE.
With the optional argument ACTION a certain action can be forced.
The symbol `activate' will activate the style and `deactivate'
will deactivate it."
  (unless reftex-docstruct-symbol
    (reftex-tie-multifile-symbols))
  (when (and reftex-docstruct-symbol
             (symbolp reftex-docstruct-symbol))
    (let ((list (get reftex-docstruct-symbol 'reftex-ref-style-list))
          changed)
      (cond ((eq action 'activate)
	     (unless (member style list)
	       (setq reftex-tables-dirty t
		     changed t)
               (setq list (append list (list style)))))
	    ((eq action 'deactivate)
	     (when (member style list)
	       (setq reftex-tables-dirty t
		     changed t)
	       (setq list (delete style list))))
	    (t
             (setq list (if (member style list)
                            (delete style list)
                          (append list (list style))))
	     (setq reftex-tables-dirty t
		   changed t)))
      (when changed
        (put reftex-docstruct-symbol 'reftex-ref-style-list list)))))