From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thorsten Jolitz Subject: Re: Moving my init.el to Org Date: Tue, 02 Sep 2014 11:22:06 +0200 Message-ID: <87bnqyqsw1.fsf@gmail.com> References: <20140831103706.549dc45b@aga-netbook> <87oav1582f.fsf@gmail.com> <87tx4svjda.fsf@gmail.com> <87ha0r2fwc.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33081) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOkIJ-0008M2-5o for emacs-orgmode@gnu.org; Tue, 02 Sep 2014 05:22:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XOkID-0006NS-1O for emacs-orgmode@gnu.org; Tue, 02 Sep 2014 05:22:31 -0400 Received: from plane.gmane.org ([80.91.229.3]:38080) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOkIC-0006NG-RT for emacs-orgmode@gnu.org; Tue, 02 Sep 2014 05:22:24 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XOkI8-0001x0-Bo for emacs-orgmode@gnu.org; Tue, 02 Sep 2014 11:22:20 +0200 Received: from e178189199.adsl.alicedsl.de ([85.178.189.199]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 02 Sep 2014 11:22:20 +0200 Received: from tjolitz by e178189199.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 02 Sep 2014 11:22:20 +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-09-01 23:24, Thorsten Jolitz writes: > >> Thats a bug, it should be fixed now in branch tj-outorg (which should >> actually be faster and better than master anyway and will hopefully be >> merged in a few weeks or so). > > Great, thanks. > >> can you test it too? > > Unfortunately I install navi as a package, so it's not easy for me to > switch branches. Let me know when you do the merge and I'll definitely > test then. (There is no hurry as I manually converted the file to > outshine format, which was less painful than I feared.) Too bad, I thought I found a beta-tester for the outshine/outorg/navi "tj" branches before merging them into master ;) And sorry for the hassle of manual converting, the bug was actually in this function, so in case you want to convert another org file, here is the (hopefully) fixed version: #+BEGIN_SRC emacs-lisp (defun outorg-transform-active-source-block-headers () "Move switches and arguments on top of block. This functions transforms all active source-blocks, i.e. those with the associated source-code buffer's major-mode as language. If there are switches and header arguments after the language specification on the #+BEGIN_SRC line, they are moved on top of the block. The idea behind this function is that it should be possible to specify permanent switches and arguments even for source-code blocks that are transformed back to code after `outorg-copy-and-switch' is called. They will remain as comment lines directly over their code section in the source-code buffer, and thus be transformed to text - and thereby activated - everytime `outorg-edit-as-org' is called." (save-excursion (let* ((mode (outorg-get-buffer-mode (marker-buffer outorg-code-buffer-point-marker))) (active-lang (outorg-get-babel-name mode 'as-strg-p))) (org-babel-map-src-blocks nil (when (string-equal active-lang lang) (let ((sw switches) (args header-args)) (goto-char end-lang) (delete-region (point) (line-end-position)) (goto-char beg-block) (forward-line -1) (when (org-string-nw-p sw) (newline) (insert (format "#+header: %s" sw))) (when (org-string-nw-p args) (let ((params (ignore-errors (org-split-string args))) headers) (while params (setq headers (cons (format "#+header: %s %s" (org-no-properties (pop params)) (org-no-properties (pop params))) headers))) (newline) (insert (mapconcat 'identity headers "\n")))))))))) #+END_SRC -- cheers, Thorsten