From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jambunathan K Subject: Re: [BABEL][PROPOSAL] headlines as executable srcnames Date: Fri, 10 Sep 2010 10:21:15 +0530 Message-ID: <81bp86nqv0.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> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=41275 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OtvaR-000449-96 for emacs-orgmode@gnu.org; Fri, 10 Sep 2010 00:51:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OtvaP-00030Z-2o for emacs-orgmode@gnu.org; Fri, 10 Sep 2010 00:51:43 -0400 Received: from mail-px0-f169.google.com ([209.85.212.169]:51651) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OtvaO-00030R-RK for emacs-orgmode@gnu.org; Fri, 10 Sep 2010 00:51:41 -0400 Received: by pxi5 with SMTP id 5so1488117pxi.0 for ; Thu, 09 Sep 2010 21:51:39 -0700 (PDT) In-Reply-To: <81k4mv7wq9.fsf@gmail.com> (Jambunathan K.'s message of "Thu, 09 Sep 2010 21:08:54 +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: Eric Schulte Cc: emacs-orgmode@gnu.org 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\" path= desc)) | ((eq format 'latex) | (format \"\\\\colorbox{%s}{%s}\" path desc))))) ;; require \\usepacka= ge{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). =A0When I prepare meeting | > minutes I'd like to color some things and highlight certain things. | > Right now, I am using emphasizing a major portion of the text. =A0It | > 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.