Function: TeX-fold--helper-display

TeX-fold--helper-display is a byte-compiled function defined in tex-fold.el.

Signature

(TeX-fold--helper-display ENV ARGS SPEC-RETRIEVER)

Documentation

Generate fold display string for \begin{ENV} or \end{ENV} macro.

ARGS are the remaining mandatory macro arguments. Returns the string or function determined by TeX-fold-begin-end-spec-list if ENV is found there, otherwise abort. SPEC-RETRIEVER, which should be either car or cdr, retrieves the appropriate part of the display specification.

Source Code

;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/tex-fold.el
(defun TeX-fold--helper-display (env args spec-retriever)
  "Generate fold display string for \\begin{ENV} or \\end{ENV} macro.
ARGS are the remaining mandatory macro arguments.  Returns the string or
function determined by `TeX-fold-begin-end-spec-list' if ENV is found
there, otherwise `abort'.  SPEC-RETRIEVER, which should be either `car'
or `cdr', retrieves the appropriate part of the display specification."
  (catch 'result
    (dolist (item TeX-fold-begin-end-spec-list)
      (let* ((spec (funcall spec-retriever (car item)))
             (types (cadr item)))
        (dolist (type types)
          (when-let* ((name (cond ((stringp type)
                                   (when (string= env type)
                                     env))
                                  ((consp type)
                                   (when (member env type)
                                     (car type))))))
            (throw 'result
                   (if (functionp spec)
                       (funcall spec name args)
                     spec))))))
    'abort))