From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Why does a column's name need to start with a letter? Changed source with no perceivable side-effects Date: Sat, 5 Mar 2011 08:41:13 +0100 Message-ID: References: Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=53782 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pvm75-0001F6-Na for emacs-orgmode@gnu.org; Sat, 05 Mar 2011 02:41:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pvm74-0000NZ-N4 for emacs-orgmode@gnu.org; Sat, 05 Mar 2011 02:41:19 -0500 Received: from mail-ey0-f169.google.com ([209.85.215.169]:54223) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pvm74-0000NO-Fu for emacs-orgmode@gnu.org; Sat, 05 Mar 2011 02:41:18 -0500 Received: by eyh6 with SMTP id 6so953248eyh.0 for ; Fri, 04 Mar 2011 23:41:16 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Frozenlock Cc: emacs-orgmode@gnu.org Hi Christian, On 5.3.2011, at 04:35, Frozenlock wrote: > Greetings,=20 >=20 > 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.=20 >=20 > I'm using a table in org-mode as a database, from which I retrieve = information as needed from other tables.=20 > 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.=20 >=20 > I've looked in org-table.el and found, at line 2038: >=20 > (if (string-match "^[a-zA-Z][a-zA-Z0-9]*$" name) >=20 > which, once replaced by this: >=20 > (if (string-match "^[-_a-zA-Z0-9]*$" name) >=20 > Provides me with the ability to name (and refer) columns in any way I = want.=20 >=20 > 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=