emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: Rens Oliemans <hallo@rensoliemans.nl>
Cc: "Fraga, Eric" <e.fraga@ucl.ac.uk>,
	Emacs Org mode mailing list <emacs-orgmode@gnu.org>
Subject: Re: strange behaviour with $PROP_r1 value in a table
Date: Sat, 07 Sep 2024 10:46:32 +0000	[thread overview]
Message-ID: <87ikv7eo6v.fsf@localhost> (raw)
In-Reply-To: <877cbpce74.fsf@rensoliemans.nl>

Rens Oliemans <hallo@rensoliemans.nl> writes:

> Confirmed, this is indeed strange behaviour, I think a bug.
> ...
> It seems like a mistake to convert such a cell reference in the '$PROP_x' case. The
> conversion is done by 'org-table-convert-refs-to-rc', which is done before
> 'org-table-formula-substitute-names' is called. Simply changing the order will not work,
> since the property value might also be a letter/number-like reference.

I just tried

#+property: r1 0.96

| value | 0.96 |
#+TBLFM: @1$2=$PROP_r1

followed by C-c C-c on TBLFM line, and I cannot reproduce.

I _can_ reproduce via C-c = -> `org-table-formula-from-user'/`org-table-formula-to-user'
where is it a result of the default value of `org-table-use-standard-references'

> -    (while (string-match "\\<\\([a-zA-Z]+\\)\\([0-9]+\\>\\|&\\)\\|\\(;[^\r\n:]+\\|\\<remote([^,)]*)\\)" s start)
> +    (while (string-match "\\(\\$PROP_\\)\\{0\\}\\<\\([a-zA-Z]+\\)\\([0-9]+\\>\\|&\\)\\|\\(;[^\r\n:]+\\|\\<remote([^,)]*)\\)" s start)

This is doing much more than fixing the reported bug and might affect
valid uses. I'd rather fix the bug (if it is a bug) explicitly, without
risking breaking other things.

> I have two questions about it:
>
> - The function '$PROP_<remote' still gives '#ERROR', is this related to this bug, or is
>   the property name '<remote' invalid in any way and is this intended?
>
> - Should I add tests for this behaviour?

Before discussing any further, may you please check if 

#+property: r1 0.96

| value | 0.96 |
#+TBLFM: @1$2=$PROP_r1

works on your side?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


  parent reply	other threads:[~2024-09-07 10:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-05 10:27 strange behaviour with $PROP_r1 value in a table Fraga, Eric
2024-09-06  9:40 ` Rens Oliemans
2024-09-06 10:12   ` Fraga, Eric
2024-09-07 10:46   ` Ihor Radchenko [this message]
2024-09-09 10:13     ` Rens Oliemans
2024-09-10 19:07       ` Ihor Radchenko

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=87ikv7eo6v.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=e.fraga@ucl.ac.uk \
    --cc=emacs-orgmode@gnu.org \
    --cc=hallo@rensoliemans.nl \
    /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).