help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Maybe we can improve this function call-process-to-string?


From: Arthur Miller
Subject: Re: Maybe we can improve this function call-process-to-string?
Date: Thu, 08 Apr 2021 19:18:09 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (windows-nt)

Jean Louis <bugs@gnu.support> writes:

> * Eli Zaretskii <eliz@gnu.org> [2021-04-08 16:40]:
>> > Date: Thu, 8 Apr 2021 14:53:18 +0300
>> > From: Jean Louis <bugs@gnu.support>
>> > 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]