Subject: Re: bug#21054: Reopen

From: Óscar Fuentes <[email-masked]>
Date: Fri, 20 Nov 2015 13:55:11 +0100

Stephen Leake <[email-masked]> writes:

> Stephen Leake <[email-masked]> writes:
>
>> Stephen Leake <[email-masked]> writes:
>
>> I spoke too soon; this allows hitting <return> on cell A1. But hitting
>> <return> on cell C8 shows the contents of A1. So I missed something.
>
> Found it; the change deleted (ses-set-curcell) from ses-command-hook, I
> assume because it was in a section labeled "update mode line". But it
> also updates ses--curcell, so I put it back, and things seem to work:

This is an interesting insight, thanks.

> diff --git a/lisp/ses.el b/lisp/ses.el
> index ec1359b..564d2a5 100644
> --- a/lisp/ses.el
> +++ b/lisp/ses.el
> @@ -1905,6 +1905,8 @@ Narrows the buffer to show only the print area.  Gives it `read-only' and
>                            (forward-char)
>                            (point))))
>              (put-text-property pos end 'cursor-intangible sym))))))
> +  (goto-char (point-min))
> +  (ses-set-curcell))

There is an extra paren here.

Besides, SES is still broken. Try

emacs -Q etc/ses-example.ses

put the cursor on A13, for instance, then press the right cursor arrow
to move the cursor to B13 and press ENTER. The prompt starts editing the
contents of A13. Interestingly, if you cancel the minibuffer prompt with
C-g and press ENTER again, B13 is edited.

Apart from that, cursor movement is erratic: try to move the cursor to
the line after the last row of the spreadsheet, note how it is not
possible and it goes to one line below. Now press the up cursor arrow
and see how the cursor goes to the rightmost cell of the last row. This
problem may be unrelated to the bug you tried to fix. For all that I
know, it might be present before the change that caused this bug report,
I need to check.