Commits

michaels  committed d42a26d

2007-03-27 Mike Sperber <mike@xemacs.org>

* cmuscheme.el (scheme-program-args): Add.
* cmuscheme.el (run-scheme): Ask for the name of the Scheme
program and its arguments separately. Otherwise, we prevent
Windows users from using file names with spaces in them, such as
"c:\Program Files\...".

  • Participants
  • Parent commits a17f76a

Comments (0)

Files changed (2)

+2007-03-27  Mike Sperber  <mike@xemacs.org>
+
+	* cmuscheme.el (scheme-program-args): Add.
+	* cmuscheme.el (run-scheme): Ask for the name of the Scheme
+	program and its arguments separately.  Otherwise, we prevent
+	Windows users from using file names with spaces in them, such as
+	"c:\Program Files\...".
+
 2003-10-28  Norbert Koch  <viteno@xemacs.org>
 
 	* Makefile (VERSION): XEmacs package 1.14 released.

File cmuscheme.el

 		 (scheme-args-to-list (substring string pos
 						 (length string)))))))))
 
+(defun scheme-list-to-args (args)
+  (let* ((str (apply #'concat
+		   (mapcar #'(lambda (arg)
+			       (concat " " arg))
+			   args)))
+	 (l (length str)))
+    (if (zerop l)
+	str
+      (substring str 1 (length str)))))
+
 (defvar scheme-program-name "scheme"
   "*Program invoked by the run-scheme command")
 
+(defvar scheme-program-args nil
+  "*Command-line arguments to `scheme-program-name'.")
+
 ;;; *don't* ;;;###autoload in XEmacs, since xscheme.el is our default.
-(defun run-scheme (cmd)
+(defun run-scheme (cmd args)
   "Run an inferior Scheme process, input and output via buffer *scheme*.
 If there is a process already running in `*scheme*', switch to that buffer.
 With argument, allows you to edit the command line (default is value
 
   (interactive (list (if current-prefix-arg
 			 (read-string "Run Scheme: " scheme-program-name)
-			 scheme-program-name)))
+			 scheme-program-name)
+		     (scheme-args-to-list
+		      (if current-prefix-arg
+			  (read-string "Command-line arguments: " 
+				       (scheme-list-to-args scheme-program-args))
+			scheme-program-args))))
   (if (not (comint-check-proc "*scheme*"))
-      (let ((cmdlist (scheme-args-to-list cmd)))
-	(set-buffer (apply 'make-comint "scheme" (car cmdlist)
-			   nil (cdr cmdlist)))
+      (progn
+	(set-buffer (apply 'make-comint "scheme" cmd
+			   nil args))
 	(inferior-scheme-mode)))
   (setq scheme-program-name cmd)
+  (setq scheme-program-args args)
   (setq scheme-buffer "*scheme*")
   (pop-to-buffer "*scheme*"))
 ;;; *don't* ;;;###autoload (add-hook 'same-window-buffer-names "*scheme*")