all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Maybe we can improve this function call-process-to-string?
Date: Thu, 08 Apr 2021 16:39:36 +0300	[thread overview]
Message-ID: <831rbkao9z.fsf@gnu.org> (raw)
In-Reply-To: <YG7urrw7N03SFNZj@protected.localdomain> (message from Jean Louis on Thu, 8 Apr 2021 14:53:18 +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	other threads:[~2021-04-08 13:39 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-08  7:40 Maybe we can improve this function call-process-to-string? Jean Louis
2021-04-08  7:55 ` Eli Zaretskii
2021-04-08 11:53   ` Jean Louis
2021-04-08 13:39     ` Eli Zaretskii [this message]
2021-04-08 15:56       ` Jean Louis
2021-04-08 16:25         ` Eli Zaretskii
2021-04-08 18:17           ` Jean Louis
2021-04-08 18:36             ` Eli Zaretskii
2021-04-08 18:44               ` Jean Louis
2021-04-08 17:18         ` Arthur Miller
2021-04-08 18:32           ` Jean Louis
2021-04-08 19:41             ` Arthur Miller
2021-04-09  8:52               ` Jean Louis
2021-04-09 10:07                 ` tomas
2021-04-08 13:08 ` Michael Albinus
2021-04-08 15:50   ` Jean Louis
2021-04-08 17:49 ` Stefan Monnier
2021-04-08 18:33   ` Jean Louis
2021-04-08 18:40   ` Jean Louis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=831rbkao9z.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.