From: William Henney <whenney@gmail.com>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Cc: Arun Persaud <apersaud@lbl.gov>
Subject: BUG in reference by ID to remote table (was Re: org babel question: reference tables in remote file)
Date: Sun, 27 Apr 2014 23:24:12 -0500 [thread overview]
Message-ID: <CAKchnZPYtfgF2ra4-6DwTpZ_6PpyQXmGE8H0RjaT+nLOTi5QBw@mail.gmail.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 1298 bytes --]
There is an apparent bug when using the ID property to refer to cells in
remote tables, which is currently the only way to refer to a table in an
external file.
This is illustrated in the attached org file. In brief, the bug is
triggered by any ID that contains a sequence matching the regexp
"-[A-Z]+[0-9]+-", which org wants to interpret as a spreadsheet-style cell
reference.
Also, it would be more user friendly if CUSTOM_ID properties could also be
used in this way. Would that be easy to implement?
Will
On Thu, Apr 17, 2014 at 1:45 PM, Bastien <bzg@gnu.org> wrote:
> Hi Arun,
>
> Arun Persaud <apersaud@lbl.gov> writes:
>
> > thanks for the answer. It would be nice to be able to reference tables
> > in other files easily though, so some form of <path>:<tablename> would
> > be great for the remote call. Is there some special ref syntax that
> > could be used here?
>
> remote(NAME-OR-ID,REF)
>
> describes a reference to a table in a section, possibly in a different
> file, and the ID property is probably more stable than a filename, so
> I'd argue that what we have is enough.
>
> --
> Bastien
>
>
--
Dr William Henney, Centro de Radioastronomía y Astrofísica,
Universidad Nacional Autónoma de México, Campus Morelia
[-- Attachment #1.2: Type: text/html, Size: 1921 bytes --]
[-- Attachment #2: remote-ref-test.org --]
[-- Type: application/octet-stream, Size: 2544 bytes --]
#+OPTIONS: ^:{}
* Target table one
:PROPERTIES:
:CUSTOM_ID: target-table
:ID: 44C84E12-C83A-4C76-91F3-3A9C309C7DF3
:END:
#+name: target-table-1
| target1 |
* Target table two
:PROPERTIES:
:ID: A4133231-080C-4CCB-A99B-E68666862174
:END:
#+name: target-table-2
| target2 |
* Reference to a cell in a remote table via the ID property
** Case that works
#+name: table-ref-that-works
| target2 |
#+TBLFM: @1$1=remote(A4133231-080C-4CCB-A99B-E68666862174,@1$1)
+ Directly editing the TBLFM line works
+ Evaluating the formula (e.g., with “C-c *”) will correctly copy the cell from the remote table
** Case that fails
#+name: table-ref-that-fails
| :=remote(A4133231-080C-4CCB-A99B-E68666862174,@1$1) |
#+TBLFM: @1$1=remote(@4133231$1-080C-4CCB-A99B-@68666862174$5,@1$1)
+ But adding the remote reference with “C-u C-c =” fails
+ As does using the formula editor (“C-c '”)
+ As too does entering the formula in the cell directly with the “:=” method
+ The error is
#+BEGIN_EXAMPLE
org-table-get-range: Args out of range: [nil 27], 4133231
#+END_EXAMPLE
+ Note that the section of the ID “-A4133231-” is converted to “-@4133231$1-” in the TBLFM line, which is presumably the source of the bug
+ Org seems to be interpreting it as a spreadsheet-style cell reference to a cell that does not exist
+ This is reminiscent of another [[http://lists.gnu.org/archive/html/emacs-orgmode/2010-03/msg00144.html][bug that Carsten fixed for me]] several years ago
** Not all IDs have this problem
#+name: some-ids-always-work
| target1 |
#+TBLFM: @1$1=remote(44C84E12-C83A-4C76-91F3-3A9C309C7DF3,@1$1)
+ [[id:44C84E12-C83A-4C76-91F3-3A9C309C7DF3][Target table one]] does not have this problem.
+ It seems that in order to trigger the bug the ID must contain a section that both
1. Starts with a letter (or sequence of letters) rather than a digit, and
2. Does not contain any other letters, only digits
+ From very small number statistics I would say that roughly half of IDs have these properties
** The CUSTOM_ID property cannot currently be used in the reference
| :=remote(target-table,@1$1) |
#+TBLFM: @1$1=remote(target-table,@1$1)
Error message:
#+BEGIN_EXAMPLE
user-error: Can't find remote table "target-table"
#+END_EXAMPLE
* Emacs and org versions tested
#+BEGIN_SRC elisp
(emacs-version)
#+END_SRC
#+RESULTS:
: GNU Emacs 24.3.1 (x86_64-apple-darwin13.1.0, Carbon Version 1.6.0 AppKit 1265.19)
: of 2014-04-22 on iris.local
#+BEGIN_SRC elisp
(org-version)
#+END_SRC
#+RESULTS:
: 8.2.5h
next reply other threads:[~2014-04-28 4:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-28 4:24 William Henney [this message]
2014-05-30 13:44 ` BUG in reference by ID to remote table (was Re: org babel question: reference tables in remote file) Bastien
2014-05-31 9:30 ` William Henney
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAKchnZPYtfgF2ra4-6DwTpZ_6PpyQXmGE8H0RjaT+nLOTi5QBw@mail.gmail.com \
--to=whenney@gmail.com \
--cc=apersaud@lbl.gov \
--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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.