[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#16005: inferior-lisp and filenames with spaces

From: Lars Ingebrigtsen
Subject: bug#16005: inferior-lisp and filenames with spaces
Date: Thu, 15 Jul 2021 10:00:23 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

>> Which is why I wondered whether we had a function to split based on
>> shell(ish) syntax, which would be the optimal solution here...
> I think split-string-and-unquote is the only one that comes close.  If
> someone wants to emulate the shells we support, patches are welcome
> (and then there will still be the problem to know the exact shell
> which is being targeted in each use case).

That's true.   However, this reminded me that we do have pretty good
completion in `M-!', so I thought we must have some tokenisation support
somewhere, and indeed: `shell--parse-pcomplete-arguments' seems to fit
the bill here.  So adding a `shell-split-string' by wrapping that
function seems like it should be possible.  I'll poke some more at it;
it doesn't quite seem to handle \ as expected in all circumstances.

It handles "" and '' fine, as far as I can tell:

'foo"bar' zot
-> (("foo\"bar" "zot") 1 11)

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]