Variable: format-alist

format-alist is a variable defined in format.el.gz.

Value

((longlines "Automatically wrap long lines." nil nil
	    longlines-encode-region t nil)
 (text/enriched "Extended MIME text/enriched format."
		"Content-[Tt]ype:[      ]*text/enriched"
		enriched-decode enriched-encode t enriched-mode)
 (plain "ISO 8859-1 standard format, no text properties." nil nil nil
	nil nil)
 (TeX "TeX (encoding)" nil iso-tex2iso iso-iso2tex t nil)
 (gtex "German TeX (encoding)" nil iso-gtex2iso iso-iso2gtex t nil)
 (html
  "HTML/SGML \"ISO 8879:1986//ENTITIES Added Latin 1//EN\" (encoding)"
  nil iso-sgml2iso iso-iso2sgml t nil)
 (rot13 "rot13" nil rot13-region rot13-region t nil)
 (duden "Duden Ersatzdarstellung" nil iso-cvt-write-only iso-iso2duden
	t nil)
 (de646 "German ASCII (ISO 646)" nil "iconv -f iso646-de -t utf-8"
	"iconv -f utf-8 -t iso646-de" t nil)
 (denet "net German" nil iso-german iso-cvt-read-only t nil)
 (esnet "net Spanish" nil iso-spanish iso-cvt-read-only t nil))

Documentation

List of information about understood file formats.

Elements are of the form
(NAME DOC-STR REGEXP FROM-FN TO-FN MODIFY MODE-FN PRESERVE).

NAME is a symbol, which is stored in buffer-file-format.

DOC-STR should be a single line providing more information about the
        format. It is currently unused, but in the future will be shown to
        the user if they ask for more information.

REGEXP is a regular expression to match against the beginning of the file;
        it should match only files in that format. REGEXP may be nil, in
        which case the format will never be applied automatically to a file.
        Use this for formats that you only ever want to apply manually.

FROM-FN is called to decode files in that format; it takes two args, BEGIN
        and END, and can make any modifications it likes, returning the new
        end. It must make sure that the beginning of the file no longer
        matches REGEXP, or else it will get called again.
Alternatively, FROM-FN can be a string, which specifies a shell command
(including options) to be used as a filter to perform the conversion.

TO-FN is called to encode a region into that format; it takes three
        arguments: BEGIN, END, and BUFFER. BUFFER is the original buffer that
        the data being written came from, which the function could use, for
        example, to find the values of local variables. TO-FN should either
        return a list of annotations like write-region-annotate-functions,
        or modify the region and return the new end.
Alternatively, TO-FN can be a string, which specifies a shell command
(including options) to be used as a filter to perform the conversion.

MODIFY, if non-nil, means the TO-FN wants to modify the region. If nil,
        TO-FN will not make any changes but will instead return a list of
        annotations.

MODE-FN, if specified, is called when visiting a file with that format.
         It is called with a single positive argument, on the assumption
         that this would turn on some minor mode.

PRESERVE, if non-nil, means that format-write-file should not remove
          this format from buffer-file-format.

View in manual

Probably introduced at or before Emacs version 19.29.

Source Code

;; Defined in /usr/src/emacs/lisp/format.el.gz
(defvar format-alist
  `((text/enriched "Extended MIME text/enriched format."
                   "Content-[Tt]ype:[ \t]*text/enriched"
		   enriched-decode enriched-encode t enriched-mode)
    (plain "ISO 8859-1 standard format, no text properties."
	   ;; Plain only exists so that there is an obvious neutral choice in
	   ;; the completion list.
	   nil nil nil nil nil)
    (TeX   "TeX (encoding)"
	   nil
	   iso-tex2iso iso-iso2tex t nil)
    (gtex  "German TeX (encoding)"
	   nil
	   iso-gtex2iso iso-iso2gtex t nil)
    (html  "HTML/SGML \"ISO 8879:1986//ENTITIES Added Latin 1//EN\" (encoding)"
	   nil
	   iso-sgml2iso iso-iso2sgml t nil)
    (rot13 "rot13"
	   nil
	   rot13-region rot13-region t nil)
    (duden "Duden Ersatzdarstellung"
	   nil
	   ;; FROM-FN used to call the "diac" command which is not widely
	   ;; available and apparently not under a free software license:
	   ;; https://nm.wu-wien.ac.at/nm/download/file/diac4.tar.gz
	   ;; Reliable round-trip conversion is not possible anyway and
	   ;; would be by heuristic method, so make it write-only for now.
	   iso-cvt-write-only iso-iso2duden t nil)
    (de646 "German ASCII (ISO 646)"
	   nil
           "iconv -f iso646-de -t utf-8"
           "iconv -f utf-8 -t iso646-de" t nil)
    (denet "net German"
	   nil
	   iso-german iso-cvt-read-only t nil)
    (esnet "net Spanish"
	   nil
	   iso-spanish iso-cvt-read-only t nil))
  "List of information about understood file formats.
Elements are of the form
\(NAME DOC-STR REGEXP FROM-FN TO-FN MODIFY MODE-FN PRESERVE).

NAME    is a symbol, which is stored in `buffer-file-format'.

DOC-STR should be a single line providing more information about the
        format.  It is currently unused, but in the future will be shown to
        the user if they ask for more information.

REGEXP  is a regular expression to match against the beginning of the file;
        it should match only files in that format.  REGEXP may be nil, in
        which case the format will never be applied automatically to a file.
        Use this for formats that you only ever want to apply manually.

FROM-FN is called to decode files in that format; it takes two args, BEGIN
        and END, and can make any modifications it likes, returning the new
        end.  It must make sure that the beginning of the file no longer
        matches REGEXP, or else it will get called again.
	Alternatively, FROM-FN can be a string, which specifies a shell command
	(including options) to be used as a filter to perform the conversion.

TO-FN   is called to encode a region into that format; it takes three
        arguments: BEGIN, END, and BUFFER.  BUFFER is the original buffer that
        the data being written came from, which the function could use, for
        example, to find the values of local variables.  TO-FN should either
        return a list of annotations like `write-region-annotate-functions',
        or modify the region and return the new end.
	Alternatively, TO-FN can be a string, which specifies a shell command
	(including options) to be used as a filter to perform the conversion.

MODIFY, if non-nil, means the TO-FN wants to modify the region.  If nil,
        TO-FN will not make any changes but will instead return a list of
        annotations.

MODE-FN, if specified, is called when visiting a file with that format.
         It is called with a single positive argument, on the assumption
         that this would turn on some minor mode.

PRESERVE, if non-nil, means that `format-write-file' should not remove
          this format from `buffer-file-format'.")