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

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

RE: [External] : Passing buffers to function in elisp


From: Drew Adams
Subject: RE: [External] : Passing buffers to function in elisp
Date: Tue, 21 Feb 2023 23:21:47 +0000

> I'm reading some bytes into a temp buffer, like so:
> 
>   (with-temp-buffer
>     (set-buffer-multibyte nil)
>     (insert-file-contents-literally filename nil 0 64000))
> 
> then I pass these bytes to functions for processing, like this
> 
>     (func1 (buffer-string))
> 
> or sometimes just part of them
> 
>     (func2 (substring (buffer-string) 100 200))

Why aren't you passing the buffer itself to func1?
Why aren't you passing the buffer itself and the limits 100 and 200 to func2?

What is it that you're really trying to do?

Yes, if you start manipulating strings instead of buffer text you will pay a 
performance penalty, in general.



reply via email to

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