From: Emanuel Berg <incal@dataswamp.org>
To: help-gnu-emacs@gnu.org
Subject: Re: shell-command-on-region but with command line arguments
Date: Tue, 08 Nov 2022 01:13:33 +0100 [thread overview]
Message-ID: <877d06nw0i.fsf@dataswamp.org> (raw)
In-Reply-To: 63695966.5d0a0220.15a40.29d3@mx.google.com
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
next prev parent reply other threads:[~2022-11-08 0:13 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-07 15:51 shell-command-on-region but with command line arguments Luca Ferrari
2022-11-07 17:22 ` Emanuel Berg
2022-11-07 19:21 ` Bruno Barbier
2022-11-08 0:13 ` Emanuel Berg [this message]
2022-11-09 7:21 ` Luca Ferrari
2022-11-09 7:53 ` Bruno Barbier
2022-11-09 10:37 ` Emanuel Berg
2022-11-09 11:40 ` Luca Ferrari
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877d06nw0i.fsf@dataswamp.org \
--to=incal@dataswamp.org \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.