emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* can't assign to hline relative reference:
@ 2015-06-26 12:12 Marijn Schouten (hkBst)
  2015-06-26 12:22 ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Marijn Schouten (hkBst) @ 2015-06-26 12:12 UTC (permalink / raw)
  To: emacs-orgmode

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dear list,

Consider the following small org table:

|       | grade | weight | weighed grade |
|-------+-------+--------+---------------|
|       |     5 |     10 |            50 |
|-------+-------+--------+---------------|
| total |       |        |             0 |
#+TBLFM: @II$2=vsum(@I$2..@II-1$2)::$4=$2*$3

In the version of org (8.2.10) distributed with emacs 24.5, evaluating this table does not produces the expected result of column 2 being summed to a total of 5. Instead depending on point both the second and first columns will get an additional 5.

Through irc I found someone who tested this with the latest development version as of now and it instead produces the error: can't assign to hline relative reference. That also does not seem like the right behavior to me.

Could someone shed some light on the situation?

Marijn 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iEYEARECAAYFAlWNQasACgkQp/VmCx0OL2yYagCgwLUWq7sP/GhJAfkwajCAvHRP
u+kAmwcV1GjT0Lbyo0Mrj6F87q+e/uib
=wIrP
-----END PGP SIGNATURE-----

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

* Re: can't assign to hline relative reference:
  2015-06-26 12:12 can't assign to hline relative reference: Marijn Schouten (hkBst)
@ 2015-06-26 12:22 ` Nicolas Goaziou
  2015-06-26 13:00   ` Marijn Schouten (hkBst)
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Goaziou @ 2015-06-26 12:22 UTC (permalink / raw)
  To: Marijn Schouten (hkBst); +Cc: emacs-orgmode

Hello,

"Marijn Schouten (hkBst)" <hkbst@gentoo.org> writes:

> Through irc I found someone who tested this with the latest
> development version as of now and it instead produces the error: can't
> assign to hline relative reference. That also does not seem like the
> right behavior to me.
>
> Could someone shed some light on the situation?

See <http://article.gmane.org/gmane.emacs.orgmode/77257>.

Regards,

-- 
Nicolas Goaziou

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

* Re: can't assign to hline relative reference:
  2015-06-26 12:22 ` Nicolas Goaziou
@ 2015-06-26 13:00   ` Marijn Schouten (hkBst)
  2015-07-02 11:56     ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Marijn Schouten (hkBst) @ 2015-06-26 13:00 UTC (permalink / raw)
  To: emacs-orgmode

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 26-06-15 14:22, Nicolas Goaziou wrote:
> Hello,
> 
> "Marijn Schouten (hkBst)" <hkbst@gentoo.org> writes:
> 
>> Through irc I found someone who tested this with the latest
>> development version as of now and it instead produces the error: can't
>> assign to hline relative reference. That also does not seem like the
>> right behavior to me.
>>
>> Could someone shed some light on the situation?
> 
> See <http://article.gmane.org/gmane.emacs.orgmode/77257>.
> 
> Regards,

Thanks Nicolas for that link.

It says that there is a known issue with hline references on the left side of table formulas, but I did not quite understand the details.

There seems to be a proposed fix by interpreting said references as ranges with the same on both sides, for example @II$2 would become @II$2..@II$2 and would then be interpreted properly. Was the issue with this fix that it does not work in all cases?

There also seems to be some counterintuitive use of these references that is useful to some people and included in the tests and fixing the issue would interfere with that use. If I said that right, could someone explain the details of this?

There was a mention that fixing the issue might involve rewriting much of org-table. Is that a concern?

Marijn
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iEYEARECAAYFAlWNTMoACgkQp/VmCx0OL2yt1ACZAcFxBtcRwhZ6IPPA02xZtrSk
9xEAn3aY1JKYJkoy1bzhOV4mFbc8UDz7
=0uQ0
-----END PGP SIGNATURE-----

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

* Re: can't assign to hline relative reference:
  2015-06-26 13:00   ` Marijn Schouten (hkBst)
@ 2015-07-02 11:56     ` Nicolas Goaziou
  0 siblings, 0 replies; 4+ messages in thread
From: Nicolas Goaziou @ 2015-07-02 11:56 UTC (permalink / raw)
  To: Marijn Schouten (hkBst); +Cc: emacs-orgmode

"Marijn Schouten (hkBst)" <hkbst@gentoo.org> writes:

> It says that there is a known issue with hline references on the left
> side of table formulas, but I did not quite understand the details.

To tell the truth, this is not crystal clear to me either.

> There seems to be a proposed fix by interpreting said references as
> ranges with the same on both sides, for example @II$2 would become
> @II$2..@II$2 and would then be interpreted properly. Was the issue
> with this fix that it does not work in all cases?

A solution properly handling all cases of @I and al. on lhs is welcome.
Meanwhile, I'd rather use a consistent error than provide something that
just partly works.

> There was a mention that fixing the issue might involve rewriting much
> of org-table. Is that a concern?

Not really, as long as invasive changes are covered by tests.

Regards,

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

end of thread, other threads:[~2015-07-02 11:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-26 12:12 can't assign to hline relative reference: Marijn Schouten (hkBst)
2015-06-26 12:22 ` Nicolas Goaziou
2015-06-26 13:00   ` Marijn Schouten (hkBst)
2015-07-02 11:56     ` Nicolas Goaziou

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