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.bugs Subject: bug#71415: 30.0.50; vtable-current-object off by one Date: Mon, 17 Jun 2024 19:24:18 +0300 Message-ID: <86tthrr0zx.fsf@gnu.org> References: <87h6e4u9ec.fsf@pub.pink> <86ikyavbt1.fsf@gnu.org> <87v8278zex.fsf@pub.pink> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17752"; mail-complaints-to="usenet@ciao.gmane.io" Cc: adam@alphapapa.net, 71415@debbugs.gnu.org To: john muhl Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jun 17 18:25:27 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 1sJFAb-0004O5-Jx for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 17 Jun 2024 18:25:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sJFAF-00069P-NU; Mon, 17 Jun 2024 12:25: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 1sJFAC-00068r-TY for bug-gnu-emacs@gnu.org; Mon, 17 Jun 2024 12:25: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 1sJFAC-0003Ip-Jo for bug-gnu-emacs@gnu.org; Mon, 17 Jun 2024 12:25:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sJFAE-0002Gm-Bi for bug-gnu-emacs@gnu.org; Mon, 17 Jun 2024 12:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 17 Jun 2024 16:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71415 X-GNU-PR-Package: emacs Original-Received: via spool by 71415-submit@debbugs.gnu.org id=B71415.17186414768683 (code B ref 71415); Mon, 17 Jun 2024 16:25:02 +0000 Original-Received: (at 71415) by debbugs.gnu.org; 17 Jun 2024 16:24:36 +0000 Original-Received: from localhost ([127.0.0.1]:35210 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJF9n-0002Fy-Tt for submit@debbugs.gnu.org; Mon, 17 Jun 2024 12:24:36 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:50616) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJF9k-0002Fj-E0 for 71415@debbugs.gnu.org; Mon, 17 Jun 2024 12:24:34 -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 1sJF9b-0003Dk-5A; Mon, 17 Jun 2024 12:24:23 -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=poDSfrb9LE0pDyVJvc5yjKPLgThCCJhMOeva/4JaEp8=; b=DOR6sBPvgtezaubqxetr JdyxpledixB2R07n/WM9sakl6P3ChG/gY8ElOi6L+wCdsyMPrqzoPnTIoRwNWygACA+7Jos+1AQ8M ROtM/KAMADcPus0qxBRliY9PU3aIhMj3sw2220ycMeRMZd8LrGKIybVCXrsszXpEBdVSd6fHc2MOG gpFJ3gJJiIvvHvR1JwV+Fcf7Rixi1fk99Ki4NUd31yFBOD9/aKuD42JZeGg46WFm89a/bKduUiqOO z/dvx+/dKs0XjhV+ORT0i4+azBUYsiSiHF825k0b1BsV9dYFKpA7BwllrJZ8fRak0/ivyxUAx9hHc ArfHl82U1FC1Fw==; In-Reply-To: <87v8278zex.fsf@pub.pink> (message from john muhl on Mon, 17 Jun 2024 08:35:50 -0500) 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:287404 Archived-At: > From: john muhl > Cc: Eli Zaretskii , 71415@debbugs.gnu.org > Date: Mon, 17 Jun 2024 08:35:50 -0500 > > Adam Porter writes: > > > Hi Eli, John, > > > > My first thought i> Hi Eli, John, > > > > On 6/15/24 03:40, Eli Zaretskii wrote: > >>> From: john muhl > >>> Date: Fri, 07 Jun 2024 09:15:07 -0500 > >>> > >>> After updating an object, ‘vtable-current-object’ in the displayer > >>> and formatter functions points to the object after the one that > >>> was updated. Running the following: > >>> > >>> (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 row; > >>> ;; 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))) > >>> > >>> I see in the messages buffer: > >>> > >>> 1 (2 2) [2 times] > >>> 2 (3 3) [2 times] > >>> 3 nil [2 times] > >>> > >>> when I expect to see: > >>> > >>> 1 (1 1) [2 times] > >>> 2 (2 2) [2 times] > >>> 3 (3 3) [2 times] > >> Adam, any comments or suggestions? > > > s that this code had some changes recently, and the > > bug report indicates that the version of Emacs used was compiled from > > revision f2309557ff366a81183859bda88b9a0012a5d9d6, but I can't find > > that in emacs.git/master. So I'd suggest trying to reproduce it with > > a build of Emacs from master after the related changes. > > > > Secondly, it seems likely to be a violation of intent to call > > `vtable-current-object' inside the table's displayer function. I > > don't think that function is intended to be used within the process of > > updating a vtable. It's intended to be used from outside vtable code > > to find what object's representation point is on in a vtable. > > > > So if it works correctly in that case but not in this apparently > > contrived one, I doubt that this would indicate a bug. And in that > > case, I'd suggest that we be told what the user is actually trying to > > accomplish, in case there's a real bug elsewhere that was > > "rabbit-trailed" into a misunderstanding here. :) > > > > Thanks, > > Adam > > Right. It’s my mistake. Sorry for the bother. No sweat. So should we now close this bug?