/[meta-cvs]/meta-cvs/F-26DCA2B7859BC31F50F2B5ABA0AB6950.lisp
ViewVC logotype

Contents of /meta-cvs/F-26DCA2B7859BC31F50F2B5ABA0AB6950.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations)
Sat Oct 12 19:37:47 2002 UTC (11 years, 6 months ago) by kaz
Branch: MAIN
Changes since 1.1: +1 -1 lines
Rethink some decisions in the previous change. Reusing the
name posix.lisp for a new file will cause problems for people
using mcvs grab to keep up with Meta-CVS patches.

* code/posix.lisp: Renamed to unix.lisp.

* code/clisp-posix.lisp: Renamed back to clisp-unix.lisp, for
the sake of consistency.

* code/system.lisp: Updated.

* code/cmucl.lisp: Likewise.
1 ;;; This source file is part of the Meta-CVS program,
2 ;;; which is distributed under the GNU license.
3 ;;; Copyright 2002 Kaz Kylheku
4
5 (require "split")
6 (require "execute")
7 (provide "unix")
8
9 (defvar *editor* nil)
10
11 (defun arglist-to-command-string (arglist)
12 "Convert list of strings, assumed to be an argument vector, into
13 a single command string that can be submitted to a POSIX command
14 interpreter. This requires escaping of all shell meta-characters."
15 (let ((command (make-array '(1024)
16 :element-type 'character
17 :adjustable t
18 :fill-pointer 0)))
19 (dolist (arg arglist command)
20 (dotimes (i (length arg))
21 (let ((ch (char arg i)))
22 (when (find ch #(#\' #\" #\* #\[ #\] #\?
23 #\$ #\{ #\} #\" #\space #\tab
24 #\( #\) #\< #\> #\| #\; #\&))
25 (vector-push-extend #\\ command))
26 (vector-push-extend ch command)))
27 (vector-push-extend #\space command))))
28
29 (defun invoke-editor-on (name)
30 (let ((editor (or *editor* (env-lookup "EDITOR" "vi"))))
31 (execute-program `(,editor ,name))))

  ViewVC Help
Powered by ViewVC 1.1.5