From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arthur Miller Newsgroups: gmane.emacs.help Subject: Re: Maybe we can improve this function call-process-to-string? Date: Thu, 08 Apr 2021 19:18:09 +0200 Message-ID: References: <83a6q99pnd.fsf@gnu.org> <831rbkao9z.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17231"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (windows-nt) Cc: help-gnu-emacs@gnu.org To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Apr 08 19:21:37 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 1lUYLX-0004KI-Kl for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 08 Apr 2021 19:21:35 +0200 Original-Received: from localhost ([::1]:57396 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lUYLW-0005Zo-KJ for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 08 Apr 2021 13:21:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59754) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lUYIM-0004Gl-QT for help-gnu-emacs@gnu.org; Thu, 08 Apr 2021 13:18:18 -0400 Original-Received: from mail-oln040092072107.outbound.protection.outlook.com ([40.92.72.107]:3438 helo=EUR03-VE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lUYIJ-0002Rl-HQ; Thu, 08 Apr 2021 13:18:18 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gOVt2/mDycluGmVj9C49/rRuuIh9uNOU620sIGQiHm4G6lIL0h1o+xVgOJAM9Hjc3hVBsLxSEP0Tufw32c1T+IorjBn+m7WBCjXk4W5g5ibVXnG0VW2Ig9Tur91dALr11j+fIx+E/ql/UicMiSBmDnOp5Muy47knzdK+KASWmQ/RlSvSR3djFNrSslXrYLzCTtF9HHp+/sLPnx1LBNm4UD5KZor2q5r3itIx5+4E0OhOy+MmWJes7SyLOLPuDBgXJE2TdLTfvvPg+P8DRcbghtPq9WNoCVLA6XJ0iJM8omaZOn0ci8aY9+nEN7YZ6pwNjOvE56e8D6wbPllepd2/Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=V5T0F3drtYD1NWY2BZdzrsqIy1TY6qUbeESOh3A7+iU=; b=ajRpnhgh2qRRbznNPVoWl5Yf0g8ZUvU+QzPZ+P5UjxWGhqR8e8o1XNDmMcx/iFyk7CAif88rSStgvK5thp63CI3zuCBvKhCgPgeJKDlXKrkSLvf78ld7y+zooJKP8RHmGTn9sQzMTPrJHpu/epiKMyh5sdN3U1Ugaq0Xx/9ZSxsfk4+zC6WXzewjOhVmLr5p6C800NtfaIBvQ/hxNm1MkyG9XW5cKnwY478FGbzD/mV2GWDQy+q8fYZkSELmlV+zzwZLejdMg8rnVdT/VcjEE+zF8zaICwZ6z7yKqaxQ3+3sCUvbZK0RrpASQzERFqA44qZwGF9c/HPw+jO71/4Tjg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=V5T0F3drtYD1NWY2BZdzrsqIy1TY6qUbeESOh3A7+iU=; b=I1ipt1/jwDRcLjl2FfZxYoy3txNWPsYxQe4bDJrXE6uciRcsZUW4hzwoWeIbi7vfNtUoZFMSrTHmf7T/y2Fz9nImQmQBaIdvrrtDxhIKqvSQVuCWF+sgygJZi9BTGiA9Am804mxfDTdYXnCac0aj3nP0rmhkl+r75FwY1R6IQzt6AFfAevMemZd2fOvSTgBWwFnfZfA7OFtUeNCBDepeBBS2JdpxZ0wqRlN5pM493aubDcbWoBXp024fHgBF67pl6J0XrYliiWqnwQ26OW1AurUHuXFVyHg2sFIsPPetfuuN98wrijn4uQvqr+55nCd/ovzsmjUGlJZJhCJTkF6oIA== Original-Received: from AM5EUR03FT031.eop-EUR03.prod.protection.outlook.com (2a01:111:e400:7e08::4b) by AM5EUR03HT142.eop-EUR03.prod.protection.outlook.com (2a01:111:e400:7e08::249) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.17; Thu, 8 Apr 2021 17:18:11 +0000 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2a01:111:e400:7e08::47) by AM5EUR03FT031.mail.protection.outlook.com (2a01:111:e400:7e08::111) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.17 via Frontend Transport; Thu, 8 Apr 2021 17:18:11 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:DEC5390E7C53376D10BBDE242A556FBE6731A8164A95B807A208AFF3E5846575; UpperCasedChecksum:BE0636D0B1DD667FEE71177576F4A9AC7623B5D7A9C0FC3FAC618B3CF1D6029A; SizeAsReceived:7563; Count:46 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::2103:e705:bc0c:5a8b]) by AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::2103:e705:bc0c:5a8b%6]) with mapi id 15.20.4020.017; Thu, 8 Apr 2021 17:18:11 +0000 In-Reply-To: (Jean Louis's message of "Thu, 8 Apr 2021 18:56:30 +0300") X-TMN: [qUyXTHIrInb/j5wtDRWpBMhb8uxxqpiR] X-ClientProxiedBy: AM6P194CA0099.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:8f::40) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <82pmz466ge.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from HP-Laptop.homepc (81.232.177.30) by AM6P194CA0099.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:8f::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.17 via Frontend Transport; Thu, 8 Apr 2021 17:18:10 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: de3d3c9c-cb85-4e5d-13ec-08d8fab248e1 X-MS-TrafficTypeDiagnostic: AM5EUR03HT142: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cDUYz1kjZGk00AS9bRZcG1B5kw4ILcnH15Pbiy0f9rlpqJVox682aK0BOCpOG/HMiJe0I7VL0njqjmdOQ0Gj42f0Vf/WPyQEVYsXcWMhK5KPgsqBAJo1e4JwGr8diui+IIi2Pc5tYU2ko7uofvKgzclGQJ7QS//szTXTn+y1AnWOmSFXWKytVZjDj8dUSg19LP2GHhZV2BX5qilRdI72hUmSW0+Rw5gzt/tnKndC//fYyV3Y/nZDpG2+YABEfVPyv+QrObhCC+3iy7sCEHSPEyHfBNbPNQoLjqgZzkVQattSevd2MgaMJDXnsL59b9vl+rcdBc1l9zd0V8YlDtVyxoPAWf2jQSRNdCtac7S9udLa1YTK8m9aP5YDjyGzEHRgHNHkpob20ZHTZ5ds8Qu386+U1ipwEWgK0reJssgHdQXoivZZgtNatom0sFQeXd+3 X-MS-Exchange-AntiSpam-MessageData: hUJp4FmlLyeyafJenI0WDvGCpGQ5pvtdEBJlyus2e6H5Fk8sl7nyA2ojaTJk+bRkMol7FJIB9eUF7pVI/qPkSqCXLvzaYdMG0WfL27VeM+0pIQwXt2KawNC/VbUZAlDqwJ9WpqImc5bNzJ/Al3/iSw== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: de3d3c9c-cb85-4e5d-13ec-08d8fab248e1 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2021 17:18:10.9665 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: AM5EUR03FT031.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5EUR03HT142 Received-SPF: pass client-ip=40.92.72.107; envelope-from=arthur.miller@live.com; helo=EUR03-VE1-obe.outbound.protection.outlook.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:128904 Archived-At: Jean Louis writes: > * Eli Zaretskii [2021-04-08 16:40]: >> > Date: Thu, 8 Apr 2021 14:53:18 +0300 >> > From: Jean Louis >> > Cc: help-gnu-emacs@gnu.org > I would not know how to get output from system command by using those > functions without using shell-command-to-string or call-process M-! your-shell-command That will give you a buffer named `*Shell Command Output*`. You can either switch interactively to that buffer and execute your lisp program via M-x or M-: (depending if it's just a function or interactive command). Alternatively you can call it from lisp like: (shell-command "your comand --with-some-args") and have same buffer. Might be good to provide optional arguments for target buffer and error buffer so you get eventual errors separated in other buffer then one you will process. I would also not use a string for the final result(s), just do everyting in that buffer, remove text you don't need and construct your link(s) in that buffer, it will probably be faster than creating temp buffer and taking buffer strings. > (push (shell-command-to-string command) list))) > (kill-new (with-temp-buffer > (dolist (item list) > (insert item)) > (buffer-string))))) It is really inneficient to push result form the command to a list to traverse it later and insert into buffer, when Emacs does that already for you by default. > [![https://gnu.support/images/1536/gnu-head-large.jpg](https://gnu.support/images/1536/gnu-head-large.jpg =1536x1024 "https://gnu.support/images/1536/gnu-head-large.jpg")](https://gnu.support/images/1536/gnu-head-large.jpg "https://gnu.support/images/1536/gnu-head-large.jpg") Your website looks very deceptive to me. I don't remember the name of that guy that used to post on this list for a while that was rude to you, but looking at your site now I understand what he ment. I have no idea who you are or what you do, but something tells me that is not an official GNU support site, isn't it? Maybe you have all best intentions, but it looks shady, more akin to a scam page. Hopefully that form on the front page looks so ugly so nobody will fall for it, but if I would you and value GNU movement as much as you do, I would probably change that domain name and removed that from the web, as well as changed that email from "bugs@gnu.support" to something less deceptive, because it also looks shady to me. I am by no mean associated with GNU, more than being a mere user of GNU software, so I can only express my personal feeling when I saw it. I understand you mean well but that is how it looks like. I understand you mean well :). Best regards /a