From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: dalanicolai Newsgroups: gmane.emacs.devel Subject: Re: Question about (excessive?) ram usage when many overlays (with large vscroll) Date: Thu, 28 Apr 2022 13:56:55 +0200 Message-ID: References: <87levs2enb.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000084d5605ddb5a046" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15624"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Emacs Devel To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Apr 28 14:03:56 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nk2sG-0003ta-4F for ged-emacs-devel@m.gmane-mx.org; Thu, 28 Apr 2022 14:03:56 +0200 Original-Received: from localhost ([::1]:48696 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nk2sE-0002AW-SH for ged-emacs-devel@m.gmane-mx.org; Thu, 28 Apr 2022 08:03:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50168) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nk2lj-0002dH-Bl for emacs-devel@gnu.org; Thu, 28 Apr 2022 07:57:14 -0400 Original-Received: from mail-yw1-x1131.google.com ([2607:f8b0:4864:20::1131]:33285) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nk2lg-0007Vz-NQ for emacs-devel@gnu.org; Thu, 28 Apr 2022 07:57:10 -0400 Original-Received: by mail-yw1-x1131.google.com with SMTP id 00721157ae682-2f863469afbso26051287b3.0 for ; Thu, 28 Apr 2022 04:57:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=io2I4Wz/vcYnvijO/RalI4rOZKj03kgQm1Ymup8SLUw=; b=qOa3lb6/wBFf8txLKOdW9GIH/N0fnjNOIqpECATqqAQY8grKa2PYPzGb0Bq5XwTZ81 2ucllU9qWu3Q8nPa9EGRSBL+24b3k4Y/Yz60cAxMS+6Q6CpM/oWwaRH7AHk1dfleYPz4 02dNsEGjpin0WY6WIZFvwqwUidqRk9Umv9NbOwRB0AAE7O6duyQ1s42q9HxGamf8UvbN guCuN0FV70RVF9XEHmqi03uy9Zvlp2CZpof/QHDIqaGENND+zsjfSkbyQvN9buILjpUn Ge7MnyGEAEM9VB0PcazyBYIkpjjy03S9d8Rmy38f85fOjr1qcLeQXUONYWoJQKv21Gp2 kVWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=io2I4Wz/vcYnvijO/RalI4rOZKj03kgQm1Ymup8SLUw=; b=QVXnTScdCj0PKq1u/Lmjl56FjGfczI7j7JG+U0oaPpDbMnodlWSxb+3iJ0PlZs/xqo skXeD9ZA8iLw3wfe/nVD80KTwgUn3pDRU3wz7FGY9yI2BDDaDkYM+ruLf3xwITw1hF3n pJA0WoRiCa9/dWcCPBir1xqcpGeAi9U0LcsG2UnQ2l4EhfGasKoY05sP8SIGtjBvvpda GLxWDTpZsy5jg/ngFOoVTp8/LBzsbBdFaB2DVnWj69kx5eiJ/nl9WZOC/ws2FVL31nQ7 NPbUDaA+3HrXFnwyAHk6GePQ7Nv2MFORx8vhi50miZW0wt5+R0YWQR06J7ZQplLld/b4 MHvA== X-Gm-Message-State: AOAM530ZtML5rOJCFVsF3vHtN+NwhK2Xlnk4JqUew21d2XmTCa27szVB 5RAbqIc8oFZWPCmCjiup6SCYQpiD32WVzP7BCwmaKM2kDmi0sg== X-Google-Smtp-Source: ABdhPJwebWycLrZIX/iWfunmy0p7KQ+/sq+WiOV1+/Mcwy685wyHPMHCshoFmVvIZxz80H2JBvOb6VWvNa9+zFOw/Hc= X-Received: by 2002:a81:6d0c:0:b0:2f8:1ba3:64f8 with SMTP id i12-20020a816d0c000000b002f81ba364f8mr15488654ywc.228.1651147027269; Thu, 28 Apr 2022 04:57:07 -0700 (PDT) In-Reply-To: <87levs2enb.fsf@yahoo.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::1131; envelope-from=dalanicolai@gmail.com; helo=mail-yw1-x1131.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:288941 Archived-At: --000000000000084d5605ddb5a046 Content-Type: text/plain; charset="UTF-8" I have a question about this, namely: how to make a line the 'window start'? Using 'set-window-start` does not work. >From 'emacs -Q' (which starts within the scratch buffer), immediately evaluate (set-window-start nil (point)) to set the 'new' window start. Subsequently do (set-window-vscroll nil 1) it will scroll from the start of the buffer, and not from the 'new' window start as I would expect (of course, here there are no lines after the 'new' window start, but you could insert 1 to 3 on separate lines then set the line with 1 to window start, but this does not really change anything). On Tue, 26 Apr 2022 at 14:49, Po Lu wrote: > dalanicolai writes: > > > So I have created `image-roll.el` for displaying documents/books (see > > here). However, I have just noticed that it uses a large amount of > > RAM when viewing (or trying to) pages in the back of 'large' > > books. But even if RAM usage still looks perfectly fine, Emacs crashes > > when trying to scroll to higher page numbers. > > I didn't try to reproduce this problem, but note that it's slow to > vscroll large amounts of text. Instead, find the start of the first > line that will be visible onscreen (using window-text-pixel-size or > posn-at-point), make that the window start, and set vscroll starting > from there instead. > --000000000000084d5605ddb5a046 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I have a question about this, namely: how to make a l= ine the 'window start'?
Using 'set-window-start` does= not work.

From 'emacs -Q' (which starts w= ithin the scratch buffer),
immediately evaluate
(set-window-start nil (point))

to= set the 'new' window start. Subsequently do

(set-window-vscroll nil 1)

it will scroll from = the start of the buffer, and not from the 'new' window start
<= div>as I would expect
(of course, here there are no lines after t= he 'new' window start, but you could
insert 1 to 3 on sep= arate lines then set the line with 1 to window start, but this
do= es not really change anything).


On Tue, 26 Apr 2022= at 14:49, Po Lu <luangruo@yahoo.c= om> wrote:
dalanicolai@gmail.com> writes:

> So I have created `image-roll.el` for displaying documents/books (see<= br> > here).=C2=A0 However, I have just noticed that it uses a large amount = of
> RAM when viewing (or trying to) pages in the back of 'large' > books. But even if RAM usage still looks perfectly fine, Emacs crashes=
> when trying to scroll to higher page numbers.

I didn't try to reproduce this problem, but note that it's slow to<= br> vscroll large amounts of text.=C2=A0 Instead, find the start of the first line that will be visible onscreen (using window-text-pixel-size or
posn-at-point), make that the window start, and set vscroll starting
from there instead.
--000000000000084d5605ddb5a046--