comparison lisp/format.el @ 219:262b8bb4a523 r20-4b8

Import from CVS: tag r20-4b8
author cvs
date Mon, 13 Aug 2007 10:09:35 +0200
parents 1f0dabaa0855
children 2c611d1463a6
comparison
equal deleted inserted replaced
218:c9f226976f56 219:262b8bb4a523
164 BUFFER should be the buffer that the output originally came from." 164 BUFFER should be the buffer that the output originally came from."
165 (if (stringp method) 165 (if (stringp method)
166 (save-current-buffer 166 (save-current-buffer
167 (set-buffer buffer) 167 (set-buffer buffer)
168 (with-output-to-temp-buffer "*Format Errors*" 168 (with-output-to-temp-buffer "*Format Errors*"
169 (shell-command-on-region from to method t nil standard-output)) 169 (shell-command-on-region from to method t nil))
170 (point)) 170 (point))
171 (funcall method from to buffer))) 171 (funcall method from to buffer)))
172 172
173 (defun format-decode-run-method (method from to &optional buffer) 173 (defun format-decode-run-method (method from to &optional buffer)
174 "Decode using function or shell script METHOD the text from FROM to TO. 174 "Decode using function or shell script METHOD the text from FROM to TO.
175 If METHOD is a string, it is a shell command; 175 If METHOD is a string, it is a shell command;
176 otherwise, it should be a Lisp function." 176 otherwise, it should be a Lisp function."
177 (if (stringp method) 177 (if (stringp method)
178 (progn 178 (progn
179 (with-output-to-temp-buffer "*Format Errors*" 179 (with-output-to-temp-buffer "*Format Errors*"
180 (shell-command-on-region from to method t nil standard-output)) 180 (shell-command-on-region from to method t nil))
181 (point)) 181 (point))
182 (funcall method from to))) 182 (funcall method from to)))
183 183
184 (defun format-annotate-function (format from to orig-buf) 184 (defun format-annotate-function (format from to orig-buf)
185 "Returns annotations for writing region as FORMAT. 185 "Returns annotations for writing region as FORMAT.