Function: TeX-complete-make-expert-command-functions

TeX-complete-make-expert-command-functions is a macro defined in tex.el.

Signature

(TeX-complete-make-expert-command-functions THING LIST-VAR PREFIX)

Source Code

;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/tex.el
(defmacro TeX-complete-make-expert-command-functions (thing list-var prefix)
  (let* ((plural (concat thing "s"))
         (upcase-plural (upcase plural))
         (table-var (intern (format "%s-expert-%s-table" prefix thing))))
    `(progn
       (defvar ,table-var
         (make-hash-table :test #'equal)
         ,(format "A hash-table mapping %s names to the style name providing it.

A %s occuring in this table is considered an expert %s and
treated specially in the completion." thing thing thing))

       (defun ,(intern (format "%s-declare-expert-%s" prefix plural)) (style &rest ,(intern plural))
         ,(format "Declare %s as expert %s of STYLE.

Expert %s are completed depending on `TeX-complete-expert-commands'."
                  upcase-plural plural plural)
         (dolist (x ,(intern plural))
           (if (null style)
               (remhash x ,table-var)
             (puthash x style ,table-var))))

       (defun ,(intern (format "%s-filtered" list-var)) ()
         ,(format "Filter (%s) depending on `TeX-complete-expert-commands'."
                  list-var)
         (delq nil
               (mapcar
                (lambda (entry)
                  (if (eq t TeX-complete-expert-commands)
                      entry
                    (let* ((cmd (car entry))
                           (style (gethash cmd ,table-var)))
                      (when (or (null style)
                                (member style TeX-complete-expert-commands))
                        entry))))
                (,list-var)))))))