Function: enriched-toggle-markup

enriched-toggle-markup is an interactive and byte-compiled function defined in enriched.el.gz.

Signature

(enriched-toggle-markup)

Documentation

Toggle whether to see markup in the current buffer.

Probably introduced at or before Emacs version 29.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/enriched.el.gz
(defun enriched-toggle-markup ()
  "Toggle whether to see markup in the current buffer."
  (interactive)
  (save-excursion
    (save-restriction
      (widen)
      (with-silent-modifications
        (if (bound-and-true-p enriched--markup-shown)
            (progn
              (setq-local enriched--markup-shown nil)
              ;; Remove any faces, because they will be decoded, too.
              (goto-char (point-min))
              (let (match)
                (while (setq match (text-property-search-forward 'face))
                  (put-text-property (prop-match-beginning match)
                                     (prop-match-end match)
                                     'face nil)))
              (enriched-decode (point-min) (point-max))
              (enriched-mode 1))
          (setq-local enriched--markup-shown t)
          (enriched-encode (point-min) (point-max) (current-buffer))
          (enriched-mode -1))))))