From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: john muhl Newsgroups: gmane.emacs.bugs Subject: bug#71415: 30.0.50; vtable-current-object off by one Date: Sat, 15 Jun 2024 13:55:03 -0500 Message-ID: <87frte9gu0.fsf@pub.pink> References: <87h6e4u9ec.fsf@pub.pink> <86ikyavbt1.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10221"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.12.1; emacs 30.0.50 Cc: 71415-done@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 15 20:56:20 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1sIYZW-0002Nb-KK for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 15 Jun 2024 20:56:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sIYZH-0000og-BU; Sat, 15 Jun 2024 14:56:03 -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 1sIYZF-0000lP-DG for bug-gnu-emacs@gnu.org; Sat, 15 Jun 2024 14:56:01 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sIYZF-000761-3U for bug-gnu-emacs@gnu.org; Sat, 15 Jun 2024 14:56:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sIYZF-0002hz-Tq for bug-gnu-emacs@gnu.org; Sat, 15 Jun 2024 14:56:01 -0400 Resent-From: john muhl Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Jun 2024 18:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 71415 X-GNU-PR-Package: emacs Mail-Followup-To: 71415@debbugs.gnu.org, jm@pub.pink, jm@pub.pink Original-Received: via spool by 71415-done@debbugs.gnu.org id=D71415.171847771310257 (code D ref 71415); Sat, 15 Jun 2024 18:56:01 +0000 Original-Received: (at 71415-done) by debbugs.gnu.org; 15 Jun 2024 18:55:13 +0000 Original-Received: from localhost ([127.0.0.1]:41209 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sIYYT-0002fL-BB for submit@debbugs.gnu.org; Sat, 15 Jun 2024 14:55:13 -0400 Original-Received: from fout8-smtp.messagingengine.com ([103.168.172.151]:52385) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sIYYR-0002ez-Ro for 71415-done@debbugs.gnu.org; Sat, 15 Jun 2024 14:55:12 -0400 Original-Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfout.nyi.internal (Postfix) with ESMTP id BDAE1138017D; Sat, 15 Jun 2024 14:55:05 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sat, 15 Jun 2024 14:55:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pub.pink; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1718477705; x=1718564105; bh=FYeTQFvokYOF7Hby2S7FiHHymN+Fst9GynKEQzBdt3M=; b= EGn3jCCLUhty7qvzQw9lfWZ0KOihSVyH7YfeFEOgvIiilrvf1dWqm7Y68MKCQjW6 vT+c9wfBkHH5yenuhwxnBqQGmq7NTd/19ujzp36SLXwrYBWfeYw0ryn6YG7oaVwr yhCaMZGnvbwTLnUdQgJ8OUuL6KsKQeEO58VOkyS9pUAy/iNaCVo/2kmeUgSCZM/E t8RDfVNpFqL7n7X8tVA++j5rCIbPKAOMEHIayegmV66AYH8W+kuTEX+H2RshwpmU X8n/GIf1K5BUBpdd/OXPeTyvjRL9cuPKMaJiKkhdWKa+Ym8JFMdt/OX9Zx0Bne0+ jWm01kaMAMWwI2Lp8z1maw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1718477705; x= 1718564105; bh=FYeTQFvokYOF7Hby2S7FiHHymN+Fst9GynKEQzBdt3M=; b=c BE+zDuiMrvC/Yiib2DDynZyr6kjnPYSvIT3Bn/ZQ7sYmuMmnt9bUxm03kc/c5m2T 1XQ68uszWzvh77bNPwpedvDzrpM2cm7hWLY+oS4oeczCLsus8KG6WIGJDszDMOLO 450ZQkTRUwjDhOJl1MipUzM1zxCK6f8XZ/TqLWYiC2eo7y0ZjVbWzYKXt+ksNKdd FOZfSHneOxUcMgqwjkiHMGTLCyKI51iKbsQwATIjZGlu6QKOkUs6yGv4nYn0qAQp I/u7Z3bGBw7ahUB+x8DKaJVEwL5KdC2YuCxnAlsinpH3waLRFoRjfxDut8fUMIFp 2QlPx/yO/HqEL71dn7JJw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfedvuddgudeftdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvfevufgjfhgffffkgggtgfesthhqredttderjeenucfhrhhomhepjhho hhhnuchmuhhhlhcuoehjmhesphhusgdrphhinhhkqeenucggtffrrghtthgvrhhnpeegve ehvddttedvkeduvddttdehhfdvgffgvdfgiedtjeduhefhffejtddvveevkeenucevlhhu shhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehjmhesphhusgdrph hinhhk X-ME-Proxy: Feedback-ID: i74194916:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 15 Jun 2024 14:55:04 -0400 (EDT) In-Reply-To: <86ikyavbt1.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 15 Jun 2024 11:40:26 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:287306 Archived-At: After looking at vtable.el I don=E2=80=99t think this is meant to work how I expected. Eli Zaretskii writes: >> From: john muhl >> Date: Fri, 07 Jun 2024 09:15:07 -0500 >>=20 >> After updating an object, =E2=80=98vtable-current-object=E2=80=99 in the= displayer >> and formatter functions points to the object after the one that >> was updated. Running the following: >>=20 >> (with-current-buffer (get-buffer-create "vtable-demo") >> (require 'vtable) >> (erase-buffer) >> (make-vtable >> :columns '("Index" "Number") >> :objects `((1 ,(random)) (2 ,(random)) (3 ,(random))) >> :displayer (lambda (value &rest _) >> ;; vtable-current-object is off by one; e.g. >> ;; update the first row and v-c-o will be the second r= ow; >> ;; update the final row and v-c-o will be nil. >> (message "%s %s" value (vtable-current-object)) >> (propertize (number-to-string value) 'face 'vtable))) >> (let* ((table (vtable-current-table)) >> (first (nth 0 (vtable-objects table))) >> (other (nth 1 (vtable-objects table))) >> (final (nth 2 (vtable-objects table)))) >> (setf (nth 1 first) 1) >> (setf (nth 1 other) 2) >> (setf (nth 1 final) 3) >> (vtable-update-object table first) >> (vtable-update-object table other) >> (vtable-update-object table final))) >>=20 >> I see in the messages buffer: >>=20 >> 1 (2 2) [2 times] >> 2 (3 3) [2 times] >> 3 nil [2 times] >>=20 >> when I expect to see: >>=20 >> 1 (1 1) [2 times] >> 2 (2 2) [2 times] >> 3 (3 3) [2 times] > > Adam, any comments or suggestions? > > Thanks.