From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Vincent =?UTF-8?Q?Bela=C3=AFche?= Newsgroups: gmane.emacs.bugs Subject: bug#5852: 23.1; Incorrect references in ses-mode Date: Sun, 25 Jul 2021 08:38:26 +0200 Message-ID: References: <845zfpi242.fsf@gmail.com> <871r7vrbez.fsf@gnus.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="24950"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stefan Kangas , Vincent =?UTF-8?Q?Bela=C3=AFche?= , 5852@debbugs.gnu.org, =?UTF-8?Q?G=C3=B6ran?= Uddeborg To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jul 25 08:39:12 2021 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 1m7Xn6-0006Hq-0p for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 25 Jul 2021 08:39:12 +0200 Original-Received: from localhost ([::1]:52342 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m7Xn5-0007o5-0f for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 25 Jul 2021 02:39:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44214) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m7Xmx-0007kV-1s for bug-gnu-emacs@gnu.org; Sun, 25 Jul 2021 02:39:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35858) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m7Xmw-0001DL-Pt for bug-gnu-emacs@gnu.org; Sun, 25 Jul 2021 02:39:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m7Xmw-0008Ca-O6 for bug-gnu-emacs@gnu.org; Sun, 25 Jul 2021 02:39:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Vincent =?UTF-8?Q?Bela=C3=AFche?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 25 Jul 2021 06:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 5852 X-GNU-PR-Package: emacs Original-Received: via spool by 5852-submit@debbugs.gnu.org id=B5852.162719513031503 (code B ref 5852); Sun, 25 Jul 2021 06:39:02 +0000 Original-Received: (at 5852) by debbugs.gnu.org; 25 Jul 2021 06:38:50 +0000 Original-Received: from localhost ([127.0.0.1]:47403 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m7Xmj-0008C2-Rz for submit@debbugs.gnu.org; Sun, 25 Jul 2021 02:38:50 -0400 Original-Received: from mail-pj1-f45.google.com ([209.85.216.45]:40932) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m7Xmd-0008BW-Np for 5852@debbugs.gnu.org; Sun, 25 Jul 2021 02:38:45 -0400 Original-Received: by mail-pj1-f45.google.com with SMTP id u9-20020a17090a1f09b029017554809f35so15058760pja.5 for <5852@debbugs.gnu.org>; Sat, 24 Jul 2021 23:38:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=4WSwi6bdmCkuPSMTXW+VCfDD8pv8bvH5rWdXWFGWgso=; b=ntj2IxztIohFR4muK/a/9552fsJZdy3cfWWhk/CPyA2HkD7N441UPFT8kNcAdUQHz9 ExfPSur64ntn5WG2ljZ+e/zOhZcllgr+eX9MjOXLpo1ybdboUb/O3TCpaoGXdf9Ec3EN Lqe5XoRBFHWTMcMDRbE3R1zsQkYS2eNVXU4cHycvCIMH+vsHk/xDADJ15WuuKd8EIuTA qf8co9oVqxc4K6m9N/kvySfUHTKzRsP6G24Stuq6X5JfGnXhQUR3V4/7j8G1TtB8SNvl 0EVwzHeeAWkNtU5scNJTWZc4dKeaJBXqiW41tCzeab+fI4YPRKtA6lfXAqnvSmlJVQDy Zb+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=4WSwi6bdmCkuPSMTXW+VCfDD8pv8bvH5rWdXWFGWgso=; b=HqKQgvAmqAinW5DofGhXVVUBBrEZz46ylwNCUJL9ujAtaX5s2dCuTb004sGZh5aN8n bThjaKs7RRJXb0HLZ5tDDdeQgd2wrq/UitP2QBWBKPWdoEN0Jqk+V0RRtU14g1dAZtbK 2Xn9bBJhLJGtj+mL2R9UUyDoDMvxn8G3V4kcQFTY8Yys1odj7hYSLU9TkIEKaEjbrkUO uhOi5CGrx7F/8cztubBA3Mj8zqT3JII53CAhK4KcwZkGltEg8vJKTMuvChsAZkET0AuQ xYuJ70Emug3ZdAUx29ky8IvXn6Rrkl+nf2yBkHcGI8lccWZlYFM59ZyI6gke5lK/llaQ RN0Q== X-Gm-Message-State: AOAM530k53k3Ilz21X8THpwys8AYxC+x3YEofmVjQk5rh5IuNXSyF6uj i3YjQz+rVfmg/CiXSZN20ni1sywqhU7P9XyTa6Q= X-Google-Smtp-Source: ABdhPJwW2fSKDZ7/649C4fQU4NmMcjr82XF8yPi9IVcyhRw+gcaCUyONHR/NurKqO5lUsNRhCh92b8ZWRqxMZ49A7H0= X-Received: by 2002:aa7:87cd:0:b029:32e:7954:2872 with SMTP id i13-20020aa787cd0000b029032e79542872mr12297201pfo.0.1627195117851; Sat, 24 Jul 2021 23:38:37 -0700 (PDT) In-Reply-To: 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" Xref: news.gmane.io gmane.emacs.bugs:210683 Archived-At: Just to say that I did the test manually on my home PC a couple of time, and I could not reproduce the problem. That is quite annoying, yesterday I reproduced it on my office PC once. V. Le dim. 25 juil. 2021 =C3=A0 08:32, Vincent Bela=C3=AFche a =C3=A9crit : > > By doing the test manually on my home PC I found some interesting > difference. After > > 2 RET > > on my home PC the cursor goes to the end of buffer narrowed region, > while on my office PC it goes to B2. This means that the TAB that > follows won't the same effect. On my home PC it creates a 3rd row, > while on my office PC it creates the 3rd column. > I found the reason why so : my home PC had some customization for the > ses-after-entry-functions. After erasing customization I had the same > behaviour =E2=80=A6 > Anyway, that does not affect the bug-5852 test function as it only > uses ses-jump for motion. > V. > > Le dim. 25 juil. 2021 =C3=A0 08:18, Vincent Bela=C3=AFche > a =C3=A9crit : > > > > The bug-5852 test function does not reproduce the bug on my home PC eit= her =E2=80=A6 > > V. > > > > Le dim. 25 juil. 2021 =C3=A0 08:17, Vincent Bela=C3=AFche > > a =C3=A9crit : > > > > > > The same test function, but with comments : > > > > > > > > > (defun bug-5852 ();;--- > > > "Check no irrelevant reference is created when a row is inserted an= d > > > a formula is yanked" > > > (interactive);;--- > > > (let ((ses-initial-size '(3 . 3))); size before last row insertion, > > > due to all preceding TAB & C-o > > > (with-temp-buffer > > > (ses-mode) > > > (dolist (val '( > > > (ses-edit-cell 0 1 1) ; 1 RET > > > (ses-edit-cell 1 0 2) ; 2 RET > > > (ses-edit-cell 1 1 (+ B1 A2)) ; ( + SPC B1 SPC A2 = RET > > > (ses-edit-cell 2 0 3) ; 3 RET > > > (ses-edit-cell 2 1 (+ B2 A3)) ; ( + SPC B2 SPC A3 = RET > > > (ses-jump A3) ; C-n > > > (ses-insert-row 1) ; C-o > > > (ses-edit-cell 2 0 4) ; 4 RET > > > (ses-jump B2) ; C-p > > > )) > > > (apply 'funcall-interactively val) > > > (ses-command-hook)) > > > (let ((beg (point-marker))); C-SPC > > > (ses-jump 'C2) ; C-f > > > (copy-region-as-kill beg (point) nil); M-w > > > (set-marker beg nil)) > > > (dolist (val '( > > > (ses-jump B3); C-n C-b > > > (yank) ; C-y > > > (ses-jump B4); C-n > > > (yank); C-y > > > )) > > > (apply 'funcall-interactively val) > > > (ses-command-hook)) > > > (ses-repair-cell-reference-all) > > > ))) > > > > > > Le dim. 25 juil. 2021 =C3=A0 07:56, Vincent Bela=C3=AFche > > > a =C3=A9crit : > > > > > > > > On more significant difference between the function bug-5852 and th= e > > > > example is the the initial size is (3 . 3) instead of (1. 1). This = is > > > > because I speculated that only the last row insertion (C-o) plays a > > > > role. > > > > > > > > V. > > > > > > > > Le dim. 25 juil. 2021 =C3=A0 07:48, Vincent Bela=C3=AFche > > > > a =C3=A9crit : > > > > > > > > > > Just to add something : reading again SES code, and (info "(elisp= ) > > > > > Command Overview") I am a bit skeptical about the explanation in = my > > > > > previous email. > > > > > It seems that only key strokes are queue, but command execution a= nd > > > > > post command hook are in sequence, so not done concurrently. > > > > > I wrote this function to try to reproduce the bug, and on my offi= ce PC > > > > > it does not reproduce it: > > > > > > > > > > (defun bug-5852 ();;--- > > > > > "Check no irrelevant reference is created when a row is inserte= d and > > > > > a formula is yanked" > > > > > (interactive);;--- > > > > > (let ((ses-initial-size '(3 . 3))) > > > > > (with-temp-buffer > > > > > (ses-mode) > > > > > (dolist (val '( > > > > > (ses-edit-cell 0 1 1) > > > > > (ses-edit-cell 1 0 2) > > > > > (ses-edit-cell 1 1 (+ B1 A2)) > > > > > (ses-edit-cell 2 0 3) > > > > > (ses-edit-cell 2 1 (+ B2 A3)) > > > > > (ses-jump A3) > > > > > (ses-insert-row 1) > > > > > (ses-edit-cell 2 0 4) > > > > > (ses-jump B2) > > > > > )) > > > > > (apply 'funcall-interactively val) > > > > > (ses-command-hook)) > > > > > (let ((beg (point-marker))) > > > > > (ses-jump 'C2) ; C-n > > > > > (copy-region-as-kill beg (point) nil) > > > > > (set-marker beg nil)) > > > > > (dolist (val '( > > > > > (ses-jump B3) > > > > > (yank) > > > > > (ses-jump B4) > > > > > (yank) > > > > > )) > > > > > (apply 'funcall-interactively val) > > > > > (ses-command-hook)) > > > > > (ses-repair-cell-reference-all) > > > > > ))) > > > > > > > > > > Please note that the main difference with the provided example is= that > > > > > motion is done with ses-jump, and not with motion commands. Also = the > > > > > save to keyring is not done interatively. > > > > > V. > > > > > > > > > > Le sam. 24 juil. 2021 =C3=A0 23:46, Vincent Bela=C3=AFche > > > > > a =C3=A9crit : > > > > > > > > > > > > Hello Lars, > > > > > > > > > > > > Sorry for not making any feedback for so long, actually I was j= ust > > > > > > distracted by some other business, and I somewhat had forgotten= about > > > > > > it. > > > > > > > > > > > > I suspect a race condition between the post command hook and th= e next > > > > > > command. That is to say when one yanks the fomula (the first ya= nk), > > > > > > one relocates the reference but for this one uses current refer= ences > > > > > > that have not yet been relocated because the previous post-comm= and > > > > > > hook execution is not yet over. > > > > > > > > > > > > The bug does not show every time I do the experiment. I tried t= his > > > > > > morning with my office PC which is a fast machine, and it prove= d out > > > > > > quite hard to reproduce, even when I launched some big C progra= m > > > > > > compilation in parallel to eat the mips. > > > > > > > > > > > > Next week I will do some experiment with my home PC which is qu= ite > > > > > > quite slower, and I make some feedback. Unfortunateless both ma= chine > > > > > > do not have the same emacs version, but anyway all changes in S= ES > > > > > > since the version on my home PC are not related to this bug, so > > > > > > nevertheless that will be a good indication whether my guess is > > > > > > correct. > > > > > > > > > > > > V. > > > > > > > > > > > > Le dim. 18 juil. 2021 =C3=A0 15:37, Lars Ingebrigtsen a =C3=A9crit : > > > > > > > > > > > > > > Vincent Bela=C3=AFche writes: > > > > > > > > > > > > > > > I will investigate why and feed back once I have a better i= dea of what > > > > > > > > is happening. > > > > > > > > > > > > > > Hi, > > > > > > > > > > > > > > this was a year ago. Did you make any progress on this issue= ? > > > > > > > > > > > > > > -- > > > > > > > (domestic pets only, the antidote for overdose, milk.) > > > > > > > bloggy blog: http://lars.ingebrigtsen.no