unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#21054: 25.0.50; Can't edit SES documents: Not at cell
@ 2015-07-14 10:39 Óscar Fuentes
       [not found] ` <handler.21054.B.14368703993315.ack@debbugs.gnu.org>
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Óscar Fuentes @ 2015-07-14 10:39 UTC (permalink / raw)
  To: 21054


emacs -Q

Visit $EMACS_SRC/etc/ses-example.ses

On some cell, type RETURN to edit its contents.

The minibuffer says: Not at cell.

So it is impossible to edit existing SES documents. Editing just-created
documents works.



In GNU Emacs 25.0.50.1 (x86_64-unknown-linux-gnu, X toolkit)
 of 2015-07-08 on qcore
Repository revision: 7da7a9774cbb4d8991bd002c1c31bf49b27fb521
Windowing system distributor `The X.Org Foundation', version 11.0.11701000
System Description:	Ubuntu 15.04

Configured using:
 `configure --without-toolkit-scroll-bars --with-x-toolkit=lucid'

Configured features:
XAW3D XPM JPEG TIFF GIF PNG SOUND GSETTINGS NOTIFY LIBXML2 FREETYPE XFT
ZLIB LUCID X11

Important settings:
  value of $LANG: es_ES.UTF-8
  locale-coding-system: utf-8-unix





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#21054: Acknowledgement (25.0.50; Can't edit SES documents: Not at cell)
       [not found] ` <handler.21054.B.14368703993315.ack@debbugs.gnu.org>
@ 2015-07-14 23:10   ` Óscar Fuentes
  2015-08-23 13:54     ` bug#21054: 25.0.50; Can't edit SES documents: Not at cell Óscar Fuentes
  0 siblings, 1 reply; 15+ messages in thread
From: Óscar Fuentes @ 2015-07-14 23:10 UTC (permalink / raw)
  To: 21054

Bisecting gives this as the culprit:

commit 84e0b7dad6f1a8e53261f9b96f5a9080fea681a4
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Date:   Mon Apr 13 15:51:15 2015 -0400





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#21054: 25.0.50; Can't edit SES documents: Not at cell
  2015-07-14 23:10   ` bug#21054: Acknowledgement (25.0.50; Can't edit SES documents: Not at cell) Óscar Fuentes
@ 2015-08-23 13:54     ` Óscar Fuentes
  2015-08-23 22:37       ` Stefan Monnier
  0 siblings, 1 reply; 15+ messages in thread
From: Óscar Fuentes @ 2015-08-23 13:54 UTC (permalink / raw)
  To: 21054, Stefan Monnier

Óscar Fuentes <ofv@wanadoo.es> writes:

> Bisecting gives this as the culprit:
>
> commit 84e0b7dad6f1a8e53261f9b96f5a9080fea681a4
> Author: Stefan Monnier <monnier@iro.umontreal.ca>
> Date:   Mon Apr 13 15:51:15 2015 -0400

Stefan:

Is it ok to revert the SES-related changes on this revision? SES is
unusable for 4 months now.





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#21054: 25.0.50; Can't edit SES documents: Not at cell
  2015-08-23 13:54     ` bug#21054: 25.0.50; Can't edit SES documents: Not at cell Óscar Fuentes
@ 2015-08-23 22:37       ` Stefan Monnier
  0 siblings, 0 replies; 15+ messages in thread
From: Stefan Monnier @ 2015-08-23 22:37 UTC (permalink / raw)
  To: Óscar Fuentes; +Cc: 21054

>> Bisecting gives this as the culprit:
>> commit 84e0b7dad6f1a8e53261f9b96f5a9080fea681a4
>> Author: Stefan Monnier <monnier@iro.umontreal.ca>
>> Date:   Mon Apr 13 15:51:15 2015 -0400

> Stefan:

> Is it ok to revert the SES-related changes on this revision?

No, we should fix the actual problem,

> SES is unusable for 4 months now.

Yes, this sucks, I'm sorry,


        Stefan





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#21054: Fixed
  2015-07-14 10:39 bug#21054: 25.0.50; Can't edit SES documents: Not at cell Óscar Fuentes
       [not found] ` <handler.21054.B.14368703993315.ack@debbugs.gnu.org>
@ 2015-11-18  2:23 ` Óscar Fuentes
  2015-11-18  4:00 ` bug#21054: Reopen Óscar Fuentes
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 15+ messages in thread
From: Óscar Fuentes @ 2015-11-18  2:23 UTC (permalink / raw)
  To: 21054-done

This was fixed by some undetermined change.





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#21054: Reopen
  2015-07-14 10:39 bug#21054: 25.0.50; Can't edit SES documents: Not at cell Óscar Fuentes
       [not found] ` <handler.21054.B.14368703993315.ack@debbugs.gnu.org>
  2015-11-18  2:23 ` bug#21054: Fixed Óscar Fuentes
@ 2015-11-18  4:00 ` Óscar Fuentes
  2015-11-18 17:27   ` Eli Zaretskii
  2016-01-01  5:42 ` bug#21054: 25.0.50; Can't edit SES documents: Not at cell Óscar Fuentes
  2016-01-02 16:07 ` Vincent Belaïche
  4 siblings, 1 reply; 15+ messages in thread
From: Óscar Fuentes @ 2015-11-18  4:00 UTC (permalink / raw)
  To: 21054

reopen

After a proper build (full rebuild from a pristine checkout; something
is wrong with the Emacs build system) the problem is still there.





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#21054: Reopen
  2015-11-18  4:00 ` bug#21054: Reopen Óscar Fuentes
@ 2015-11-18 17:27   ` Eli Zaretskii
  2015-11-18 19:03     ` bug#21054: 25.0.50; Can't edit SES documents: Not at cell Óscar Fuentes
  2015-11-19 17:11     ` bug#21054: Reopen Stephen Leake
  0 siblings, 2 replies; 15+ messages in thread
From: Eli Zaretskii @ 2015-11-18 17:27 UTC (permalink / raw)
  To: Óscar Fuentes; +Cc: 21054

> From: Óscar Fuentes <ofv@wanadoo.es>
> Date: Wed, 18 Nov 2015 05:00:15 +0100
> 
> After a proper build (full rebuild from a pristine checkout; something
> is wrong with the Emacs build system) the problem is still there.

The changeset you identified as the one to blame is huge, even if we
look only at changes in ses.el.  Would it be possible for you to try
to locate the code that specifically caused this misbehavior?  Or
maybe you already know that?

Armed with that knowledge, we could see how to fix this annoying
problem, which IMO should block Emacs 25.1 release, unless we fix it
soon.

Thanks.





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#21054: 25.0.50; Can't edit SES documents: Not at cell
  2015-11-18 17:27   ` Eli Zaretskii
@ 2015-11-18 19:03     ` Óscar Fuentes
  2015-11-18 19:46       ` Óscar Fuentes
  2015-11-19 17:11     ` bug#21054: Reopen Stephen Leake
  1 sibling, 1 reply; 15+ messages in thread
From: Óscar Fuentes @ 2015-11-18 19:03 UTC (permalink / raw)
  To: 21054

Eli Zaretskii <eliz@gnu.org> writes:

> The changeset you identified as the one to blame is huge, even if we
> look only at changes in ses.el.  Would it be possible for you to try
> to locate the code that specifically caused this misbehavior?

I tried for a bit and located the specific call chain that throws the
error, but not why it is thrown.

> Or maybe you already know that?
>
> Armed with that knowledge, we could see how to fix this annoying
> problem, which IMO should block Emacs 25.1 release, unless we fix it
> soon.

This bug renders ses.el unusable, so it is a release blocker indeed. The
right approach would be to revert the omnibus change that introduced the
problem as soon as it was reported, but that was rejected by Stephan and
now possibly other changes rely on the parts covered by the problematic
one.

Anyways, I have the intention of delving into this issue as soon as
possible (before the year's end) and it is very likely that I find a
"fix", but I have no enough knowledge about ses.el to guarantee its
soundness, so if anyone has a proper understanding of what's going on,
please go ahead and fix it. (The fact that Stephan didn't fix the bug
himself is an indication that it is far from being a trivial one.)





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#21054: 25.0.50; Can't edit SES documents: Not at cell
  2015-11-18 19:03     ` bug#21054: 25.0.50; Can't edit SES documents: Not at cell Óscar Fuentes
@ 2015-11-18 19:46       ` Óscar Fuentes
  0 siblings, 0 replies; 15+ messages in thread
From: Óscar Fuentes @ 2015-11-18 19:46 UTC (permalink / raw)
  To: 21054

Óscar Fuentes <ofv@wanadoo.es> 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.





^ permalink raw reply related	[flat|nested] 15+ messages in thread

* bug#21054: Reopen
  2015-11-18 17:27   ` Eli Zaretskii
  2015-11-18 19:03     ` bug#21054: 25.0.50; Can't edit SES documents: Not at cell Óscar Fuentes
@ 2015-11-19 17:11     ` Stephen Leake
  2015-11-19 17:17       ` Stephen Leake
  1 sibling, 1 reply; 15+ messages in thread
From: Stephen Leake @ 2015-11-19 17:11 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Óscar Fuentes, 21054

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Óscar Fuentes <ofv@wanadoo.es>
>> Date: Wed, 18 Nov 2015 05:00:15 +0100
>> 
>> After a proper build (full rebuild from a pristine checkout; something
>> is wrong with the Emacs build system) the problem is still there.
>
> The changeset you identified as the one to blame is huge, even if we
> look only at changes in ses.el.

That change introduced the function `ses--curcell'. It appears that the
variable `ses--curcell' is supposed to be the cached value of the
function `ses--curcell', but that is failing in this case.

`ses--curcell-overlay' is another variable that must be set for the
current cell; it adds the underline of the current cell. I noticed that
the underline is correct in this use case, so I looked for places where
`ses--curcell-overlay' is set but `ses--curcell' is not. I only found
one, in `ses-setup'. This patch fixes the problem for me:

diff --git a/lisp/ses.el b/lisp/ses.el
index ec1359b..03aca0a 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)
   ;; Create the underlining overlay.  It's impossible for (point) to be 2,
   ;; because column A must be at least 1 column wide.
   (setq ses--curcell-overlay (make-overlay (1+ (point-min)) (1+ (point-min))))

-- 
-- Stephe





^ permalink raw reply related	[flat|nested] 15+ messages in thread

* bug#21054: Reopen
  2015-11-19 17:11     ` bug#21054: Reopen Stephen Leake
@ 2015-11-19 17:17       ` Stephen Leake
  2015-11-19 17:37         ` Stephen Leake
  0 siblings, 1 reply; 15+ messages in thread
From: Stephen Leake @ 2015-11-19 17:17 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Óscar Fuentes, 21054

Stephen Leake <stephen_leake@stephe-leake.org> writes:

> Eli Zaretskii <eliz@gnu.org> writes:
>
>>> From: Óscar Fuentes <ofv@wanadoo.es>
>>> Date: Wed, 18 Nov 2015 05:00:15 +0100
>>> 
>>> After a proper build (full rebuild from a pristine checkout; something
>>> is wrong with the Emacs build system) the problem is still there.
>>
>> The changeset you identified as the one to blame is huge, even if we
>> look only at changes in ses.el.
>
> That change introduced the function `ses--curcell'. It appears that the
> variable `ses--curcell' is supposed to be the cached value of the
> function `ses--curcell', but that is failing in this case.
>
> `ses--curcell-overlay' is another variable that must be set for the
> current cell; it adds the underline of the current cell. I noticed that
> the underline is correct in this use case, so I looked for places where
> `ses--curcell-overlay' is set but `ses--curcell' is not. I only found
> one, in `ses-setup'. This patch fixes the problem for me:
>
> diff --git a/lisp/ses.el b/lisp/ses.el
> index ec1359b..03aca0a 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)
>    ;; Create the underlining overlay.  It's impossible for (point) to be 2,
>    ;; because column A must be at least 1 column wide.
>    (setq ses--curcell-overlay (make-overlay (1+ (point-min)) (1+ (point-min))))

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.

-- 
-- Stephe





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#21054: Reopen
  2015-11-19 17:17       ` Stephen Leake
@ 2015-11-19 17:37         ` Stephen Leake
  2015-11-20 12:55           ` Óscar Fuentes
  0 siblings, 1 reply; 15+ messages in thread
From: Stephen Leake @ 2015-11-19 17:37 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Óscar Fuentes, 21054

Stephen Leake <stephen_leake@stephe-leake.org> writes:

> Stephen Leake <stephen_leake@stephe-leake.org> 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:

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))
   ;; Create the underlining overlay.  It's impossible for (point) to be 2,
   ;; because column A must be at least 1 column wide.
   (setq ses--curcell-overlay (make-overlay (1+ (point-min)) (1+ (point-min))))
@@ -2063,7 +2065,11 @@ narrows the buffer now."
 	  ;; read the local variables at the end of the file.  Now it's safe to
 	  ;; do the narrowing.
 	  (narrow-to-region (point-min) ses--data-marker)
-	  (setq ses--deferred-narrow nil)))
+	  (setq ses--deferred-narrow nil))
+
+        ;; Update the current cell
+        (ses-set-curcell))
+
     ;; Prevent errors in this post-command-hook from silently erasing the hook!
     (error
      (unless executing-kbd-macro

-- 
-- Stephe





^ permalink raw reply related	[flat|nested] 15+ messages in thread

* bug#21054: Reopen
  2015-11-19 17:37         ` Stephen Leake
@ 2015-11-20 12:55           ` Óscar Fuentes
  0 siblings, 0 replies; 15+ messages in thread
From: Óscar Fuentes @ 2015-11-20 12:55 UTC (permalink / raw)
  To: 21054; +Cc: Stephen Leake

Stephen Leake <stephen_leake@stephe-leake.org> writes:

> Stephen Leake <stephen_leake@stephe-leake.org> writes:
>
>> Stephen Leake <stephen_leake@stephe-leake.org> 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.





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#21054: 25.0.50; Can't edit SES documents: Not at cell
  2015-07-14 10:39 bug#21054: 25.0.50; Can't edit SES documents: Not at cell Óscar Fuentes
                   ` (2 preceding siblings ...)
  2015-11-18  4:00 ` bug#21054: Reopen Óscar Fuentes
@ 2016-01-01  5:42 ` Óscar Fuentes
  2016-01-02 16:07 ` Vincent Belaïche
  4 siblings, 0 replies; 15+ messages in thread
From: Óscar Fuentes @ 2016-01-01  5:42 UTC (permalink / raw)
  To: 21054-done; +Cc: Vincent Belaïche

Fixed on emacs-25 branch by commit
b1a8509030a8656a6fd3e8bb64ae38d85cd889ee and on master by
e8702794d46ae032803bf54ffbd71ebde215179c, both by Vincent Belaïche.

Those changes are functionally the same but text-wise are not equal.

The fix on emacs-25 seems definitive while the change on master is
labeled as a "quick temporary hack", so the text on master shall be
changed to match the text on emacs-25, otherwise a conflict will arise
on the next merge.





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#21054: 25.0.50; Can't edit SES documents: Not at cell
  2015-07-14 10:39 bug#21054: 25.0.50; Can't edit SES documents: Not at cell Óscar Fuentes
                   ` (3 preceding siblings ...)
  2016-01-01  5:42 ` bug#21054: 25.0.50; Can't edit SES documents: Not at cell Óscar Fuentes
@ 2016-01-02 16:07 ` Vincent Belaïche
  4 siblings, 0 replies; 15+ messages in thread
From: Vincent Belaïche @ 2016-01-02 16:07 UTC (permalink / raw)
  To: Óscar Fuentes; +Cc: 21054-done

I just did the change to master branch, as asked for by Óscar.

  Vincent.





^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2016-01-02 16:07 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-14 10:39 bug#21054: 25.0.50; Can't edit SES documents: Not at cell Óscar Fuentes
     [not found] ` <handler.21054.B.14368703993315.ack@debbugs.gnu.org>
2015-07-14 23:10   ` bug#21054: Acknowledgement (25.0.50; Can't edit SES documents: Not at cell) Óscar Fuentes
2015-08-23 13:54     ` bug#21054: 25.0.50; Can't edit SES documents: Not at cell Óscar Fuentes
2015-08-23 22:37       ` Stefan Monnier
2015-11-18  2:23 ` bug#21054: Fixed Óscar Fuentes
2015-11-18  4:00 ` bug#21054: Reopen Óscar Fuentes
2015-11-18 17:27   ` Eli Zaretskii
2015-11-18 19:03     ` bug#21054: 25.0.50; Can't edit SES documents: Not at cell Óscar Fuentes
2015-11-18 19:46       ` Óscar Fuentes
2015-11-19 17:11     ` bug#21054: Reopen Stephen Leake
2015-11-19 17:17       ` Stephen Leake
2015-11-19 17:37         ` Stephen Leake
2015-11-20 12:55           ` Óscar Fuentes
2016-01-01  5:42 ` bug#21054: 25.0.50; Can't edit SES documents: Not at cell Óscar Fuentes
2016-01-02 16:07 ` Vincent Belaïche

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).