Subject: bug#21054: 25.0.50; Can't edit SES documents: Not at cell

From: Óscar Fuentes <[email-masked]>
Date: Wed, 18 Nov 2015 20:46:58 +0100

Óscar Fuentes <[email-masked]> writes:

> ... Stephan ...

Stefan, sorry.

For the record, the problem starts on ses-edit-cell calling
ses-check-curcell, which throws the "Not at cell" error. It seems that
ses--curcell is always nil at that call path. So this is a "fix" that
ensures that ses--curcell has a value that correponds to the actual
position of the cursor:

diff --git a/lisp/ses.el b/lisp/ses.el
index ec1359b..1631af0 100644
--- a/lisp/ses.el
+++ b/lisp/ses.el
@@ -2355,6 +2355,7 @@ ses-edit-cell
   (interactive
    (progn
      (barf-if-buffer-read-only)
+     (ses-set-curcell)
      (ses-check-curcell)
      (let* ((rowcol  (ses-sym-rowcol ses--curcell))
 	    (row     (car rowcol))

As mentioned on my previous message, I have no idea about the
correctness of this change. Moreover, some quick checks with other
functions that call ses-check-curcell show that quite a few operations
are broken too. Since the set of SES features that I use is very small,
at this point I don't know how many of those bugs are regressions and,
specifically, how many of them were introduced by the same change that
caused this bug report. Comparing with an older Emacs version will
clarify those doubts, but right now I'm under the impression that ses.el
is badly broken.