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: Tue, 10 Sep 2024 19:07:42 +0000	[thread overview]
Message-ID: <878qvzmio1.fsf@localhost> (raw)
In-Reply-To: <87wmjl6sou.fsf@rensoliemans.nl>

Rens Oliemans <hallo@rensoliemans.nl> writes:

>>> -    (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.
>
> Hm, looking at the manual ("(org) References"), a constant of the form '$PROP_Xyz' will be
> used to search for property 'Xyz', and it seems like a bug to convert 'Xyz' to another
> format in this case.
>
> The only use-cases that are affected with this change seem to be when a table formula
> starts with '$PROP_' and has a spreadsheet-like reference after it, no? Perhaps I am
> wrong: I searched for the usages of `org-table-convert-refs-to-rc', but perhaps I missed
> something important.

Another potential example is
#+CONSTANTS: valC2=299792458.
and then $valC2 reference.

> Do you agree that it is a bug, even with `org-table-use-standard-references' set to `t' or
> `from'?

Currently, the order of reference expansion is undefined. So, it is
_technically_ not a bug, but undefined behavior.

However, it is indeed confusing.
So, we may consider specifying the order of reference expansion.
But what should be that order? We need to think about all possible
expansions and how they might interact in edge cases (e.g. what if we
have :CrazyPropertyName@1$2:)

Also, it is confusing that the manual does not clearly explain that "B4"
expansion only happens when editing formulas interactively via formula
editor.

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


      reply	other threads:[~2024-09-10 19:06 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
2024-09-09 10:13     ` Rens Oliemans
2024-09-10 19:07       ` Ihor Radchenko [this message]

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=878qvzmio1.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).