From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thorsten Jolitz Subject: Re: Moving my init.el to Org Date: Sun, 31 Aug 2014 16:12:01 +0200 Message-ID: <87tx4svjda.fsf@gmail.com> References: <20140831103706.549dc45b@aga-netbook> <87oav1582f.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39435) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XO5rs-0004NA-LG for emacs-orgmode@gnu.org; Sun, 31 Aug 2014 10:12:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XO5rm-0001m3-Fj for emacs-orgmode@gnu.org; Sun, 31 Aug 2014 10:12:32 -0400 Received: from plane.gmane.org ([80.91.229.3]:37212) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XO5rm-0001lx-8R for emacs-orgmode@gnu.org; Sun, 31 Aug 2014 10:12:26 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XO5re-0006rn-VU for emacs-orgmode@gnu.org; Sun, 31 Aug 2014 16:12:18 +0200 Received: from g231105226.adsl.alicedsl.de ([92.231.105.226]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 31 Aug 2014 16:12:18 +0200 Received: from tjolitz by g231105226.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 31 Aug 2014 16:12:18 +0200 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 Alan Schmitt writes: > On 2014-08-31 11:20, Thorsten Jolitz writes: > >> With outshine I have many of Org-mode's advantages (and using outorg I >> can turn my elisp file into an org file in a second and have all of >> them), but its still just about a source-file in emacs-lisp-mode, and >> thats what makes things convenient, fast and dynamic. > > It there an easy way to turn an org file with many lisp source blocks > into an outshine file? I cannot start from the tangled file as it's > lacking all the org structure. Yes, use ,----[ C-h f outorg-convert-org-to-outshine RET ] | outorg-convert-org-to-outshine is a Lisp function in `outorg.el'. | | (outorg-convert-org-to-outshine &optional MODE INFILE OUTFILE BATCH) | | Convert an existing Org-mode file into an Outshine buffer. | | If MODE is non-nil, the Outshine buffer will be put in this | major-mode, otherwise the major-mode of the language of the first | source-code block in the Org-mode buffer will be used. | | If INFILE is non-nil, the specified Org-mode file will be | visited, otherwise the current buffer will be used (i.e. the | buffer content will be copied to a temporary *outorg-edit-buffer* | for further processing). | | If OUTFILE is non-nil, the converted Outshine buffer will be | saved in this file. Its the user's responsability to make sure | that OUTFILE's file-extension is suited for the major-mode of the | Outshine buffer to be saved. When in doubt, consult variable | `auto-mode-alist' for associations between file-extensions and | major-modes. | | If BATCH is non-nil (and OUTFILE is non-nil, otherwise it makes | no sense), the new Outshine file is saved and its buffer | deleted. `---- Note: 1. I think I took care of converting ,---- | #+BEGIN_SRC emacs-lisp :cache no | (+ 2 2) | #+END_SRC `---- to ,---- | ;; #+header: :cache no | (+ 2 2) `---- in outorg, but it was not flawless IIRC. You could run ,----[ C-h f org-dp-toggle-headers RET ] | org-dp-toggle-headers is an interactive Lisp function in | `org-dp-lib.el'. | | (org-dp-toggle-headers &optional ACTION) | | Toggle header argument representation. | With prefix-arg, prompt user for ACTION, otherwise, if non-nil, | it should take one the values `swap', `header' or `param', | meaning to either swap :header and :parameter values, or make | them all :header or :parameter values repectively. `---- on your src-blocks before conversion, as an alternative, like this ,---- | (org-dp-toggle-headers &optional 'header) `---- to avoid losing the src-block header-args during conversion. 2. Call 'outorg-convert-org-to-outshine' just once, its only for the initial conversion. Then you have an outshine file that you convert to org occasionally with the usual 'outorg-edit-as-org'. -- cheers, Thorsten