* Why does a column's name need to start with a letter? Changed source with no perceivable side-effects
@ 2011-03-05 3:35 Frozenlock
2011-03-05 7:41 ` Carsten Dominik
0 siblings, 1 reply; 3+ messages in thread
From: Frozenlock @ 2011-03-05 3:35 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 1016 bytes --]
Greetings,
First and foremost, I must say I'm a new Org-mode user... as well as a new
emacs user... and have only limited experience with lisp.
I'm using a table in org-mode as a database, from which I retrieve
information as needed from other tables.
This database stores multiples components with names starting by numbers and
with the character "-" in them. For example: "10K-AN-D8".
I want to be able to refer to its column with $10K-AN-D8. Yet, this is
impossible at the moment.
I've looked in org-table.el and found, at line 2038:
(if (string-match "^[a-zA-Z][a-zA-Z0-9]*$" name)
which, once replaced by this:
(if (string-match "^[-_a-zA-Z0-9]*$" name)
Provides me with the ability to name (and refer) columns in any way I want.
However, I'm reluctant to use this feature; surely there was a reason for
this limitation.
Could someone point it out for me?
If there's no reason not to name columns as we want, perhaps it could be
modified in future versions?
Thank you very much in advance!
Christian
[-- Attachment #2: Type: text/html, Size: 1397 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Why does a column's name need to start with a letter? Changed source with no perceivable side-effects
2011-03-05 3:35 Why does a column's name need to start with a letter? Changed source with no perceivable side-effects Frozenlock
@ 2011-03-05 7:41 ` Carsten Dominik
2011-03-05 17:01 ` Re: [O] Why does a column's name need to start with a letter? Changed source with no perceivable frozenlock
0 siblings, 1 reply; 3+ messages in thread
From: Carsten Dominik @ 2011-03-05 7:41 UTC (permalink / raw)
To: Frozenlock; +Cc: emacs-orgmode
Hi Christian,
On 5.3.2011, at 04:35, Frozenlock wrote:
> Greetings,
>
> First and foremost, I must say I'm a new Org-mode user... as well as a new emacs user... and have only limited experience with lisp.
>
> I'm using a table in org-mode as a database, from which I retrieve information as needed from other tables.
> This database stores multiples components with names starting by numbers and with the character "-" in them. For example: "10K-AN-D8".
> I want to be able to refer to its column with $10K-AN-D8. Yet, this is impossible at the moment.
>
> I've looked in org-table.el and found, at line 2038:
>
> (if (string-match "^[a-zA-Z][a-zA-Z0-9]*$" name)
>
> which, once replaced by this:
>
> (if (string-match "^[-_a-zA-Z0-9]*$" name)
>
> Provides me with the ability to name (and refer) columns in any way I want.
>
> However, I'm reluctant to use this feature; surely there was a reason for this limitation.
> Could someone point it out for me?
This is limitation is present to disambiguate formulas.
In you example $10K-AN-D8, D8 is already a field reference,
so Org does not know if you mean $10K-AN - @8$4.
Furthermore, you could easily arrive at variables like
$10-AN-D8, and then what should the $10 mean?
Of cause one could disambiguate heuristically by checking
which names have been defined. In fact, name replacement
happens first, and this is why your patch appears to
work. But the side effect would be that introducing
new names could change the interpretation of an
existing equation. All this is unstable and
unpredictable.
Hope this makes it clear.
- Carsten
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Re: [O] Why does a column's name need to start with a letter? Changed source with no perceivable
2011-03-05 7:41 ` Carsten Dominik
@ 2011-03-05 17:01 ` frozenlock
0 siblings, 0 replies; 3+ messages in thread
From: frozenlock @ 2011-03-05 17:01 UTC (permalink / raw)
To: Carsten Dominik, Frozenlock; +Cc: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 2209 bytes --]
Yes, it's very well explained, thank you.
I'll try to encode my names by removing any "-" and by adding a dummy
letter at the beginning.
Is there another way of doing simple database in org-mode? By putting a
component's name in a cell, I would like if the other columns could fill
them-self with the component's characteristics.
(My apologies for the double e-mail, the first one wasn't sent to the
mailing list)
On , Carsten Dominik <carsten.dominik@gmail.com> wrote:
> Hi Christian,
> On 5.3.2011, at 04:35, Frozenlock wrote:
> > Greetings,
> >
> > First and foremost, I must say I'ma new Org-mode user... as well as a
> new emacs user... and have only limited experience with lisp.
> >
> > I'm using a table in org-mode as a database, from which I retrieve
> information as needed from other tables.
> > This database stores multiples components with names starting by
> numbers and with the character "-" in them. For example: "10K-AN-D8".
> > I want to be able to refer to its column with $10K-AN-D8. Yet, this is
> impossible at the moment.
> >
> > I've looked in org-table.el and found, at line 2038:
> >
> > (if (string-match "^[a-zA-Z][a-zA-Z0-9]*$" name)
> >
> > which, once replaced by this:
> >
> > (if (string-match "^[-_a-zA-Z0-9]*$" name)
> >
> > Provides me with the ability to name (and refer) columns in any way I
> want.
> >
> > However, I'm reluctant to use this feature; surely there was a reason
> for this limitation.
> > Could someone point it out for me?
> This is limitation is present to disambiguate formulas.
> In you example $10K-AN-D8, D8 is already a field reference,
> so Org does not know if you mean $10K-AN - @8$4.
> Furthermore, you could easily arrive at variables like
> $10-AN-D8, and then what should the $10 mean?
> Of cause one could disambiguate heuristically by checking
> which names have been defined. In fact, name replacement
> happens first, and this is why your patch appears to
> work. But the side effect would be that introducing
> new names could change the interpretation of an
> existing equation. All this is unstable and
> unpredictable.
> Hope this makes it clear.
> - Carsten
[-- Attachment #2: Type: text/html, Size: 3132 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-03-05 17:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-05 3:35 Why does a column's name need to start with a letter? Changed source with no perceivable side-effects Frozenlock
2011-03-05 7:41 ` Carsten Dominik
2011-03-05 17:01 ` Re: [O] Why does a column's name need to start with a letter? Changed source with no perceivable frozenlock
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).