1. xemacs
  2. ilisp

Source

ilisp / ilisp-mod.el

Diff from to

File ilisp-mod.el

  • Ignore whitespace
 ;;; -*- Mode: Emacs-Lisp -*-
 
 ;;; ilisp-mod.el --
-
+;;; ILISP mode top level definitions.
+;;;
 ;;; This file is part of ILISP.
-;;; Version: 5.10.1
+;;; Please refer to the file COPYING for copyrights and licensing
+;;; information.
+;;; Please refer to the file ACKNOWLEGDEMENTS for an (incomplete) list
+;;; of present and past contributors.
 ;;;
-;;; Copyright (C) 1990, 1991, 1992, 1993 Chris McConnell
-;;;               1993, 1994 Ivan Vasquez
-;;;               1994, 1995, 1996 Marco Antoniotti and Rick Busdiecker
-;;;               1996-2000 Marco Antoniotti and Rick Campbell
-;;;
-;;; Other authors' names for which this Copyright notice also holds
-;;; may appear later in this file.
-;;;
-;;; Send mail to 'majordomo@cons.org' to be included in the
-;;; ILISP mailing list. 'ilisp@cons.org' is the general ILISP
-;;; mailing list were bugs and improvements are discussed.
-;;;
-;;; ILISP is freely redistributable under the terms found in the file
-;;; COPYING.
-
-
-
-;;;
-;;; ILISP mode top level definitions.
-;;; 
+;;; $Id$
 
 ;;;%ilisp-mode
 
 (ilisp-set-doc 'lisp-mode ilisp-documentation)
 
 ;;;%%ILISP
-(defun lisp-command-args (string)
-  "Break up STRING into (command args ...)."
-  (let ((len (length string))
-	(position 0)
-	(arg 0)
-	(args nil))
-    (while (< position len)
-      (if (eq (aref string position) ?\ )
-	  (setq args (cons (substring string arg position)  args)
-		arg (1+ position)))
-      (setq position (1+ position)))
-    (setq args (reverse (cons (substring string arg position)  args)))
-    args))
-
+(defun lisp-command-args (command-line)
+  "Break up COMMAND-LINE into (command args ...)"
+  (condition-case nil
+      (loop with start = 0
+            while start
+            for pos = (string-match "\\S-" command-line start)
+            while pos
+            if (char-equal (aref command-line pos) ?\")
+            collect (let ((str+end-pos (read-from-string command-line pos)))
+                      (setq start (cdr str+end-pos))
+                      (car str+end-pos))
+            else collect (let ((end-pos (string-match "\\s-" command-line pos)))
+                           (setq start end-pos)
+                           (substring command-line pos end-pos)))
+    (error (error "Invalid inferior Lisp program command line"))))
 
 
 ;;;
 	      mode-name "ILISP")
 	(rplaca (car comint-send-queue) 
 		(function (lambda ()
-			    (run-hooks 'ilisp-init-hook))))
+			    (run-hooks 'ilisp-init-hook-local))))
 	(setq ilisp-initialized (delete* ilisp-buffer ilisp-initialized
 					 :test #'equal))
 	(unless (member* names ilisp-buffers :key #'car)