emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Alan Schmitt <alan.schmitt@polytechnique.org>
To: Org Mode Mailing List <emacs-orgmode@gnu.org>
Subject: Error when recomputing the line of a table
Date: Tue, 17 Sep 2013 09:34:01 +0200	[thread overview]
Message-ID: <m261tznbpy.fsf@polytechnique.org> (raw)

Hello,

I have a problem when recomputing the last line of a table. If I hit
"C-c *", I get the following (in the debugger):

--8<---------------cut here---------------start------------->8---
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  string-match("^ *" nil)
  org-table-align()
  org-table-recalculate(nil)
  call-interactively(org-table-recalculate)
  org-ctrl-c-star()
  call-interactively(org-ctrl-c-star nil nil)
--8<---------------cut here---------------end--------------->8---

What is really strange is that if I copy the file to another location on
the disk and try to recompute the line, I don't get this error, so it's
quite difficult to provide a minimal example with the problem.

I looked at a little at the code, and the problem comes from here:

--8<---------------cut here---------------start------------->8---
    ;; Get the rows
    (setq lines (org-split-string
		 (buffer-substring beg end) "\n"))
    ;; Store the indentation of the first line
    (if (string-match "^ *" (car lines))
--8<---------------cut here---------------end--------------->8---

for some reason `lines' is nil, which causes the problem. The table is
far from empty (it has more than 500 lines).

I tried to get a little more information from the backtrace evaluating
expressions, and it seems that `beg' is bound to 42, and `end' to
"#<marker at 42 in suivi PW-runx.org>"

One strange thing is that position 42 is not in the table at all, it's
in a code block right before it (42 is right before the reset). This is
what the beginning of my file looks like:

--8<---------------cut here---------------start------------->8---
#+begin_src gnuplot :var data=data-table
reset

set title "PW"
set size ratio square

set xlabel "Date"
set xdata time
set timefmt "%Y-%m-%d"
set format x "%Y-%m"
set xtics nomirror

plot data using 1:4 with lines axis x1y1 title 'Week',
     data using 1:5 with lines axis x1y1 title 'Month'
#+end_src

#+tblname: data-table
| Date             |   Q |  Cumul | 7 days | 30 days | Global |
|------------------+-----+--------+--------+---------+--------|
| [2012-03-19 Mon] |   0 |      0 |     NA |      NA |   0.00 |
| [2012-03-20 Tue] |   4 |      4 |     NA |      NA |   2.00 |
| [2012-03-21 Wed] |   8 |     12 |     NA |      NA |   4.00 |
| [2012-03-22 Thu] |   7 |     19 |     NA |      NA |   4.75 |
...
--8<---------------cut here---------------end--------------->8---

I'd gladly provide more information, but I don't really know how to do
it. (Of course, if I debug "org-table-begin", everything works as
expected.)

Any suggestion as how to try to track this down?

Thanks,

Alan

                 reply	other threads:[~2013-09-17  7:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m261tznbpy.fsf@polytechnique.org \
    --to=alan.schmitt@polytechnique.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).