From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Dimitris Kapetanakis" Subject: Re: export to txt files Date: Tue, 18 Mar 2008 09:28:44 +0200 Message-ID: <2a6300ea0803180028v3bf5ec50if889185fd7baa782@mail.gmail.com> References: <2a6300ea0803170856r34c1a143v597459b03f6a2752@mail.gmail.com> <87eja96ygx.fsf@shellarchive.co.uk> <87zlsxuof0.wl%n142857@gmail.com> <2f1c7d020803171250odffe2a4y988128bcddd56ba8@mail.gmail.com> <2a6300ea0803172202h2d43dc90t671c6013778da22b@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0038788886==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JbWFc-0000Dt-3z for emacs-orgmode@gnu.org; Tue, 18 Mar 2008 03:28:48 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JbWFa-0000Ci-Ou for emacs-orgmode@gnu.org; Tue, 18 Mar 2008 03:28:47 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JbWFa-0000CJ-JD for emacs-orgmode@gnu.org; Tue, 18 Mar 2008 03:28:46 -0400 Received: from wx-out-0506.google.com ([66.249.82.233]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JbWFa-00029m-73 for emacs-orgmode@gnu.org; Tue, 18 Mar 2008 03:28:46 -0400 Received: by wx-out-0506.google.com with SMTP id s7so5908445wxc.24 for ; Tue, 18 Mar 2008 00:28:45 -0700 (PDT) In-Reply-To: <2a6300ea0803172202h2d43dc90t671c6013778da22b@mail.gmail.com> 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: Hugo Schmitt Cc: emacs-orgmode@gnu.org --===============0038788886== Content-Type: multipart/alternative; boundary="----=_Part_7444_21850020.1205825324751" ------=_Part_7444_21850020.1205825324751 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I think I did it!!! just make a backward search Check the following (defun org-export-top-levels () (interactive) (goto-char (point-max)) (let (start (point)) (while (re-search-backward "^* " nil t) (write-region start (point-at-bol) (concat (org-get-heading) ".txt")) (setq start (point-at-bol))))) 2008/3/18, Dimitris Kapetanakis : > > THANKS EVERYBODY > > I was looking at something like Hugo's response. It is a click away since > it saves under a "heading.txt" the next heading's text. I am trying to > take a look at it with my poor knowledge of Lisp. > > 2008/3/17, Hugo Schmitt : > > > > Hm, I guess I sent this only to Dimitri... I'm resending it to the > > list.. > > > > This seems to do what you want. > > > > > > (defun org-export-top-levels () > > (interactive) > > (goto-char (point-min)) > > (let (start (point)) > > (while (re-search-forward "^* " nil t) > > (write-region start (point-at-bol) (concat (org-get-heading) > > ".txt")) > > (setq start (point-at-bol))))) > > > > Regards, > > Hugo > > > > > > On Mon, Mar 17, 2008 at 4:43 PM, Daniel Clemente > > wrote: > > > > > > Mmmm... I wrote a program which can do this: > > > http://www.danielclemente.com/dislines/index.en.html > > > > > > however it's not LISP. > > > I have written multilingual org files this way, but it's not > > comfortable since it requires several programs and processing phases. I am > > still looking for a solution in Emacs LISP, and if possible, one which > > integrates nicely with org-mode :-) > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > Emacs-orgmode mailing list > > > Remember: use `Reply All' to send replies to the list. > > > Emacs-orgmode@gnu.org > > > http://lists.gnu.org/mailman/listinfo/emacs-orgmode > > > > > > > ------=_Part_7444_21850020.1205825324751 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I think I did it!!!

just make a backward search

Check the following

(defun org-export-top-levels ()
 (interactive)
 (goto-char (point-max))
 (let (start (point))
       (while (re-search-backward "^* " nil t)
         (write-region start (point-at-bol) (concat (org-get-heading) ".txt"))
         (setq start (point-at-bol)))))



2008/3/18, Dimitris Kapetanakis <katepano@gmail.com>:
THANKS EVERYBODY

I was looking at something like Hugo's response. It is a click away since it saves under a "heading.txt" the next heading's text. I am trying to take a look at it with my poor knowledge of Lisp.

2008/3/17, Hugo Schmitt <hugows@gmail.com>:
Hm, I guess I sent this only to Dimitri... I'm resending it to the list..

This seems to do what you want.


(defun org-export-top-levels ()
  (interactive)
  (goto-char (point-min))
  (let (start (point))
       (while (re-search-forward "^* " nil t)
         (write-region start (point-at-bol) (concat (org-get-heading) ".txt"))
         (setq start (point-at-bol)))))

Regards,
Hugo


On Mon, Mar 17, 2008 at 4:43 PM, Daniel Clemente <n142857@gmail.com> wrote:
>
>   Mmmm... I wrote a program which can do this:
>   http://www.danielclemente.com/dislines/index.en.html
>
>   however it's not LISP.
>   I have written multilingual org files this way, but it's not comfortable since it requires several programs and processing phases. I am still looking for a solution in Emacs LISP, and if possible, one which integrates nicely with org-mode :-)
>
>
>
>
>

>  _______________________________________________
>  Emacs-orgmode mailing list
>  Remember: use `Reply All' to send replies to the list.
>  Emacs-orgmode@gnu.org
>  http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>


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