From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: [BABEL][PROPOSAL] headlines as executable srcnames Date: Sun, 19 Sep 2010 22:03:11 -0600 Message-ID: <87r5gpcb9c.fsf@gmail.com> References: <87zkvtn5u7.fsf@mundaneum.com> <81wrqxv1bq.fsf@gmail.com> <87r5h5gwxo.fsf@mundaneum.com> <87iq2huk7u.fsf@gmail.com> <81lj7cyhkq.fsf@gmail.com> <87lj7cz1lh.fsf@gmail.com> <817hiwqk6c.fsf_-_@gmail.com> <81k4mv7wq9.fsf@gmail.com> <81bp86nqv0.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=46383 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OxXb5-0006Bk-N6 for emacs-orgmode@gnu.org; Mon, 20 Sep 2010 00:03:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OxXb3-0002nL-SU for emacs-orgmode@gnu.org; Mon, 20 Sep 2010 00:03:19 -0400 Received: from mail-pv0-f169.google.com ([74.125.83.169]:60141) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OxXb3-0002nG-Ic for emacs-orgmode@gnu.org; Mon, 20 Sep 2010 00:03:17 -0400 Received: by pvc30 with SMTP id 30so2839158pvc.0 for ; Sun, 19 Sep 2010 21:03:16 -0700 (PDT) In-Reply-To: <81bp86nqv0.fsf@gmail.com> (Jambunathan K.'s message of "Fri, 10 Sep 2010 10:21:15 +0530") 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: emacs-orgmode@gnu.org Hi Jambunathan, So, if I'm understanding correctly, what you are proposing includes two separate things, first, a new link-style syntax for calling code blocks, and second, the ability to provide un-named arguments to code blocks. I definitely agree that the second suggestion would be desirable. Even if we still use named arguments when writing code blocks it should be possible to supply un-named arguments when calling code blocks, and use the order of the arguments to resolve their variable mappings. This has been on our TODO list for some time and is just waiting for some development time. I'm less sure about expanding link syntax into a means of calling code blocks. There has been some recent discussion on the list about expanding link syntax (in fact related to the thread your referenced below) and my impression was that there is far from unanimous support for changing the semantics of links in Org-mode. Maybe this would be appropriate as an optional extension to org, i.e. something in the contrib directory. Thanks -- Eric Jambunathan K writes: > I am slightly drifting a bit. I think the broader theme that is emerging > in this thread is this - how Babel as a Org's VM would enable one to > create useful text mashups. Call it Org 2.0 if you may like. > > Needless, to say I am having a hammer and everything looks nail to > me. Please be patient with my regurgitations! Read on ... > > ,---- > | "*Article*" #("From: Vinh Nguyen > | Subject: Re: text color + highlight > | Newsgroups: gmane.emacs.orgmode > | To: emacs-orgmode@gnu.org > | Date: Thu, 9 Sep 2010 09:15:05 -0700 > | Message-ID: > | Archived-At: > |=20 > | I'd like to write a concluding email for this thread for future > | searchers to find. This easy solution is brought to you by Eric > | Schulte and Christian Moe. > |=20 > | Place the following in your .emacs or init.el file: > | ;; org-mode color > | (org-add-link-type > | \"color\" nil > | (lambda (path desc format)p > | (cond > | ((eq format 'html) > | (format \"%s\" path desc)) > | ((eq format 'latex) > | (format \"{\\\\color{%s}%s}\" path desc))))) > | ;; org-mode highlight > | (org-add-link-type > | \"hl\" nil > | (lambda (path desc format) > | (cond > | ((eq format 'html) > | (format \"%s\" pa= th desc)) > | ((eq format 'latex) > | (format \"\\\\colorbox{%s}{%s}\" path desc))))) ;; require \\usepac= kage{color} > |=20 > | Examples: > | [[color:blue][test this out]] > | [[hl:yellow][highlighted text]] > |=20 > | Remarks: > | * Pros > | - don't need to modify org-mode source (just edit your .emacs) > | - use the existing links syntax > | * Cons > | - cannot be used concurrently or with other formatting > | * To Do > | - Hopefully it will be implemented via extensible syntax in the > | future ($[options mytext]) > | - highlight and color paragraph or region > |=20 > |=20 > | -- Vinh > |=20 > |=20 > |=20 > | On Thu, Aug 5, 2010 at 1:42 PM, Vinh Nguyen wrote: > | > Dear list, > | > > | > I was wondering if there is an easy way to markup the color of the > | > text for html output (and highlight as well). =C2=A0When I prepare me= eting > | > minutes I'd like to color some things and highlight certain things. > | > Right now, I am using emphasizing a major portion of the text. =C2=A0= It > | > would be great to have colors and highlights to draw attention to > | > certain items. > | > > | > Thanks. > | > Vinh > `---- > > I wonder whether there is a way to achieve the requested feature without > too much of elisp programming. > > [[color:blue][test this out]] > ^^^^^ ^^^^^ ^^^^^^^^^^^^^ > > If one imagines this as a macro call=20 > > color =3D> babel srcname [accessible through %0 in srcbody] > blue =3D> param1 for srcname [accessible through %1 in srcbody] > test this out =3D> text param for the macro ['this' param for text mashup] > > In my earlier post, I tried to argue that if headlines could be srcnames > then the text content of the headline could be considered as an implicit > 'this' param (which the 'headline macro' works upon) > > Now if link syntax could be used as a macro call (as seen above) then > the description part of the link i.e., text contained within "inner []" > could be considered as the 'this' param for link-oriented > srcnames. (Think of links as mini, inline headlines and desc as headline > body) > > It is important to note that the user still works with text documents > which are very much like existing org documents. > > Note also that having positional params and having them canonically > accessible as %0, %1, %2 etc could have it's uses [1]. It is left to the > reader how color macro could be defined with above redefinitions. > > Let me reiterate (and I think it is important) Babel's macro expansion > if tweaked and designed for 'text mashups and massages' then much of > user requirements (like the one above) could be implemented by the user > himself without any help from expert elisp programmers. > > Footnotes: > [1] I believe babel as of this writing only permits named param list. > > Jambunathan K.