From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marvin Doyley Subject: Re: requested feature Date: Mon, 15 Nov 2010 09:01:42 -0500 Message-ID: References: <87k4kfvh0y.wl%dmaus@ictsoc.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1112976260==" Return-path: Received: from [140.186.70.92] (port=35870 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PHzd0-0008Dr-5X for emacs-orgmode@gnu.org; Mon, 15 Nov 2010 09:01:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PHzcu-000848-UH for emacs-orgmode@gnu.org; Mon, 15 Nov 2010 09:01:49 -0500 Received: from mail-fx0-f41.google.com ([209.85.161.41]:62688) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PHzcu-00083n-NC for emacs-orgmode@gnu.org; Mon, 15 Nov 2010 09:01:44 -0500 Received: by fxm20 with SMTP id 20so3969173fxm.0 for ; Mon, 15 Nov 2010 06:01:43 -0800 (PST) In-Reply-To: <87k4kfvh0y.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 --===============1112976260== Content-Type: multipart/alternative; boundary=20cf3054a2db446501049517e135 --20cf3054a2db446501049517e135 Content-Type: text/plain; charset=ISO-8859-1 Hi David, This is exactly what I was looking for, thank you. cheers M On Sun, Nov 14, 2010 at 2:31 PM, David Maus wrote: > At Fri, 29 Oct 2010 19:24:32 -0400, > Marvin Doyley wrote: > > > > [1 ] > > [1.1 ] > > Does anybody have a function that turns a org header into file with a > link > > to the file where it originated from ? > > For example, lets say I have the following heading > > > > * Apples > > * Cherry > > * Tomatoes > > > > Lets say I have a mini project on Apples, it would be nice to issue a > single > > command that turns Applies into Apples.org with a link > > Maybe something like this: > > (defun dmj:turn-word-into-org-mode-link () > "Replace word at point by an Org mode link." > (interactive) > (let ((word (thing-at-point 'word))) > (when word > (re-search-backward "\\W" nil t) > (replace-string > word (format "[[file:%s.org][%s]]" word word) t) > (point) (+ (point) (length word))))) > > Grab word at point, go to its beginning, replace with an Org mode > link. > > Best, > -- David > -- > OpenPGP... 0x99ADB83B5A4478E6 > Jabber.... dmjena@jabber.org > Email..... dmaus@ictsoc.de > --20cf3054a2db446501049517e135 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi David,

This is exactly what I was looking for, thank you.

= cheers
M

On Sun, Nov 14, 2010 at 2:31 = PM, David Maus <dma= us@ictsoc.de> wrote:
At Fri, 29 Oct 20= 10 19:24:32 -0400,
Marvin Doyley wrote:
>
> [1 =A0<multipart/alternative (7bit)>]
> [1.1 =A0<text/plain; ISO-8859-1 (7bit)>]
> Does anybody have a function that tu= rns a org header into file with a link
> to the file where it originated from ?
> For example, lets say I have the following heading
>
> * Apples
> * Cherry
> * Tomatoes
>
> Lets say I have a mini project on Apples, it would be nice to issue a = single
> command that turns Applies into Apples.org with a link

Maybe something like this:

(defun dmj:turn-word-into-org-mode-link ()
=A0"Replace word at point by an Org mode link."
=A0(interactive)
=A0(let ((word (thing-at-point 'word)))
=A0 =A0(when word
=A0 =A0 =A0(re-search-backward "\\W" nil t)
=A0 =A0 =A0(replace-string
=A0 =A0 =A0 word (format "[[file:%s.org][%s]]" word word) t)
=A0 =A0 =A0(point) (+ (point) (length word)))))

Grab word at point, go to its beginning, replace with an Org mode
link.

Best,
=A0-- David
--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... dmaus@ictsoc.de

--20cf3054a2db446501049517e135-- --===============1112976260== 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 --===============1112976260==--