From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Re: Can't import a remote reference to a whole column in orgtbl Date: Sun, 4 Apr 2010 22:08:18 +0200 Message-ID: <77A0A719-665A-493B-9FFA-7FC17F7EA485@gmail.com> References: <82e274891002251643k327135aajea270914244abff7@mail.gmail.com> <82e274891002251654s643e8003pdb2b3db669d5528b@mail.gmail.com> <83d3zs8hya.fsf@yahoo.it> <789851DE-3D35-4623-AB0A-E4168A5A178E@gmail.com> <4BB8E250.8090404@alumni.ethz.ch> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NyW7N-00014J-MG for emacs-orgmode@gnu.org; Sun, 04 Apr 2010 16:08:25 -0400 Received: from [140.186.70.92] (port=39696 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NyW7M-000146-Gm for emacs-orgmode@gnu.org; Sun, 04 Apr 2010 16:08:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NyW7K-0005sl-Nb for emacs-orgmode@gnu.org; Sun, 04 Apr 2010 16:08:24 -0400 Received: from mail-ew0-f214.google.com ([209.85.219.214]:33030) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NyW7K-0005sd-Iz for emacs-orgmode@gnu.org; Sun, 04 Apr 2010 16:08:22 -0400 Received: by ewy6 with SMTP id 6so288202ewy.32 for ; Sun, 04 Apr 2010 13:08:21 -0700 (PDT) In-Reply-To: <4BB8E250.8090404@alumni.ethz.ch> 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: Michael Brand Cc: Org-Mode List Applied, thanks. - Carsten On Apr 4, 2010, at 9:02 PM, Michael Brand wrote: > Carsten Dominik wrote: >>> but being able to import whole rows/columns >>> would be incredibly useful. >> There is actually now a way to do tis - even though it is >> inefficient. To copy column 2 from table FOO into column 3 of the >> current table, use >> #+TBLFM: $3=remote(FOO,@@#$2) >> This is now possible due to a patch by Michael Brand: >> http://thread.gmane.org/gmane.emacs.orgmode/22930 >> It works well, but it is inefficient because this formula will >> parse the FOO table again for each field to be copied. > > Very nice use case for `@#'. How about a doc update somehow like this? > > = > = > = > = > = > = > = > ====================================================================== > --- a/doc/org.texi > +++ b/doc/org.texi > @@ -2061,10 +2061,15 @@ see the @samp{E} mode switch below). If > For Calc formulas and Lisp formulas @code{@@#} and @code{$#} can be > used to > get the row or column number of the field where the formula result > goes. > The traditional Lisp formula equivalents are @code{org-table-current- > dline} > -and @code{org-table-current-column}. Example: > +and @code{org-table-current-column}. Examples: > > @example > -if(@@# % 2, $#, string("")) @r{column number on odd lines only} > +if(@@# % 2, $#, string("")) @r{column number on odd lines only} > +$3 = remote(FOO, @@@@#$2) @r{copy column 2 from table FOO into} > + @r{column 3 of the current > table@footnote{Both > +tables must have the same count of rows. Inefficient for a large > count N of > +rows with a time complexity of O(N^2) because all rows of the FOO > table will > +be parsed again for each field to be copied.}} > @end example > > @subsubheading Named references > = > = > = > = > = > = > = > ====================================================================== - Carsten