Variable: TeX-fold-mode

TeX-fold-mode is a buffer-local variable defined in tex-fold.el.

Documentation

Non-nil if Tex-Fold mode is enabled.

Use the command TeX-fold-mode(var)/TeX-fold-mode(fun) to change this variable.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/tex-fold.el
;;; The mode

;;;###autoload
(define-minor-mode TeX-fold-mode
  "Minor mode for hiding and revealing macros and environments.

Called interactively, with no prefix argument, toggle the mode.
With universal prefix ARG (or if ARG is nil) turn mode on.
With zero or negative ARG turn mode off."
  :init-value nil
  :lighter nil
  :keymap (list (cons TeX-fold-command-prefix TeX-fold-keymap))
  (if TeX-fold-mode
      (progn
        ;; The value t causes problem when body text is hidden in
        ;; outline-minor-mode. (bug#36651)
        ;; In addition, it's better not to override user preference
        ;; without good reason.
        ;; (set (make-local-variable 'search-invisible) t)
        (add-hook 'post-command-hook #'TeX-fold-post-command nil t)
        (add-hook 'LaTeX-fill-newline-hook #'TeX-fold-update-at-point nil t)
        (add-hook 'TeX-after-insert-macro-hook
                  (lambda ()
                    (when (and TeX-fold-mode TeX-fold-auto)
                      (save-excursion
                        (backward-char)
                        (or (TeX-fold-item 'macro)
                            (TeX-fold-item 'math)
                            (TeX-fold-item 'env))))))
        ;; Update the `TeX-fold-*-spec-list-internal' variables.
        (dolist (elt '("macro" "env" "math"))
          (set (intern (format "TeX-fold-%s-spec-list-internal" elt))
               ;; Append the value of `TeX-fold-*-spec-list' to the
               ;; mode-specific `<mode-prefix>-fold-*-spec-list' variable.
               (append (symbol-value (intern (format "TeX-fold-%s-spec-list"
                                                     elt)))
                       (let ((symbol (intern (format "%s-fold-%s-spec-list"
                                                     (TeX-mode-prefix) elt))))
                         (when (boundp symbol)
                           (symbol-value symbol)))))))
    ;; (kill-local-variable 'search-invisible)
    (remove-hook 'post-command-hook #'TeX-fold-post-command t)
    (remove-hook 'LaTeX-fill-newline-hook #'TeX-fold-update-at-point t)
    (TeX-fold-clearout-buffer))
  (TeX-set-mode-name))