comparison lisp/code-process.el @ 440:8de8e3f6228a r21-2-28

Import from CVS: tag r21-2-28
author cvs
date Mon, 13 Aug 2007 11:33:38 +0200
parents 3ecd8885ac67
children abe6d1db359e
comparison
equal deleted inserted replaced
439:357dd071b03c 440:8de8e3f6228a
27 ;; along with XEmacs; see the file COPYING. If not, write to the Free 27 ;; along with XEmacs; see the file COPYING. If not, write to the Free
28 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 28 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
29 ;; 02111-1307, USA. 29 ;; 02111-1307, USA.
30 30
31 ;;; Code: 31 ;;; Code:
32
33 (eval-when-compile
34 (defvar buffer-file-type)
35 (defvar binary-process-output))
36 32
37 (defvar process-coding-system-alist nil 33 (defvar process-coding-system-alist nil
38 "Alist to decide a coding system to use for a process I/O operation. 34 "Alist to decide a coding system to use for a process I/O operation.
39 The format is ((PATTERN . VAL) ...), 35 The format is ((PATTERN . VAL) ...),
40 where PATTERN is a regular expression matching a program name, 36 where PATTERN is a regular expression matching a program name,
110 and returns a numeric exit status or a signal description string. 106 and returns a numeric exit status or a signal description string.
111 If you quit, the process is first killed with SIGINT, then with SIGKILL if 107 If you quit, the process is first killed with SIGINT, then with SIGKILL if
112 you quit again before the process exits." 108 you quit again before the process exits."
113 (let ((temp 109 (let ((temp
114 (make-temp-name 110 (make-temp-name
115 (concat (file-name-as-directory (temp-directory)) 111 (concat (file-name-as-directory (temp-directory)) "emacs"))))
116 (if (memq system-type '(ms-dos windows-nt)) "em" "emacs")))))
117 (unwind-protect 112 (unwind-protect
118 (let (cs-r cs-w) 113 (let (cs-r cs-w)
119 (let (ret) 114 (let (ret)
120 (catch 'found 115 (catch 'found
121 (let ((alist process-coding-system-alist) 116 (let ((alist process-coding-system-alist)
135 cs-w ret)))) 130 cs-w ret))))
136 (let ((coding-system-for-read 131 (let ((coding-system-for-read
137 (or coding-system-for-read cs-r)) 132 (or coding-system-for-read cs-r))
138 (coding-system-for-write 133 (coding-system-for-write
139 (or coding-system-for-write cs-w))) 134 (or coding-system-for-write cs-w)))
140 (if (memq system-type '(ms-dos windows-nt)) 135 (write-region start end temp nil 'silent)
141 (let ((buffer-file-type binary-process-output))
142 (write-region start end temp nil 'silent))
143 (write-region start end temp nil 'silent))
144 (if deletep (delete-region start end)) 136 (if deletep (delete-region start end))
145 (apply #'call-process program temp buffer displayp args))) 137 (apply #'call-process program temp buffer displayp args)))
146 (ignore-file-errors (delete-file temp))))) 138 (ignore-file-errors (delete-file temp)))))
147 139
148 (defun start-process (name buffer program &rest program-args) 140 (defun start-process (name buffer program &rest program-args)
255 (or coding-system-for-read cs-r)) 247 (or coding-system-for-read cs-r))
256 (coding-system-for-write 248 (coding-system-for-write
257 (or coding-system-for-write cs-w))) 249 (or coding-system-for-write cs-w)))
258 (open-network-stream-internal name buffer host service protocol)))) 250 (open-network-stream-internal name buffer host service protocol))))
259 251
260 ;;; mule-process.el ends here 252 ;;; code-process.el ends here