help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: shell-command-on-region but with command line arguments


From: Emanuel Berg
Subject: Re: shell-command-on-region but with command line arguments
Date: Tue, 08 Nov 2022 01:13:33 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Bruno Barbier wrote:

>> I was wondering if there's a way to prompt me for optional
>> command line arguments, so that the command should run
>> against the buffer/region followed by a list of arguments.
>> Any idea?
>
> The section "Defining Commands" of the elisp
> manual 
>
>   (info "(elisp)Defining Commands")
>
> should allow you to prompt for additional arguments.

Ah, that was the question?

If so, there are several ways to do that depending on what you
want. For interactive use you can do this:

(let ((args "-h -l -X"))
  (read-string
   (format-prompt "args" args)
   nil nil args) )

Eval and try: RET, M-n, type whatever ...

(Shouldn't `read-string' with DEFAULT-VALUE do the
`format-prompt' part for us BTW?)

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

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