emacs-devel
[Top][All Lists]
Advanced

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

Re: [RFC]: replace-region-contents


From: Eli Zaretskii
Subject: Re: [RFC]: replace-region-contents
Date: Tue, 05 Feb 2019 18:11:40 +0200

> From: Tassilo Horn <address@hidden>
> Date: Tue, 05 Feb 2019 06:57:52 +0100
> Cc: address@hidden
> 
> I don't have a preference.  I guess Eli might argue that this version
> encourages passing strings around instead of using buffers.

Not just strings, _large_ strings.  Small strings are okay, we even
have a special optimization for them.  Large strings are much less
efficient, in both memory management and access, than buffers.  And in
the context of the function we are talking about, the probability of a
string to be large is IMO very high.

I'm not against a string as an option, though.

> I'd explain in the doc string that in the case of a string return
> value, we're going thru a temporary buffer anyway, so if your
> REPLACE-FN ends in (buffer-substring ...), you're clearly doing
> something wrong...

Right, thanks.



reply via email to

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