GNU bug report logs - #25025
python-shell-calculate-command is wrong

Previous Next

Package: emacs;

Reported by: Fabrice Popineau <fabrice.popineau <at> gmail.com>

Date: Fri, 25 Nov 2016 06:26:01 UTC

Severity: normal

Tags: confirmed, fixed

Merged with 20744

Found in version 25.1

Fixed in version 26.1

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Clément Pit--Claudel <clement.pit <at> gmail.com>
To: Noam Postavsky <npostavs <at> users.sourceforge.net>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 25025 <at> debbugs.gnu.org
Subject: bug#25025: python-shell-calculate-command is wrong
Date: Sat, 26 Nov 2016 21:35:10 -0500
[Message part 1 (text/plain, inline)]
On 2016-11-26 19:50, Noam Postavsky wrote:
> Well, CMD can also come from user input, so we would need some way for
> the user to specify a list of arguments. Currently that can work by
> entering a string that would be split by split-string-and-unquote. It
> might be more intuitive to actually use a shell and then the user
> would enter a shell command (though inserting a shell into things
> might bring more complications).

On that topic, I feel that Emacs is missing a solid, standard thing like python's shlex.  split-string-and-unquote is entirely inadequate to split shell commands (it's a great tool, but isn't a mistake to use it on user-supplied command lines?):

  (split-string-and-unquote "python -c 'print \"a\"'")
  ⇒ ("python" "-c" "'print" "a" "'")

John's eshell has such parsing features, but I've never seen them used in other packages; is there a good reason?

Cheers,
Clément.

[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 7 years and 276 days ago.

Previous Next


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