From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marvin Doyley Subject: Re: Export each top level heading to separate file Date: Sun, 5 Jan 2014 20:51:35 -0500 Message-ID: <23F445D4-9C02-4BE6-BCB9-F0A8222F0FFE@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42188) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VzzLz-0001A7-Uk for emacs-orgmode@gnu.org; Sun, 05 Jan 2014 20:51:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VzzLu-0007h9-O0 for emacs-orgmode@gnu.org; Sun, 05 Jan 2014 20:51:43 -0500 Received: from mail-ig0-x234.google.com ([2607:f8b0:4001:c05::234]:46872) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VzzLu-0007f2-HP for emacs-orgmode@gnu.org; Sun, 05 Jan 2014 20:51:38 -0500 Received: by mail-ig0-f180.google.com with SMTP id m12so5982344iga.1 for ; Sun, 05 Jan 2014 17:51:37 -0800 (PST) Received: from [10.0.1.10] (cpe-66-66-94-63.rochester.res.rr.com. [66.66.94.63]) by mx.google.com with ESMTPSA id l7sm13214051igx.2.2014.01.05.17.51.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 05 Jan 2014 17:51:36 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org This may help, but I can=92t take the credit. Someone in this forum = wrote this for me several years ago. Cheers, M ;; turn header into file (defun 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))))))=