comparison lisp/format.el @ 19244:dc92be3441cd

(format-alist): Doc fix.
author Richard M. Stallman <rms@gnu.org>
date Sat, 09 Aug 1997 07:58:37 +0000
parents 759e45894579
children 33adb5cee0b0
comparison
equal deleted inserted replaced
19243:f8f590160844 19244:dc92be3441cd
104 (esnet "net Spanish" 104 (esnet "net Spanish"
105 "1\\(^\\)" 105 "1\\(^\\)"
106 iso-spanish iso-cvt-read-only t nil)) 106 iso-spanish iso-cvt-read-only t nil))
107 "List of information about understood file formats. 107 "List of information about understood file formats.
108 Elements are of the form \(NAME DOC-STR REGEXP FROM-FN TO-FN MODIFY MODE-FN). 108 Elements are of the form \(NAME DOC-STR REGEXP FROM-FN TO-FN MODIFY MODE-FN).
109
109 NAME is a symbol, which is stored in `buffer-file-format'. 110 NAME is a symbol, which is stored in `buffer-file-format'.
111
110 DOC-STR should be a single line providing more information about the 112 DOC-STR should be a single line providing more information about the
111 format. It is currently unused, but in the future will be shown to 113 format. It is currently unused, but in the future will be shown to
112 the user if they ask for more information. 114 the user if they ask for more information.
115
113 REGEXP is a regular expression to match against the beginning of the file; 116 REGEXP is a regular expression to match against the beginning of the file;
114 it should match only files in that format. 117 it should match only files in that format.
118
115 FROM-FN is called to decode files in that format; it gets two args, BEGIN 119 FROM-FN is called to decode files in that format; it gets two args, BEGIN
116 and END, and can make any modifications it likes, returning the new 120 and END, and can make any modifications it likes, returning the new
117 end. It must make sure that the beginning of the file no longer 121 end. It must make sure that the beginning of the file no longer
118 matches REGEXP, or else it will get called again. 122 matches REGEXP, or else it will get called again.
123 Alternatively, FROM-FN can be a shell command (including options)
124 which can be used as a filter to perform the conversion.
125
119 TO-FN is called to encode a region into that format; it is passed three 126 TO-FN is called to encode a region into that format; it is passed three
120 arguments: BEGIN, END, and BUFFER. BUFFER is the original buffer that 127 arguments: BEGIN, END, and BUFFER. BUFFER is the original buffer that
121 the data being written came from, which the function could use, for 128 the data being written came from, which the function could use, for
122 example, to find the values of local variables. TO-FN should either 129 example, to find the values of local variables. TO-FN should either
123 return a list of annotations like `write-region-annotate-functions', 130 return a list of annotations like `write-region-annotate-functions',
124 or modify the region and return the new end. 131 or modify the region and return the new end.
132 Alternatively, TO-FN can be a shell command (including options)
133 which can be used as a filter to perform the conversion.
134
125 MODIFY, if non-nil, means the TO-FN wants to modify the region. If nil, 135 MODIFY, if non-nil, means the TO-FN wants to modify the region. If nil,
126 TO-FN will not make any changes but will instead return a list of 136 TO-FN will not make any changes but will instead return a list of
127 annotations. 137 annotations.
138
128 MODE-FN, if specified, is called when visiting a file with that format.") 139 MODE-FN, if specified, is called when visiting a file with that format.")
129 140
130 ;;; Basic Functions (called from Lisp) 141 ;;; Basic Functions (called from Lisp)
131 142
132 (defun format-encode-run-method (method from to &optional buffer) 143 (defun format-encode-run-method (method from to &optional buffer)