comparison lisp/prim/process.el @ 155:43dd3413c7c7 r20-3b4

Import from CVS: tag r20-3b4
author cvs
date Mon, 13 Aug 2007 09:39:39 +0200
parents 25f70ba0133c
children 9ad43877534d
comparison
equal deleted inserted replaced
154:94141801dd7e 155:43dd3413c7c7
1 ;;; process.el --- commands for subprocesses; split out of simple.el 1 ;;; process.el --- commands for subprocesses; split out of simple.el
2 2
3 ;; Copyright (C) 1985, 1986, 1987, 1993, 1994 Free Software Foundation, Inc. 3 ;; Copyright (C) 1985-1987, 1993, 1994, 1997 Free Software Foundation, Inc.
4 ;; Copyright (C) 1995 Ben Wing. 4 ;; Copyright (C) 1995 Ben Wing.
5
6 ;; Author: Ben Wing
7 ;; Maintainer: XEmacs Development Team
8 ;; Keywords: internal, processes
5 9
6 ;; This file is part of XEmacs. 10 ;; This file is part of XEmacs.
7 11
8 ;; XEmacs is free software; you can redistribute it and/or modify it 12 ;; XEmacs is free software; you can redistribute it and/or modify it
9 ;; under the terms of the GNU General Public License as published by 13 ;; under the terms of the GNU General Public License as published by
19 ;; along with XEmacs; see the file COPYING. If not, write to the 23 ;; along with XEmacs; see the file COPYING. If not, write to the
20 ;; Free Software Foundation, 59 Temple Place - Suite 330, 24 ;; Free Software Foundation, 59 Temple Place - Suite 330,
21 ;; Boston, MA 02111-1307, USA. 25 ;; Boston, MA 02111-1307, USA.
22 26
23 ;;; Synched up with: FSF 19.30. 27 ;;; Synched up with: FSF 19.30.
28
29 ;;; Commentary:
24 30
25 ;;; Code: 31 ;;; Code:
26 32
27 33
28 (defvar shell-command-switch "-c" 34 (defvar shell-command-switch "-c"
156 ;; Preserve the match data in case called from a program. 162 ;; Preserve the match data in case called from a program.
157 (save-match-data 163 (save-match-data
158 (if (string-match "[ \t]*&[ \t]*$" command) 164 (if (string-match "[ \t]*&[ \t]*$" command)
159 ;; Command ending with ampersand means asynchronous. 165 ;; Command ending with ampersand means asynchronous.
160 (progn 166 (progn
161 (require 'background) ; whizzy comint background code
162 (background (substring command 0 (match-beginning 0)))) 167 (background (substring command 0 (match-beginning 0))))
163 (shell-command-on-region (point) (point) command output-buffer))))) 168 (shell-command-on-region (point) (point) command output-buffer)))))
164 169
165 ;; We have a sentinel to prevent insertion of a termination message 170 ;; We have a sentinel to prevent insertion of a termination message
166 ;; in the buffer itself. 171 ;; in the buffer itself.