From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marvin Doyley Subject: Re: requested feature Date: Mon, 15 Nov 2010 13:23:42 -0500 Message-ID: References: <87k4kfvh0y.wl%dmaus@ictsoc.de> <87zktahbre.fsf@gmail.com> <87ipzyea7l.wl%dmaus@ictsoc.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0230758139==" Return-path: Received: from [140.186.70.92] (port=37800 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PI3iW-000128-37 for emacs-orgmode@gnu.org; Mon, 15 Nov 2010 13:23:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PI3iR-0000Y9-DB for emacs-orgmode@gnu.org; Mon, 15 Nov 2010 13:23:48 -0500 Received: from mail-fx0-f41.google.com ([209.85.161.41]:53515) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PI3iR-0000Y3-5b for emacs-orgmode@gnu.org; Mon, 15 Nov 2010 13:23:43 -0500 Received: by fxm20 with SMTP id 20so4224533fxm.0 for ; Mon, 15 Nov 2010 10:23:42 -0800 (PST) In-Reply-To: <87ipzyea7l.wl%dmaus@ictsoc.de> 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: David Maus Cc: emacs-orgmode@gnu.org, Paul Mead --===============0230758139== Content-Type: multipart/alternative; boundary=20cf3054a645359ee904951b8aa4 --20cf3054a645359ee904951b8aa4 Content-Type: text/plain; charset=ISO-8859-1 This is awesome guys, but I have one other request. Lets say we want to export the content of the main and the linked file to latex, how would we do this ? Just for some more clarity Lets say my main file contain the following headings Apples Cherry Banana Using your code I create a new file Apples.org, in which I have bunch of info on apples. It would be nice to be able to export the content of the main and linked files to latex. I am thinking of the equivalent of having an \include{} Does anybody have any thoughts on how to do this ? cheers M On Mon, Nov 15, 2010 at 1:02 PM, David Maus wrote: > At Mon, 15 Nov 2010 15:01:09 +0000, > Paul Mead wrote: > > > > > > This looks pretty interesting to me, but how would you change this so > > that it used the whole heading text, not just one word? > > It's basically the same, only difference is finding the headline text > and making the headline text link-safe: > > (defun dmj:turn-headline-into-org-mode-link () > "Replace word at point by an Org mode link." > (interactive) > (when (org-at-heading-p) > (let ((hl-text (nth 4 (org-heading-components)))) > (unless (or (null hl-text) > (org-string-match-p "^[ \t]*:[^:]+:$" hl-text)) > (beginning-of-line) > (search-forward hl-text (point-at-eol)) > (replace-string > hl-text > (format "[[file:%s.org][%s]]" > (org-link-escape hl-text) > (org-link-escape hl-text '((?\] . "%5D") (?\[ . "%5B")))) > nil (- (point) (length hl-text)) (point)))))) > > Best, > -- David > > -- > OpenPGP... 0x99ADB83B5A4478E6 > Jabber.... dmjena@jabber.org > Email..... dmaus@ictsoc.de > --20cf3054a645359ee904951b8aa4 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable This is awesome guys, but I have one other request.

Lets say we want= to export the content of the main and the linked file to latex, how would = we do this ?

Just for some more clarity

Lets say my main file= contain the following headings

Apples
Cherry
Banana

Using your code I create a new file = Apples.org, in which I have bunch of info on apples. It would be nice to be= able to export the content of the main and linked files to latex. I am thi= nking of the equivalent of having an \include{}

Does anybody have any thoughts on how to do this ?

cheers
M


On Mon, Nov 15, 2010 at 1:02 PM, D= avid Maus <dmaus@ic= tsoc.de> wrote:
At Mon, 15 Nov 20= 10 15:01:09 +0000,
Paul Mead wrote:
>
>
> This looks pretty interesting to me, but how would you change this so<= br> > that it used the whole heading text, not just one word?

It's basically the same, only difference is finding the headline = text
and making the headline text link-safe:

(defun dmj:turn-headline-into-org-mode-link ()
=A0"Replace word at point by an Org mode link."= ;
=A0(interactive)
=A0(when (org-at-heading-p)
=A0 =A0(let ((hl-text (nth 4 (org-heading-components))))
=A0 =A0 =A0(unless (or (null hl-text)
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(org-string-match-p "^[ \t]*:[^:]+= :$" hl-text))
=A0 =A0 =A0 =A0(beginning-of-line)
=A0 =A0 =A0 =A0(search-forward hl-text (point-at-eol))
=A0 =A0 =A0 =A0(replace-string
=A0 =A0 =A0 =A0 hl-text
=A0 =A0 =A0 =A0 (format "[[file:%s.org][%s]]"
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (org-link-escape hl-text)
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (org-link-escape hl-text '((?\] . &quo= t;%5D") (?\[ . "%5B"))))
=A0 =A0 =A0 =A0 nil (- (point) (length hl-text)) (point))))))

Best,
=A0-- David

--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... dmaus@ictsoc.de

--20cf3054a645359ee904951b8aa4-- --===============0230758139== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============0230758139==--