comparison lisp/format.el @ 19363:166c69d75f01

(format-encode-run-method, format-decode-run-method): Put error output from shell command in temp buffer, not data buffer. (format-alist): Typo fix.
author Richard M. Stallman <rms@gnu.org>
date Fri, 15 Aug 1997 23:42:26 +0000
parents 8f531dfe20bc
children 51b56762f98b
comparison
equal deleted inserted replaced
19362:fddeff2c6697 19363:166c69d75f01
71 ;; Plain only exists so that there is an obvious neutral choice in 71 ;; Plain only exists so that there is an obvious neutral choice in
72 ;; the completion list. 72 ;; the completion list.
73 nil nil nil nil nil) 73 nil nil nil nil nil)
74 (ibm "IBM Code Page 850 (DOS)" 74 (ibm "IBM Code Page 850 (DOS)"
75 "1\\(^\\)" 75 "1\\(^\\)"
76 "recode ibm-ps:latin1" "recode latin1:ibm-pc" t nil) 76 "recode ibm-pc:latin1" "recode latin1:ibm-pc" t nil)
77 (mac "Apple Macintosh" 77 (mac "Apple Macintosh"
78 "1\\(^\\)" 78 "1\\(^\\)"
79 "recode mac:latin1" "recode latin1:mac" t nil) 79 "recode mac:latin1" "recode latin1:mac" t nil)
80 (hp "HP Roman8" 80 (hp "HP Roman8"
81 "1\\(^\\)" 81 "1\\(^\\)"
146 otherwise, it should be a Lisp function. 146 otherwise, it should be a Lisp function.
147 BUFFER should be the buffer that the output originally came from." 147 BUFFER should be the buffer that the output originally came from."
148 (if (stringp method) 148 (if (stringp method)
149 (save-current-buffer 149 (save-current-buffer
150 (set-buffer buffer) 150 (set-buffer buffer)
151 (shell-command-on-region from to method t) 151 (with-output-to-temp-buffer "*Format Errors*"
152 (shell-command-on-region from to method t nil standard-output))
152 (point)) 153 (point))
153 (funcall method from to buffer))) 154 (funcall method from to buffer)))
154 155
155 (defun format-decode-run-method (method from to &optional buffer) 156 (defun format-decode-run-method (method from to &optional buffer)
156 "Decode using function or shell script METHOD the text from FROM to TO. 157 "Decode using function or shell script METHOD the text from FROM to TO.
157 If METHOD is a string, it is a shell command; 158 If METHOD is a string, it is a shell command;
158 otherwise, it should be a Lisp function." 159 otherwise, it should be a Lisp function."
159 (if (stringp method) 160 (if (stringp method)
160 (progn 161 (progn
161 (shell-command-on-region from to method t) 162 (with-output-to-temp-buffer "*Format Errors*"
163 (shell-command-on-region from to method t nil standard-output))
162 (point)) 164 (point))
163 (funcall method from to))) 165 (funcall method from to)))
164 166
165 (defun format-annotate-function (format from to orig-buf) 167 (defun format-annotate-function (format from to orig-buf)
166 "Returns annotations for writing region as FORMAT. 168 "Returns annotations for writing region as FORMAT.