From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Convert the shell command used in emacs init-file into its normal version. Date: Thu, 10 Jun 2021 09:59:53 +0300 Message-ID: <83eedacihi.fsf@gnu.org> References: <83a6nze0b1.fsf@gnu.org> <83tum7c5zu.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33034"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 10 09:02:04 2021 Return-path: Envelope-to: geh-help-gnu-emacs@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 1lrEhX-0008Ri-Cd for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 10 Jun 2021 09:02:03 +0200 Original-Received: from localhost ([::1]:33680 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrEhW-0005Do-EL for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 10 Jun 2021 03:02:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59010) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrEg9-0005By-Cq for help-gnu-emacs@gnu.org; Thu, 10 Jun 2021 03:00:42 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:38848) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrEg3-0007Yj-DL for help-gnu-emacs@gnu.org; Thu, 10 Jun 2021 03:00:35 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:4470 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrEfe-0000sG-Px for help-gnu-emacs@gnu.org; Thu, 10 Jun 2021 03:00:13 -0400 In-Reply-To: (message from Hongyi Zhao on Thu, 10 Jun 2021 10:26:36 +0800) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:130695 Archived-At: > From: Hongyi Zhao > Date: Thu, 10 Jun 2021 10:26:36 +0800 > Cc: help-gnu-emacs > > > > > Did you try using split-string-and-unquote? > > > > > > To be frank, no. It's an eshell command, and I'm unfamiliar with it. > > > Any hints for using it in this case? > > > > Sorry, I don't understand: you want hints for using what? > > > > And how does eshell come into play here, I don't think you mentioned > > that before. > > > > Sorry for my misunderstanding of your meaning. I just want to know the > exact Emacs command sequence for stripping out the black slashes and > quotes of the following string with the function > split-string-and-unquote. > > "curl -s https://api.mathpix.com/v3/latex -X POST -H \"app_id: %s\" -H > \"app_key: %s\" -H \"Content-Type: application/json\" --data > \"{\\\"src\\\":\\\"%s\\\",\\\"formats\\\": > [\\\"latex_styled\\\"],\\\"format_options\\\":{\\\"latex_styled\\\": > {\\\"transforms\\\": [\\\"rm_spaces\\\"]}}}\"" My proposal is to use split-string-and-unquote, then concatenate the members of the resulting list, separated by spaces, with mapconcat or somesuch.