unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Question about start-process and argument list
@ 2023-02-03  3:48 Eric Abrahamsen
  2023-02-03 11:24 ` Jean Louis
  0 siblings, 1 reply; 13+ messages in thread
From: Eric Abrahamsen @ 2023-02-03  3:48 UTC (permalink / raw)
  To: emacs-devel

Hi!

I recently got a bug report about the Mairix search engine for Gnus --
long story short, the gnus-search.el code calls all command-line mail
indexers (notmuch, mairix, namazu, etc) like this:

(apply #'start-process (format "search-%s" server)
			buffer program cp-list)

Where `program' is the indexer, and `cp-list' is a list of command-line
flags. The important thing is that the last element of `cp-list' is the
search-query string itself, but this string has not been split on
spaces. Meaning that cp-list could look like:

'("--rcfile" config-file "-r" "another-arg" "from:bob subject:lunch")

Other search engines seem to accept this fine, but Mairix fails unless
the search query is also split on spaces:

'("--rcfile" config-file "-r" "another-arg" "from:bob" "subject:lunch")

It occurred to me that this is probably the way it should be done, even
if the other engines don't happen to be choking on the format. I have
two questions:

1. What does the program actually see, in this case? Is the first
   example above, is it the equivalent of (on the command line) wrapping
   the query in double quotes?
2. Should I be using `start-process-shell-command' instead? The docs
   mention that the main difference is that it will use shell features,
   which aren't really relevant here, but maybe it's the right thing to
   do, semantically.

Any comments very welcome,
Eric




^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-02-04 18:25 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-03  3:48 Question about start-process and argument list Eric Abrahamsen
2023-02-03 11:24 ` Jean Louis
2023-02-03 19:24   ` Bruno Barbier
2023-02-03 21:23     ` Eric Abrahamsen
2023-02-03 21:34       ` chad
2023-02-03 22:54         ` Eric Abrahamsen
2023-02-03 23:02           ` Bruno Barbier
2023-02-04  2:20             ` Eric Abrahamsen
2023-02-04  6:40             ` tomas
2023-02-04  7:22       ` Jean Louis
2023-02-04 18:25         ` Eric Abrahamsen
2023-02-04  7:18     ` Jean Louis
2023-02-04 18:13       ` Eric Abrahamsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).