From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: [Babel] now understands org-mode lists Date: Wed, 17 Nov 2010 18:20:23 -0700 Message-ID: <8762vvh1ay.fsf@gmail.com> References: <87r5ejwlkf.fsf@gmail.com> <81tyjftqc4.fsf@gmail.com> <8162vvcv00.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=41776 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PItED-0000zb-ME for emacs-orgmode@gnu.org; Wed, 17 Nov 2010 20:23:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PItEC-0007Yu-Lu for emacs-orgmode@gnu.org; Wed, 17 Nov 2010 20:23:57 -0500 Received: from mail-gw0-f41.google.com ([74.125.83.41]:46323) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PItEC-0007Yp-GZ for emacs-orgmode@gnu.org; Wed, 17 Nov 2010 20:23:56 -0500 Received: by gwj16 with SMTP id 16so1882164gwj.0 for ; Wed, 17 Nov 2010 17:23:56 -0800 (PST) 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: Jambunathan K Cc: Org Mode Jambunathan K writes: > Jambunathan K writes: > >> "Eric Schulte" writes: >> >>> Hi, >>> >>> I've just pushed up a small commit (including minimal documentation) >>> which teaches code blocks how to read and write Org-mode lists. The >>> following example should demonstrate the new behavior. >>> >>> >>> #+results: a-list >>> - org-mode >>> - and >>> - babel >>> >>> >>> #+source: a-list >>> #+begin_src emacs-lisp :var lst=a-list :results list >>> (reverse lst) >>> #+end_src >>> >> >> Why not call the underlying type an 'orglist'. One can for example think >> of orgpropeties etc etc. >> >> Btw, for the sake of illustration, how would one convert a numbered list >> to an alphabetical list or an unordered list. Convert some thing like >> >> 1. One >> 1. OneOne >> 3. Two >> 4. Three >> >> to >> >> - One >> - One >> - Two >> - Three >> >> or >> >> 1. One >> 1.1 OneOne >> 2. Two >> 3. Three >> >> C-c C-c on a list currently renumbers the list which I find quite >> useful. May be there is a way to 'rebind' it so that it not only >> renumbers but renumbers with a different style (that the user is >> comfortable with). Think 'replace-region' for example. >> > > Let's say one wants to number the lists using prime numbers. is this possible with normal Org-mode lists? I thought that numbered lists automatically re-numbered themselves. > So one could have two lists. > > # list1 (may be generated programmatically) > > 1. 2 > 2. 3 > 3. 5 > 4. 7 > 5. 11 > 6. 13 > > > # list2 (user-typed) > 1. Carsten > 2. Bastien > 3. Eric Schulte > 4. Dan Davison > 5. Eric S Faga > 6. Samuel Wales > > and juxtapose them together to get a custom numbering as follows > > 2. Carsten > 3. Bastien > 5. Eric Schulte > 7. Dan Davison > 11. Eric S Faga > 13. Samuel Wales > This seems like a problem more suited to tables. Lists are inherently one dimensional and the problem you pose is inherently two dimensional. > > All this with a C-c C-c on list2. > > What this example does is essentially relate a 'list of styles' to a > 'list of text elements' and create a 'custom-styled list'. > I see what you're getting at, but rather than develop towards the most complex conceivable use-case I prefer to keep things simple, only introducing complexity when it seems "natural" and generally useful. I find that taking such a stingy approach to development tends to result in simpler more maintainable code. -- Eric > > Jambunathan K. > >> Jambunathan K. >> >>> >>> This is just a quick first pass at this functionality, there are still >>> some unanswered questions, such as if and how code blocks should >>> differentiate between ordered and unordered lists (ordered get an index >>> for each item?), how nested lists should be represented etc... >>> >>> Best -- Eric >>>