Subject: Re: bug#26395: 25.1; ses.el git master, inhibit-quit on some cell evaluations

From: Vincent Belaïche <[email-masked]>
Date: Sat, 27 Jul 2019 16:20:16 +0200

Hello,

I am not sure what was the exact intention, as this is code which was
written before I became maintainer of SES.

My understanding is that if you quit during modifying the formulas, then
the SES object that under the hood holds all the inputs of the
spreadsheet might get corrupt, and then it would be impossible to
recover from that situation. However, since some processing (updating
the cell values) might be quite lengthy, you want to be able to quit
during that.

Probably there should be some indicator in the mode bar that the
referenes/values/ or display are « dirty », after some quit has occurred
and until the user makes some repair cell reference all + recalculate
all + redisplay all.

Please note that :

- the « repair cell reference » exists ---
   ses-repair-cell-reference-all --- this is one of the additions I did.

- recalculate all exists --- ses-recalculate-all

- but there is not redisplay-all as such, you need to call
   ses-reconstruct-all that will do all three operations, to my
   knonwledge there is no way if you just want to repair the display (for
   instance you have quitted during changing a column width, so the
   cells references and value are not broken, just the display is broken)

FYI, Updating the cell value through the formulaes is made by
post-command-hook, not during the editing of the formula by itself.

Please not that when time allows, my intention was to add some commands
to make some cell permutations (for instance row or column
transposition). I have still not done that, because there are remaining
bugs with the cell renaming, and I wish to solve that before. Also,
quiting/undoing during cell renaming is probably not well supported.

Anyway this discussion is certainly usefull as I have not yet thought
how to handle quiting during such a permutation, and handling undoing of
it --- idealy quitting would be possible, and undoing would undo only
that part that have been done before the quit.

   Vincent.

Le 26/07/2019 à 11:57, Lars Ingebrigtsen a écrit :
 > Kevin Ryde <[email-masked]> writes:
 >
 >> In debian packaged emacs 25.1 but git head ses.el, it seems cell
 >> evaluations sometimes run with inhibit-quit.  For example, initial entry
 >>
 >>     emacs -Q /tmp/foo.ses
 >>     Ret                           # enter formula
 >>     inhibit-quit Ret              # the formula
 >>     =>
 >>     displays t
 >>
 >> I hoped no inhibit-quit while running formulas (and thought there wasn't
 >> previously), as protection against slow or accidentally infinite forms.
 >>
 >> I noticed this in my stock charting program where I communicate with a
 >> database sub-process by accept-process-input, and that func doesn't run
 >> under inhibit-quit.  I could with-local-quit and bail out in a sensible
 >> way, but perhaps there's not meant to be inhibit-quit anyway.
 >
 > Yes, ses.el binds inhibit-quit all over the place, presumably out of an
 > overabundance of caution (not wanting to mess up the display). But it
 > shouldn't do that while computing the formulas, you'd think.
 >
 > I've Cc'd the maintainer; perhaps he can weigh in here.
 >