Variable: enriched-mode

enriched-mode is a buffer-local variable defined in enriched.el.gz.

Documentation

Non-nil if Enriched mode is enabled.

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

View in manual

Probably introduced at or before Emacs version 20.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/enriched.el.gz
;;;###autoload
(define-minor-mode enriched-mode
  "Minor mode for editing text/enriched files.
These are files with embedded formatting information in the MIME standard
text/enriched format.

Turning the mode on or off runs `enriched-mode-hook'.

More information about Enriched mode is available in the file
\"enriched.txt\" in `data-directory'.

Commands:

\\{enriched-mode-map}"
  :group 'enriched :lighter " Enriched"
  (cond ((null enriched-mode)
	 ;; Turn mode off
         (remove-hook 'change-major-mode-hook
                      #'enriched-before-change-major-mode 'local)
	 (setq buffer-file-format (delq 'text/enriched buffer-file-format))
	 ;; restore old variable values
	 (while enriched-old-bindings
	   (set (pop enriched-old-bindings) (pop enriched-old-bindings)))
	 (unless enriched-default-text-properties-local-flag
	   (kill-local-variable 'default-text-properties))
	 (kill-local-variable 'enriched-default-text-properties-local-flag)
	 (unless use-hard-newlines (use-hard-newlines 0)))

	((and (memq 'text/enriched buffer-file-format)
	      (not enriched-rerun-flag))
	 ;; Mode already on; do nothing.
	 nil)

	(t				; Turn mode on
         (add-hook 'change-major-mode-hook
                   #'enriched-before-change-major-mode nil 'local)
	 (add-to-list 'buffer-file-format 'text/enriched)
	 ;; Save old variable values before we change them.
	 ;; These will be restored if we exit Enriched mode.
	 (setq enriched-old-bindings
	       (list 'buffer-display-table buffer-display-table
		     'default-text-properties default-text-properties
		     'use-hard-newlines use-hard-newlines))
         (setq-local enriched-default-text-properties-local-flag
                     (local-variable-p 'default-text-properties))
	 (make-local-variable 'default-text-properties)
	 (setq buffer-display-table  enriched-display-table)
	 (use-hard-newlines 1 (if enriched-rerun-flag 'never nil))
	 (let* ((sticky
                 (delete-dups
                  (append
                   enriched-par-props
                   (copy-sequence
                    (plist-get default-text-properties 'front-sticky))))))
	   (if sticky
	       (setq default-text-properties
		     (plist-put default-text-properties
				'front-sticky sticky)))))))