comparison lisp/code-process.el @ 1090:13305f7e85f0

[xemacs-hg @ 2002-11-10 16:07:12 by michaels] 2002-11-03 Mike Sperber <mike@xemacs.org> * code-process.el (call-process-region): Preserve return value from `call-process.'
author michaels
date Sun, 10 Nov 2002 16:07:13 +0000
parents 0288e82c84b3
children f32f3ddaf534
comparison
equal deleted inserted replaced
1089:adfbf1f7cc57 1090:13305f7e85f0
171 ;; in the same buffer, make sure we track the insertion, and don't get 171 ;; in the same buffer, make sure we track the insertion, and don't get
172 ;; any of it in the deleted region if insertion happens at either end 172 ;; any of it in the deleted region if insertion happens at either end
173 ;; of the region. 173 ;; of the region.
174 (let ((s (and deletep (copy-marker start t))) 174 (let ((s (and deletep (copy-marker start t)))
175 (e (and deletep (copy-marker end)))) 175 (e (and deletep (copy-marker end))))
176 (apply #'call-process program (list (current-buffer) start end) 176 (let ((retval
177 buffer displayp args) 177 (apply #'call-process program (list (current-buffer) start end)
178 ; If start and end were the same originally, s will be beyond e now 178 buffer displayp args)))
179 (if (and deletep (> e s)) 179 ;; If start and end were the same originally, s will be beyond e now
180 (delete-region s e)))) 180 (if (and deletep (> e s))
181 (delete-region s e))
182 retval)))
181 183
182 (defun start-process (name buffer program &rest program-args) 184 (defun start-process (name buffer program &rest program-args)
183 "Start a program in a subprocess. Return the process object for it. 185 "Start a program in a subprocess. Return the process object for it.
184 NAME is name for process. It is modified if necessary to make it unique. 186 NAME is name for process. It is modified if necessary to make it unique.
185 BUFFER is the buffer or (buffer-name) to associate with the process. 187 BUFFER is the buffer or (buffer-name) to associate with the process.