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] Use vtable for eww-bookmarks Date: Sat, 28 Dec 2024 13:04:53 +0200 Message-ID: <86wmfkt6ei.fsf@gnu.org> References: <87ldx0vufd.fsf@sebasmonia.com> <8fde5a67-f778-f0c8-bcdd-ece08c95d369@gmail.com> <87h67nm4su.fsf@sebasmonia.com> <28ba395f-5c52-1fc8-a99a-9bae461520d8@gmail.com> <36a57a48-76ab-4254-b3bc-af1fff2d9b98@app.fastmail.com> <87ttb9k04u.fsf@sebasmonia.com> 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="34747"; mail-complaints-to="usenet@ciao.gmane.io" Cc: jporterbugs@gmail.com, emacs-devel@gnu.org To: adam@alphapapa.net, =?iso-8859-1?Q?Sebasti=E1n_Mon=EDa?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Dec 28 12:06:05 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 1tRUdx-0008sA-DU for ged-emacs-devel@m.gmane-mx.org; Sat, 28 Dec 2024 12:06:05 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRUdK-0004b2-5L; Sat, 28 Dec 2024 06:05:26 -0500 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 1tRUdI-0004ap-In for emacs-devel@gnu.org; Sat, 28 Dec 2024 06:05:24 -0500 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 1tRUdI-00057h-6R; Sat, 28 Dec 2024 06:05:24 -0500 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=DFcUvttOqdz53yE2+vX8TypUIxd7YMFI8WAbZQFD1yU=; b=WSLUSBOFfTSd1Rlq9vWB uZASAGugS41Dx+x1zTFabhA+dQZCxMvUl5FMTIEPTcaAKvMzRgMts8MBP/zQYUGTE1dS4N+mQjXxk wdxKV0TZE4zM4v/otvIsRNKGbUGx2dbiFPYjFtZ0uoL9f/kE3HFmDOufEtvt5DGkF/h/FtSnoULvZ N5IufQVmY3MZ9QIGHLulxnm9cxGKFh9r1NgUsOlyrvrwdh4yIVQxQEbQoMB5fwlCniwBjN4LBSGXZ L8XB2dhcoPR7n9nT0X4O1IOaiXYmFTQeuAQ8+KYeZbIPlarULV9sPXCRtBmW6PlyZb32QWf61KOJe KCoobMwnF/GW0g==; In-Reply-To: (message from =?iso-8859-1?Q?Sebasti=E1n_Mon=EDa?= on Thu, 12 Dec 2024 14:37:23 -0500) 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:327251 Archived-At: Ping! Can we please make some progress here? > From: Sebastián Monía > Cc: Jim Porter , emacs-devel , > Eli Zaretskii > Date: Thu, 12 Dec 2024 14:37:23 -0500 > > Adam Porter writes: > > About regenerating the elements and not being able to use EQ: is that > > because the original bookmark objects are not being used as-is? > > Correct. > > > If so, could we address that? > > We could add the order in the file format. Or number the items when we > read them. Then use the object including the number to track it all. > But when change the "order" number associated with a row, then it won't > be eq/equal anymore, anyway. > > Maybe better: vtable provides a mechanism to have a printer function > called on each row. Then the objects stay the same, in the `eq' sense, > and we can keep the counter for order outside the row, as part of the > printer/"formatter" (in vtable parlance). > > To consider: then we would call a function for each printed row vs > calling it once to generate the list in one go. Plus the code to update > the items order number when removing and inserting each one. > > Of course the real answer on which one is "faster" or "leaner" needs a > benchmark. For 90% of cases the amount of bookmarks won't be more than a > couple dozen, so I don't think it will matter. > > I would leave it as-is on the grounds of (add less code + the > speed/memory difference is small)(1). But as usual, if there's > consensus that we rather do the outlined above instead, I'll do it. > > > (1) like I said, no benchmark, so "_I assume_ the difference is small" > > > On Thu, Dec 12, 2024, 09:25 Sebastián Monía wrote: > > > > Sebastián Monía writes: > > > > > Sebastián Monía writes: > > > Hi all, > > > Attached a patch with "Order" and validation for this sort before > > > kill/yank. > > > As always, open to feedback. > > > > Updated the patch to include the changelog :) > > > > -- > > Sebastián Monía > > https://site.sebasmonia.com/ > > > > -- > Sebastián Monía > https://site.sebasmonia.com/ >