GNU bug report logs - #18823
Built-in support for visiting compressed files

Previous Next

Package: emacs;

Reported by: Dani Moncayo <dmoncayo <at> gmail.com>

Date: Sat, 25 Oct 2014 09:18:02 UTC

Severity: wishlist

Found in version 24.4

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #21 received at 18823 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 18823 <at> debbugs.gnu.org, dmoncayo <at> gmail.com
Subject: Re: bug#18823: Built-in support for visiting compressed files
Date: Wed, 14 Jul 2021 15:49:32 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: Dani Moncayo <dmoncayo <at> gmail.com>,  18823 <at> debbugs.gnu.org
> Date: Tue, 13 Jul 2021 23:28:44 +0200
> 
> This also reminded me that I wanted to add a function that does the
> "reverse" of `insert-buffer-substring', which I don't think we have.  That
> is, to allow saying
> 
> (let ((buf (current-buffer)))
>   (with-temp-buffer
>     (create-lots-of-data)
>     (insert-into-buffer buf (point-min) (point-max))))
> 
> in an efficient way.  When dealing with temporary buffers, you have to
> contort yourself to use `insert-buffer-substring' in the other
> direction, and
> 
> (insert
>   (with-temp-buffer
>     ...
>     (buffer-string)))
> 
> is pretty inefficient.

To insert text, you must make the buffer into which you insert be the
current buffer.  That's how the low-level insertion primitives work.
So what will insert-into-buffer do that is different (and more
efficient) than the contortion you need to do now, which involves
temporary switch to the target buffer?

Or what am I missing?




This bug report was last modified 3 years and 311 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.