bug#33037: 27.0.50; [PATCH] Support program switches in 'comint-run' command

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

bug#33037: 27.0.50; [PATCH] Support program switches in 'comint-run' command

Phil Sainty
This patch enables arguments to be passed to the specified program when
invoking `comint-run'.

Interactively, a prefix argument C-u will make the command prompt for
the switches (as a string) after prompting for the program.  The
switches are processed with `split-string-and-unquote'.

I think this is a sensible enhancement, but not necessarily the best
user interface.  Other possibilities which occur are:

1. Do not require a prefix arg, and simply make this the default
   prompting behaviour.

2. Do not require a separate prompt, and instead parse the program
   and its switches out of a single string.

Either of those would mean that the user doesn't need to bother with
(or remember to use) a prefix argument to enable something which is
arguably important enough to happen by default.

Option (2) is an issue when PROGRAM contains spaces, as the user would
now need to quote that value, which is not currently necessary.  Maybe
the benefits make that a worthwhile change, though?  (i.e. greater ease
of use for the 'normal' use-cases where the path to the program does
not contain spaces).

I suppose option (3) might be "all of the above", with a user option
to select the preferred prompting behaviour, but that might be overkill.

...all of which reminds me that I've been meaning to write a similar
patch to allow switches to be specified for the `term' and `ansi-term'
commands, and a consistent approach in all cases would seem sensible;
so that's something else to keep in mind.


-Phil

0001-Support-program-switches-in-comint-run-command.patch (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

bug#33037: 27.0.50; [PATCH] Support program switches in 'comint-run' command

Lars Ingebrigtsen
Phil Sainty <[hidden email]> writes:

> This patch enables arguments to be passed to the specified program when
> invoking `comint-run'.
>
> Interactively, a prefix argument C-u will make the command prompt for
> the switches (as a string) after prompting for the program.  The
> switches are processed with `split-string-and-unquote'.
>
> I think this is a sensible enhancement, but not necessarily the best
> user interface.  Other possibilities which occur are:
>
> 1. Do not require a prefix arg, and simply make this the default
>    prompting behaviour.
>
> 2. Do not require a separate prompt, and instead parse the program
>    and its switches out of a single string.

I think your patch makes sense as it is, so I've applied it to the Emacs
trunk now.

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