unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Vincent Belaïche" <vincent.belaiche@gmail.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: "Stefan Kangas" <stefan@marxist.se>,
	"Vincent Belaïche" <vincentbelaiche@orange.fr>,
	5852@debbugs.gnu.org, "Göran Uddeborg" <goeran@uddeborg.se>
Subject: bug#5852: 23.1; Incorrect references in ses-mode
Date: Sun, 25 Jul 2021 08:38:26 +0200	[thread overview]
Message-ID: <CAPAOBV8tRBmOW1WKFzHPTaB=jS3aB=3AJVYCfBm64VWt7=jrBQ@mail.gmail.com> (raw)
In-Reply-To: <CAPAOBV-VNa4RXG+igej20x=ykrh5xMfhLs2oAdj=4qvkuT9axQ@mail.gmail.com>

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 à 08:32, Vincent Belaïche
<vincent.belaiche@gmail.com> a écrit :
>
> 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 …
> Anyway, that does not affect the bug-5852 test function as it only
> uses ses-jump for motion.
>   V.
>
> Le dim. 25 juil. 2021 à 08:18, Vincent Belaïche
> <vincent.belaiche@gmail.com> a écrit :
> >
> > The bug-5852 test function does not reproduce the bug on my home PC either …
> >   V.
> >
> > Le dim. 25 juil. 2021 à 08:17, Vincent Belaïche
> > <vincent.belaiche@gmail.com> a écrit :
> > >
> > > The same test function, but with comments :
> > >
> > >
> > > (defun bug-5852 ();;---
> > >   "Check no irrelevant reference is created when a row is inserted and
> > > 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 à 07:56, Vincent Belaïche
> > > <vincent.belaiche@gmail.com> a écrit :
> > > >
> > > > On more significant difference between the function bug-5852 and the
> > > > 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 à 07:48, Vincent Belaïche
> > > > <vincent.belaiche@gmail.com> a écrit :
> > > > >
> > > > > 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 and
> > > > > post command hook are in sequence, so not done concurrently.
> > > > > I wrote this function to try to reproduce the bug, and on my office PC
> > > > > it does not reproduce it:
> > > > >
> > > > > (defun bug-5852 ();;---
> > > > >   "Check no irrelevant reference is created when a row is inserted 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 à 23:46, Vincent Belaïche
> > > > > <vincent.belaiche@gmail.com> a écrit :
> > > > > >
> > > > > > Hello Lars,
> > > > > >
> > > > > > Sorry for not making any feedback for so long, actually I was just
> > > > > > distracted by some other business, and I somewhat had forgotten about
> > > > > > it.
> > > > > >
> > > > > > I suspect a race condition between the post command hook and the next
> > > > > > command. That is to say when one yanks the fomula (the first yank),
> > > > > > one relocates the reference but for this one uses current references
> > > > > > that have not yet been relocated because the previous post-command
> > > > > > hook execution is not yet over.
> > > > > >
> > > > > > The bug does not show every time I do the experiment. I tried this
> > > > > > morning with my office PC which is a fast machine, and it proved out
> > > > > > quite hard to reproduce, even when I launched some big C program
> > > > > > compilation in parallel to eat the mips.
> > > > > >
> > > > > > Next week I will do some experiment with my home PC which is quite
> > > > > > quite slower, and I make some feedback. Unfortunateless both machine
> > > > > > do not have the same emacs version, but anyway all changes in SES
> > > > > > 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 à 15:37, Lars Ingebrigtsen <larsi@gnus.org> a écrit :
> > > > > > >
> > > > > > > Vincent Belaïche <vincentbelaiche@orange.fr> writes:
> > > > > > >
> > > > > > > > I will investigate why and feed back once I have a better idea 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





  reply	other threads:[~2021-07-25  6:38 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-07 16:15 bug#5852: 23.1; Incorrect references in ses-mode Göran Uddeborg
2020-02-29  3:14 ` Stefan Kangas
2020-02-29 20:13   ` Vincent Belaïche
2021-07-18 13:36     ` Lars Ingebrigtsen
2021-07-24 21:46       ` Vincent Belaïche
2021-07-25  5:48         ` Vincent Belaïche
2021-07-25  5:56           ` Vincent Belaïche
2021-07-25  6:17             ` Vincent Belaïche
2021-07-25  6:18               ` Vincent Belaïche
2021-07-25  6:32                 ` Vincent Belaïche
2021-07-25  6:38                   ` Vincent Belaïche [this message]
2021-07-25  6:44                     ` Lars Ingebrigtsen
2021-07-25 17:27                       ` Vincent Belaïche
2021-07-30 21:01                         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-08-02 21:02                           ` Vincent Belaïche
2023-12-29 12:03                       ` Vincent Belaïche
2023-12-29 12:36                         ` Stefan Kangas
2023-12-29 14:19                           ` Eli Zaretskii
2023-12-29 15:19                             ` Vincent Belaïche
2023-12-29 22:01                         ` Göran Uddeborg
2024-01-14 13:17 ` Mattias Engdegård
2024-01-14 13:35   ` Mattias Engdegård

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPAOBV8tRBmOW1WKFzHPTaB=jS3aB=3AJVYCfBm64VWt7=jrBQ@mail.gmail.com' \
    --to=vincent.belaiche@gmail.com \
    --cc=5852@debbugs.gnu.org \
    --cc=goeran@uddeborg.se \
    --cc=larsi@gnus.org \
    --cc=stefan@marxist.se \
    --cc=vincentbelaiche@orange.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).