From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Vincent =?UTF-8?Q?Bela=C3=AFche?= Newsgroups: gmane.emacs.bugs Subject: bug#26395: 25.1; ses.el git master, inhibit-quit on some cell evaluations Date: Sun, 28 Jul 2019 17:11:20 +0200 Message-ID: References: <87k26v1wkb.fsf@blah.blah> <87k1c5nmo2.fsf@mouse.gnus.org> <87imrn0zbb.fsf@blah.blah> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="101132"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 Cc: Lars Ingebrigtsen , 26395@debbugs.gnu.org To: Kevin Ryde Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jul 28 17:12:10 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hrkqH-000QA7-GR for geb-bug-gnu-emacs@m.gmane.org; Sun, 28 Jul 2019 17:12:09 +0200 Original-Received: from localhost ([::1]:45604 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hrkqG-0004Iz-6R for geb-bug-gnu-emacs@m.gmane.org; Sun, 28 Jul 2019 11:12:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52371) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hrkqB-0004It-Fg for bug-gnu-emacs@gnu.org; Sun, 28 Jul 2019 11:12:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hrkqA-0001uM-6a for bug-gnu-emacs@gnu.org; Sun, 28 Jul 2019 11:12:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38169) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hrkqA-0001uB-0u for bug-gnu-emacs@gnu.org; Sun, 28 Jul 2019 11:12:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hrkq9-0007Fm-QT for bug-gnu-emacs@gnu.org; Sun, 28 Jul 2019 11:12:01 -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, 28 Jul 2019 15:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26395 X-GNU-PR-Package: emacs Original-Received: via spool by 26395-submit@debbugs.gnu.org id=B26395.156432669027824 (code B ref 26395); Sun, 28 Jul 2019 15:12:01 +0000 Original-Received: (at 26395) by debbugs.gnu.org; 28 Jul 2019 15:11:30 +0000 Original-Received: from localhost ([127.0.0.1]:46990 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hrkpe-0007Eh-9a for submit@debbugs.gnu.org; Sun, 28 Jul 2019 11:11:30 -0400 Original-Received: from mail-wr1-f49.google.com ([209.85.221.49]:41687) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hrkpc-0007EO-2S for 26395@debbugs.gnu.org; Sun, 28 Jul 2019 11:11:28 -0400 Original-Received: by mail-wr1-f49.google.com with SMTP id c2so55910832wrm.8 for <26395@debbugs.gnu.org>; Sun, 28 Jul 2019 08:11:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=WUYdonLxgMacARFytOt2g94SGt17XFoSTOuCifI2gws=; b=u4TG943j9zD/bDaiH7zeEV13lueTYj1JQPurE7n0P6FMotXyARz3lpuvm1DXMTPgFx u+INaAiJsVrtPF81GvbPa6854Pjk9HiPNgzyC/lf/LJ/Ujw7FXw8OJPknaCfIXcKeqs2 g/E31EBIPEXdt4FP8NV2VUY0+/6YsZvbMUr2Aa/nvSM5+Ju1nWYVKEFTe7TNktBz3XMo VP6GL/9GCRR44TBOyByNgeW19HOdkUl8pw3UfOL11lhkdiqi7IMDirBlNrMP6/vn+gjK 05Cww+iAjoS/sR0rTBfDIU+x17JwORWj5s/NlkiT2uYir6P3ChNsj/9AT+Y+4QNkQ3eT Td1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=WUYdonLxgMacARFytOt2g94SGt17XFoSTOuCifI2gws=; b=FJImSmcnqog8N7fUag7Lw3ksOxOPium3ZqqW2MIJzhoCLy5lB0RagE/9/BF3HZyaHu S/WGD+NqmiDYnSZfyqUkw4yjPUNXlzcyirDCzvFxufnfc9Td+n4SBsfT2vjGVXD/1uqS 2Bd3Ri9QHX69UjCOML3FjEl7FpgpsflwnVEHBS8V0mIXLIK40b8HT6701kcKoHsqcw0m 4zTJZ3SfSS41fzM6KbRz54SzP5fYNAROie8uAc8/OhREmOyvNMC/KuohRfhbEAp6wiiN YYe49znE0/u5sTs9RULMapJKCFQQcftpER41kuvXcCPX3zYnWiMx577wXWqI+qIe51Yo chZQ== X-Gm-Message-State: APjAAAWNvbpYvjbcS7z4o+DAdrPOW0nLFL/WVt8AqwxQqUq1xyWSbhUx YRqXNhEMXAT1IilnKeE9r0vekJrq X-Google-Smtp-Source: APXvYqyku732PluH2UQwsuhWxvWNPM0lO4U1imDNDGI3ZGOpJjn27WW0eVtXwWVTz7vLIsKpKiw1Fg== X-Received: by 2002:adf:de08:: with SMTP id b8mr89343584wrm.282.1564326682193; Sun, 28 Jul 2019 08:11:22 -0700 (PDT) Original-Received: from [192.168.1.19] (arennes-656-1-376-211.w90-32.abo.wanadoo.fr. [90.32.124.211]) by smtp.googlemail.com with ESMTPSA id g131sm42011073wmf.37.2019.07.28.08.11.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Jul 2019 08:11:21 -0700 (PDT) In-Reply-To: <87imrn0zbb.fsf@blah.blah> Content-Language: fr X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:163970 Archived-At: Hello, Le 28/07/2019 à 02:37, Kevin Ryde a écrit : > Vincent Belaïche writes: >> >> However, since some processing (updating the cell values) might be >> quite lengthy, you want to be able to quit during that. > > This is a while ago for me, but I arrived at it only from the formula > eval part. > > No doubt storing data and formatted etc should be atomic.  I hoped > only that perhaps those could otherwise be in a consistent state when > a particular formula is evalled, so quit out of something wild is ok. > It would leave some or all recalculates still needed of course. SES has two zones in the buffer. - print area is what you see data area is where the document object is - stored The document object is a vector of cell objects + a few parameters (column count/width, cell width, local printers), each cell object is also implemented as a vector. IMHO what really needs to be atomic --- otherwise recovery is jeopardized : 1) keep correct the number of lines in the print area --- if you don't    have that, locating the data area is jeopardized 2) keep correct the cell widths in the print area, and cell intangible    property --- otherwise the print-area point to cell id is broken 3) any update of the data area. Just reading the code I found one place where this was not observed, and I just made a correction --- see http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=c1b180153f57777b64e27c45633d8a05e02dda5a There are surely a number of other ones which I still need to spot and fix. FYI cell calculation + update of the print area on the one hand is deferred with the list ses--deferred-recalc, and update of the data area is also deferred with the list ses--deferred-write, so inherently there is a risk when you quit to drop the deferred operations and make the cell values inconsistent with the result that calculations would otherwise have, or to break the reference lists, or to make the printed cell values inconsistent with the actual cell values in the document object, or to make the data area inconsistent with the document object. In the latter case (document object inconsistent with data area), reconstructing all will overwrite document object by what is read from data area, loosing your latest edits. Similarly saving the document will not update to consistency the data area, so if you save + close + reopen the file, that won't solve it. What really is needed is the « Dirty » indicator for the user to get warned, and not go on editing a document while there are such inconsistency. This is especially true for inconsistency between document object and data area. I need to fix that, when I am done with remaining bugs in cell renaming.   Vincent.