From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] EWW - use revert--buffer-function to reload, and allow reload in eww-list-buffer Date: Fri, 20 Sep 2024 09:18:54 +0300 Message-ID: <86v7yq7sq9.fsf@gnu.org> References: <86jzgg5pgv.fsf@gnu.org> <86frqunwgu.fsf@gnu.org> <8d5956f2-545d-470d-8f61-59670570b868@app.fastmail.com> <86ikuyitc1.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19622"; mail-complaints-to="usenet@ciao.gmane.io" Cc: jporterbugs@gmail.com, emacs-devel@gnu.org To: =?iso-8859-1?Q?Sebasti=E1n_Mon=EDa?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Sep 20 08:19:25 2024 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 1srWzE-0004xb-Ni for ged-emacs-devel@m.gmane-mx.org; Fri, 20 Sep 2024 08:19:24 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1srWyo-00055M-Ga; Fri, 20 Sep 2024 02:18:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1srWym-00054j-Ri for emacs-devel@gnu.org; Fri, 20 Sep 2024 02:18:57 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1srWym-0004tw-Fu; Fri, 20 Sep 2024 02:18:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=XAglEBcuZxNEgjiFnaTyOMlu1jiiK/QkRE50PMucWgc=; b=O6fvmz6RNDsGrv2p9txX gTyuHTlKRAGIMgX7DoB/2ES3+px1hChRfmcKG1LZd+xKIun9XsR+HpzSISoTPrLEaxoIwTaAG61IW 0bgwsKIUdgTJgPzLx0HizGF5t0pHkOXDemuLqyV9uC7csEBhY5Py5Z1sKgDETiTUEPWZk+ItAVcbq aAhOJG8wPTmwyXufI/SbsVshZX9dHxrjdbX5fuFPQ9HpEHpJloxWaQTJZhNvrly9+gR1tLybIG8wK 1Nuk2z8jF0Vbj+iN40gKU0DiUObj/h8gYJ+V/3xnmaVKFujxrPJmcDZCEV5Rq1SvEbulOlyyH2cOy 4rx/3pdcdHYgng==; In-Reply-To: (message from =?iso-8859-1?Q?Sebasti=E1n_Mon=EDa?= on Thu, 19 Sep 2024 16:47:38 -0400) 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:323811 Archived-At: [Please use Reply All to reply, to CC everyone else and the list.] Resending to the list: > From: Sebastián Monía > Date: Thu, 19 Sep 2024 16:47:38 -0400 > > > Eli Zaretskii writes: > > > Any progress there? > > Not really, but was looking at this for a bit now. > > The way we collect the buffer list first, then print "No buffers" > doesn't help in splitting the function. > > There are many (hacky) ways to work around that, but I am thinking that > maybe it would it be better to use tabulated-list-mode or vtable to > display this? > > I know, the change is more involved. But seems like a better path > forward. > > If you think that's overkill, then one possible hacky solution is: > > 1. split the function in three: eww-list-buffers (command) > eww--print-list-buffers (writes the buffer), eww--collect-list-buffers > (gets the list of buffers and vectors with eww-data) > > 2. setting a buffer-local variable with the EWW buffers info in > eww-list-buffers. > > 3. in eww--print-list-buffers, use the variable if present, discard the > value after using it. Calls for reverting won't find a value and will > call eww--collect-list-buffer. So the first time it re-uses data, and > subsequent calls get it fresh. > > Honestly, seems hacky and convoluted. That's why I thought, hey > maybe this should be a tabulated-list instead. Or vtable. > > -- > Sebastián Monía > https://site.sebasmonia.com/ >