GNU bug report logs - #16005
inferior-lisp and filenames with spaces

Previous Next

Package: emacs;

Reported by: Steven Litvintchouk <sdlitvin <at> earthlink.net>

Date: Fri, 29 Nov 2013 23:20:02 UTC

Severity: minor

Tags: moreinfo

Found in version 24.3

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Steven Litvintchouk <sdlitvin <at> earthlink.net>
Cc: 16005 <at> debbugs.gnu.org
Subject: bug#16005: inferior-lisp and filenames with spaces
Date: Thu, 15 Jul 2021 07:33:33 +0200
Steven Litvintchouk <sdlitvin <at> earthlink.net> writes:

> Trying to run an inferior lisp program on Windows 7,
> with the value of inferior-lisp-program set to 
> "D:/More Program Files (x86)/clisp-2.49/clisp.exe",
>
> caused an error with error message:
> "Spawning child process: invalid argument"
>
> The reason is that the function inferior-lisp (defined in inf-lisp.el)
> calls the function split-string, whose arg SEPARATORS defaults to "[ \f\t\n\r\v]+".

This problem is still present in Emacs 28:

  (interactive (list (if current-prefix-arg
			 (read-string "Run lisp: " inferior-lisp-program)
		       inferior-lisp-program)))
  (if (not (comint-check-proc "*inferior-lisp*"))
      (let ((cmdlist (split-string cmd)))
	(set-buffer (apply (function make-comint)
			   "inferior-lisp" (car cmdlist) nil (cdr cmdlist)))
	(inferior-lisp-mode)))

The only way this could work is that if we either split the prompt into
two parts (one for the command and one for the options), or that we
require that the user quotes the spaces, and then use a splitting
function that's aware of that.  So the user would have to type

"D:/More Program Files (x86)/clisp-2.49/clisp.exe" -some -option

or the like.

I thought Emacs had a shell-syntax-aware splitting function (that would
tokenise that into a list of three items), but I can't find it now...
anybody remember what it's called (if we do have it)?  I.e.,

(that-func "\"foo bar\" zot") => ("foo bar" "zot")

and

(that-func "foo\\ bar zot") => ("foo bar" "zot")


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 4 years and 31 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.