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: Eli Zaretskii
Subject: Re: Maybe we can improve this function call-process-to-string?
Date: Thu, 08 Apr 2021 16:39:36 +0300

> Date: Thu, 8 Apr 2021 14:53:18 +0300
> From: Jean Louis <bugs@gnu.support>
> Cc: help-gnu-emacs@gnu.org
> 
> > In general, one should avoid strings in Emacs Lisp, because buffer
> > memory is handled much more efficiently than string memory.
> 
> I understand the concept, not at all how to practically run a system
> command and receive it as a string.

Why do you need a string?  The string is a means to an end, right?
What is that end?

> > buffer-substring?
> 
> Because none of `buffer-substring' nor `buffer-string' can specify the
> buffer name then I have to switch temporarily to other buffer, get
> string with `buffer-string' and return back. I was thinking there is
> some function doing that straight, like (buffer-string BUFFER), but I
> don't find such.

I suggest to look up with-current-buffer and with-temp-buffer.



reply via email to

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