/[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.1 - (show annotations)
Sat Oct 12 19:21:16 2002 UTC (11 years, 6 months ago) by kaz
Branch: MAIN
Minor reorganization.

* posix.lisp: File renamed to paths.lisp, module renamed to "paths".
(*editor*): Variable removed.
(arglist-to-command-string, execute-programs-xargs,
invoke-editor-on): Functions removed.

* posix.lisp: New file.
(*editor*): Variable moved here from paths.lisp.
(arglist-to-command-string, invoke-editor-on): Functions moved here
from paths.lisp.

* editor.lisp: New file.
(*argument-limit*): Variable definition moved here.
(execute-programs-xargs): Function moved here from paths.lisp.

* clisp-unix.lisp: Renamed to clisp-posix.lisp.
Requires "posix" module now.
(*argument-limit*): Variable removed.

* system.lisp: Remove references to old clisp-linux module.
Added requires for new paths and execute modules.

* cmucl-unix.lisp (*argument-limit*): Variable definition removed.
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 "posix")
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