From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.devel Subject: Question about start-process and argument list Date: Thu, 02 Feb 2023 19:48:42 -0800 Message-ID: <87r0v7wgrp.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30605"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: emacs-devel@gnu.org Cancel-Lock: sha1:r4CPUGADGDg5BPihrIpILpLKiY0= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Feb 03 07:36:03 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pNpg2-0007ic-6s for ged-emacs-devel@m.gmane-mx.org; Fri, 03 Feb 2023 07:36:02 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNpfJ-0000YN-1e; Fri, 03 Feb 2023 01:35:17 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNn4N-0000pk-Uf for emacs-devel@gnu.org; Thu, 02 Feb 2023 22:48:59 -0500 Original-Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNn4M-0003eV-0o for emacs-devel@gnu.org; Thu, 02 Feb 2023 22:48:59 -0500 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1pNn4F-0001pq-Sd for emacs-devel@gnu.org; Fri, 03 Feb 2023 04:48:51 +0100 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 03 Feb 2023 01:35:15 -0500 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:302915 Archived-At: 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