emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Details of compling and running C++ code from Org-mode?
@ 2011-11-05  7:44 Michael Hannon
  2011-11-18 19:39 ` Eric Schulte
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Hannon @ 2011-11-05  7:44 UTC (permalink / raw)
  To: Org-Mode List



Greetings.  I'm curious about the process of executing a program that is
compiled from a source block in Org-mode.

Some background: I was playing with some C++ code (a slight generalization of
some code I found in a book).  I wanted to use the "assign" method to
initialize a vector, as:

    vector<int> testVec(5, 0);
    testVec.assign({2, 4, 6, 8, 10});

It turns out that to do this one has to tell g++ (in my case) to use the
latest version of the C++ standard.  I discovered that I could do this via:

    (setq org-babel-C++-compiler "g++ -std=c++0x")

This got me to wondering if there were any similar hooks that relate to
running the program once it's compiled.  I looked through the list of
org-babel* variables, but didn't find anything obvious.

So what does happen when I hit C-c C-c in, say, a cpp source-code block?  The
contents of the file are evidently written to a temporary file, after which
the command specified by org-babel-C++-compiler is run on that file.  The
results of the compilation are stuck some place -- another temporary file, I
suppose.  Then the second, executable file is run and the results collected.
What command runs the file?  Is there any control from Org-mode over this
second stage of the process?

Thanks,

-- Mike

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Details of compling and running C++ code from Org-mode?
  2011-11-05  7:44 Details of compling and running C++ code from Org-mode? Michael Hannon
@ 2011-11-18 19:39 ` Eric Schulte
  2011-11-18 23:07   ` [bug] " Sebastien Vauban
  2011-11-19 20:27   ` Michael Hannon
  0 siblings, 2 replies; 4+ messages in thread
From: Eric Schulte @ 2011-11-18 19:39 UTC (permalink / raw)
  To: Michael Hannon; +Cc: Org-Mode List

Hi Michael,

Michael Hannon <jm_hannon@yahoo.com> writes:

> Greetings.  I'm curious about the process of executing a program that is
> compiled from a source block in Org-mode.
>
> Some background: I was playing with some C++ code (a slight generalization of
> some code I found in a book).  I wanted to use the "assign" method to
> initialize a vector, as:
>
>     vector<int> testVec(5, 0);
>     testVec.assign({2, 4, 6, 8, 10});
>
> It turns out that to do this one has to tell g++ (in my case) to use the
> latest version of the C++ standard.  I discovered that I could do this via:
>
>     (setq org-babel-C++-compiler "g++ -std=c++0x")
>

You could also use the :flags header argument (:flags "-std=c++0x") to
pass this flag to g++.

>
> This got me to wondering if there were any similar hooks that relate to
> running the program once it's compiled.  I looked through the list of
> org-babel* variables, but didn't find anything obvious.
>
> So what does happen when I hit C-c C-c in, say, a cpp source-code block?  The
> contents of the file are evidently written to a temporary file, after which
> the command specified by org-babel-C++-compiler is run on that file.  The
> results of the compilation are stuck some place -- another temporary file, I
> suppose.  Then the second, executable file is run and the results
> collected.

Thanks for asking this question, and sorry it took so long to respond.
I've placed an annotated copy of the relevant code up at [1] which
should explain the evaluation process for c/c++ code.  In many cases
browsing the relevant org-babel-execute:* function for your language is
the best way to discover what flags are available.

> 
> What command runs the file?

The file itself is called directly.

>   Is there any control from Org-mode over this second stage of the
> process?

Yes, the :cmdline header argument may be used to pass values to the
executing file.

Best -- Eric

>
> Thanks,
>
> -- Mike
>


Footnotes: 
[1]  http://cs.unm.edu/~eschulte/data/babel-c-execution.html
     http://cs.unm.edu/~eschulte/data/babel-c-execution.org

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [bug] Details of compling and running C++ code from Org-mode?
  2011-11-18 19:39 ` Eric Schulte
@ 2011-11-18 23:07   ` Sebastien Vauban
  2011-11-19 20:27   ` Michael Hannon
  1 sibling, 0 replies; 4+ messages in thread
From: Sebastien Vauban @ 2011-11-18 23:07 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Eric,

Eric Schulte wrote:
> Michael Hannon <jm_hannon-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> writes:
> I've placed an annotated copy of the relevant code up at [1] which
> should explain the evaluation process for c/c++ code.  In many cases
> browsing the relevant org-babel-execute:* function for your language is
> the best way to discover what flags are available.
>
> Footnotes: 
> [1]  http://cs.unm.edu/~eschulte/data/babel-c-execution.html
>      http://cs.unm.edu/~eschulte/data/babel-c-execution.org

Trying to export your Org file to LaTeX results in this:

#+begin_src emacs-lisp
Debugger entered--Lisp error: (error "unbalanced begin/end_src blocks with #(\"#+begin_src emacs-lisp -n -l \\\"ref:%s\\\"
\" 0 7 (fontified nil font-lock-fontified t) 7 11 (fontified nil font-lock-fontified t) 11 37 (fontified nil font-lock-fontified t) 37 38 (fontified nil font-lock-fontified t))")
  signal(error ("unbalanced begin/end_src blocks with #(\"#+begin_src emacs-lisp -n -l \\\"ref:%s\\\"\n\" 0 7 (fontified nil font-lock-fontified t) 7 11 (fontified nil font-lock-fontified t) 11 37 (fontified nil font-lock-fontified t) 37 38 (fontified nil font-lock-fontified t))"))
  error("unbalanced begin/end_%s blocks with %S" src #("#+begin_src emacs-lisp -n -l \"ref:%s\"\n" 0 7 (fontified nil font-lock-fontified t) 7 11 (fontified nil font-lock-fontified t) 11 37 (fontified nil font-lock-fontified t) 37 38 (fontified nil font-lock-fontified t)))
  (progn (error "unbalanced begin/end_%s blocks with %S" type (buffer-substring match-start (point))))
  (if (not (zerop balanced)) (progn (error "unbalanced begin/end_%s blocks with %S" type (buffer-substring match-start (point)))))
  (when (not (zerop balanced)) (error "unbalanced begin/end_%s blocks with %S" type (buffer-substring match-start (point))))
  (let* ((match-start (copy-marker (match-beginning 0))) (body-start (copy-marker (match-end 0))) (indentation (length (match-string 1))) (inner-re (format "[\n][ 	]*#\\+\\(begin\\|end\\)_%s" (regexp-quote (downcase (match-string 2))))) (type (intern (downcase (match-string 2)))) (headers (save-match-data (org-split-string (match-string 3) "[ 	]+"))) (balanced 1) (preserve-indent (or org-src-preserve-indentation (member "-i" headers))) match-end) (while (and (not (zerop balanced)) (re-search-forward inner-re nil t)) (if (string= (downcase (match-string 1)) "end") (decf balanced) (incf balanced))) (when (not (zerop balanced)) (error "unbalanced begin/end_%s blocks with %S" type (buffer-substring match-start (point)))) (setq match-end (copy-marker (match-end 0))) (unless preserve-indent (setq body (save-match-data (org-remove-indentation (buffer-substring body-start (match-beginning 0)))))) (unless (memq type types) (setq types (cons type types))) (save-match-data (interblock start match-start)) (when (setq func (cadr (assoc type org-export-blocks))) (let ((replacement (save-match-data (if (memq type org-export-blocks-witheld) "" (apply func body headers))))) (when replacement (delete-region match-start match-end) (goto-char match-start) (insert replacement) (unless preserve-indent (indent-code-rigidly match-start (point) indentation))))) (set-marker match-start nil) (set-marker body-start nil) (set-marker match-end nil))
  (while (re-search-forward beg-re nil t) (let* ((match-start (copy-marker (match-beginning 0))) (body-start (copy-marker (match-end 0))) (indentation (length (match-string 1))) (inner-re (format "[\n][ 	]*#\\+\\(begin\\|end\\)_%s" (regexp-quote (downcase (match-string 2))))) (type (intern (downcase (match-string 2)))) (headers (save-match-data (org-split-string (match-string 3) "[ 	]+"))) (balanced 1) (preserve-indent (or org-src-preserve-indentation (member "-i" headers))) match-end) (while (and (not (zerop balanced)) (re-search-forward inner-re nil t)) (if (string= (downcase (match-string 1)) "end") (decf balanced) (incf balanced))) (when (not (zerop balanced)) (error "unbalanced begin/end_%s blocks with %S" type (buffer-substring match-start (point)))) (setq match-end (copy-marker (match-end 0))) (unless preserve-indent (setq body (save-match-data (org-remove-indentation (buffer-substring body-start (match-beginning 0)))))) (unless (memq type types) (setq types (cons type types))) (save-match-data (interblock start match-start)) (when (setq func (cadr (assoc type org-export-blocks))) (let ((replacement (save-match-data (if ... "" ...)))) (when replacement (delete-region match-start match-end) (goto-char match-start) (insert replacement) (unless preserve-indent (indent-code-rigidly match-start (point) indentation))))) (set-marker match-start nil) (set-marker body-start nil) (set-marker match-end nil)) (setq start (point)))
  (let ((beg-re "^\\([ 	]*\\)#\\+begin_\\(\\S-+\\)[ 	]*\\(.*\\)?[\n]")) (while (re-search-forward beg-re nil t) (let* ((match-start (copy-marker (match-beginning 0))) (body-start (copy-marker (match-end 0))) (indentation (length (match-string 1))) (inner-re (format "[\n][ 	]*#\\+\\(begin\\|end\\)_%s" (regexp-quote (downcase ...)))) (type (intern (downcase (match-string 2)))) (headers (save-match-data (org-split-string (match-string 3) "[ 	]+"))) (balanced 1) (preserve-indent (or org-src-preserve-indentation (member "-i" headers))) match-end) (while (and (not (zerop balanced)) (re-search-forward inner-re nil t)) (if (string= (downcase (match-string 1)) "end") (decf balanced) (incf balanced))) (when (not (zerop balanced)) (error "unbalanced begin/end_%s blocks with %S" type (buffer-substring match-start (point)))) (setq match-end (copy-marker (match-end 0))) (unless preserve-indent (setq body (save-match-data (org-remove-indentation (buffer-substring body-start ...))))) (unless (memq type types) (setq types (cons type types))) (save-match-data (interblock start match-start)) (when (setq func (cadr (assoc type org-export-blocks))) (let ((replacement (save-match-data ...))) (when replacement (delete-region match-start match-end) (goto-char match-start) (insert replacement) (unless preserve-indent (indent-code-rigidly match-start ... indentation))))) (set-marker match-start nil) (set-marker body-start nil) (set-marker match-end nil)) (setq start (point))))
  (progn (fset (quote interblock) (function* (lambda (start end) (block interblock (mapcar (lambda (pair) (funcall ... start end)) org-export-interblocks))))) (goto-char (point-min)) (setq start (point)) (let ((beg-re "^\\([ 	]*\\)#\\+begin_\\(\\S-+\\)[ 	]*\\(.*\\)?[\n]")) (while (re-search-forward beg-re nil t) (let* ((match-start (copy-marker (match-beginning 0))) (body-start (copy-marker (match-end 0))) (indentation (length (match-string 1))) (inner-re (format "[\n][ 	]*#\\+\\(begin\\|end\\)_%s" (regexp-quote ...))) (type (intern (downcase ...))) (headers (save-match-data (org-split-string ... "[ 	]+"))) (balanced 1) (preserve-indent (or org-src-preserve-indentation (member "-i" headers))) match-end) (while (and (not (zerop balanced)) (re-search-forward inner-re nil t)) (if (string= (downcase ...) "end") (decf balanced) (incf balanced))) (when (not (zerop balanced)) (error "unbalanced begin/end_%s blocks with %S" type (buffer-substring match-start (point)))) (setq match-end (copy-marker (match-end 0))) (unless preserve-indent (setq body (save-match-data (org-remove-indentation ...)))) (unless (memq type types) (setq types (cons type types))) (save-match-data (interblock start match-start)) (when (setq func (cadr (assoc type org-export-blocks))) (let ((replacement ...)) (when replacement (delete-region match-start match-end) (goto-char match-start) (insert replacement) (unless preserve-indent ...)))) (set-marker match-start nil) (set-marker body-start nil) (set-marker match-end nil)) (setq start (point)))) (interblock start (point-max)) (run-hooks (quote org-export-blocks-postblock-hook)))
  (unwind-protect (progn (fset (quote interblock) (function* (lambda (start end) (block interblock (mapcar (lambda ... ...) org-export-interblocks))))) (goto-char (point-min)) (setq start (point)) (let ((beg-re "^\\([ 	]*\\)#\\+begin_\\(\\S-+\\)[ 	]*\\(.*\\)?[\n]")) (while (re-search-forward beg-re nil t) (let* ((match-start (copy-marker ...)) (body-start (copy-marker ...)) (indentation (length ...)) (inner-re (format "[\n][ 	]*#\\+\\(begin\\|end\\)_%s" ...)) (type (intern ...)) (headers (save-match-data ...)) (balanced 1) (preserve-indent (or org-src-preserve-indentation ...)) match-end) (while (and (not ...) (re-search-forward inner-re nil t)) (if (string= ... "end") (decf balanced) (incf balanced))) (when (not (zerop balanced)) (error "unbalanced begin/end_%s blocks with %S" type (buffer-substring match-start ...))) (setq match-end (copy-marker (match-end 0))) (unless preserve-indent (setq body (save-match-data ...))) (unless (memq type types) (setq types (cons type types))) (save-match-data (interblock start match-start)) (when (setq func (cadr ...)) (let (...) (when replacement ... ... ... ...))) (set-marker match-start nil) (set-marker body-start nil) (set-marker match-end nil)) (setq start (point)))) (interblock start (point-max)) (run-hooks (quote org-export-blocks-postblock-hook))) (if --cl-letf-bound-- (fset (quote interblock) --cl-letf-save--) (fmakunbound (quote interblock))))
  (let* ((--cl-letf-bound-- (fboundp (quote interblock))) (--cl-letf-save-- (and --cl-letf-bound-- (symbol-function (quote interblock))))) (unwind-protect (progn (fset (quote interblock) (function* (lambda (start end) (block interblock (mapcar ... org-export-interblocks))))) (goto-char (point-min)) (setq start (point)) (let ((beg-re "^\\([ 	]*\\)#\\+begin_\\(\\S-+\\)[ 	]*\\(.*\\)?[\n]")) (while (re-search-forward beg-re nil t) (let* ((match-start ...) (body-start ...) (indentation ...) (inner-re ...) (type ...) (headers ...) (balanced 1) (preserve-indent ...) match-end) (while (and ... ...) (if ... ... ...)) (when (not ...) (error "unbalanced begin/end_%s blocks with %S" type ...)) (setq match-end (copy-marker ...)) (unless preserve-indent (setq body ...)) (unless (memq type types) (setq types ...)) (save-match-data (interblock start match-start)) (when (setq func ...) (let ... ...)) (set-marker match-start nil) (set-marker body-start nil) (set-marker match-end nil)) (setq start (point)))) (interblock start (point-max)) (run-hooks (quote org-export-blocks-postblock-hook))) (if --cl-letf-bound-- (fset (quote interblock) --cl-letf-save--) (fmakunbound (quote interblock)))))
  (letf (((symbol-function (quote interblock)) (function* (lambda (start end) (block interblock (mapcar (lambda ... ...) org-export-interblocks)))))) (goto-char (point-min)) (setq start (point)) (let ((beg-re "^\\([ 	]*\\)#\\+begin_\\(\\S-+\\)[ 	]*\\(.*\\)?[\n]")) (while (re-search-forward beg-re nil t) (let* ((match-start (copy-marker (match-beginning 0))) (body-start (copy-marker (match-end 0))) (indentation (length (match-string 1))) (inner-re (format "[\n][ 	]*#\\+\\(begin\\|end\\)_%s" (regexp-quote ...))) (type (intern (downcase ...))) (headers (save-match-data (org-split-string ... "[ 	]+"))) (balanced 1) (preserve-indent (or org-src-preserve-indentation (member "-i" headers))) match-end) (while (and (not (zerop balanced)) (re-search-forward inner-re nil t)) (if (string= (downcase ...) "end") (decf balanced) (incf balanced))) (when (not (zerop balanced)) (error "unbalanced begin/end_%s blocks with %S" type (buffer-substring match-start (point)))) (setq match-end (copy-marker (match-end 0))) (unless preserve-indent (setq body (save-match-data (org-remove-indentation ...)))) (unless (memq type types) (setq types (cons type types))) (save-match-data (interblock start match-start)) (when (setq func (cadr (assoc type org-export-blocks))) (let ((replacement ...)) (when replacement (delete-region match-start match-end) (goto-char match-start) (insert replacement) (unless preserve-indent ...)))) (set-marker match-start nil) (set-marker body-start nil) (set-marker match-end nil)) (setq start (point)))) (interblock start (point-max)) (run-hooks (quote org-export-blocks-postblock-hook)))
  (letf* (((symbol-function (quote interblock)) (function* (lambda (start end) (block interblock (mapcar (lambda ... ...) org-export-interblocks)))))) (goto-char (point-min)) (setq start (point)) (let ((beg-re "^\\([ 	]*\\)#\\+begin_\\(\\S-+\\)[ 	]*\\(.*\\)?[\n]")) (while (re-search-forward beg-re nil t) (let* ((match-start (copy-marker (match-beginning 0))) (body-start (copy-marker (match-end 0))) (indentation (length (match-string 1))) (inner-re (format "[\n][ 	]*#\\+\\(begin\\|end\\)_%s" (regexp-quote ...))) (type (intern (downcase ...))) (headers (save-match-data (org-split-string ... "[ 	]+"))) (balanced 1) (preserve-indent (or org-src-preserve-indentation (member "-i" headers))) match-end) (while (and (not (zerop balanced)) (re-search-forward inner-re nil t)) (if (string= (downcase ...) "end") (decf balanced) (incf balanced))) (when (not (zerop balanced)) (error "unbalanced begin/end_%s blocks with %S" type (buffer-substring match-start (point)))) (setq match-end (copy-marker (match-end 0))) (unless preserve-indent (setq body (save-match-data (org-remove-indentation ...)))) (unless (memq type types) (setq types (cons type types))) (save-match-data (interblock start match-start)) (when (setq func (cadr (assoc type org-export-blocks))) (let ((replacement ...)) (when replacement (delete-region match-start match-end) (goto-char match-start) (insert replacement) (unless preserve-indent ...)))) (set-marker match-start nil) (set-marker body-start nil) (set-marker match-end nil)) (setq start (point)))) (interblock start (point-max)) (run-hooks (quote org-export-blocks-postblock-hook)))
  (flet ((interblock (start end) (mapcar (lambda (pair) (funcall (second pair) start end)) org-export-interblocks))) (goto-char (point-min)) (setq start (point)) (let ((beg-re "^\\([ 	]*\\)#\\+begin_\\(\\S-+\\)[ 	]*\\(.*\\)?[\n]")) (while (re-search-forward beg-re nil t) (let* ((match-start (copy-marker (match-beginning 0))) (body-start (copy-marker (match-end 0))) (indentation (length (match-string 1))) (inner-re (format "[\n][ 	]*#\\+\\(begin\\|end\\)_%s" (regexp-quote ...))) (type (intern (downcase ...))) (headers (save-match-data (org-split-string ... "[ 	]+"))) (balanced 1) (preserve-indent (or org-src-preserve-indentation (member "-i" headers))) match-end) (while (and (not (zerop balanced)) (re-search-forward inner-re nil t)) (if (string= (downcase ...) "end") (decf balanced) (incf balanced))) (when (not (zerop balanced)) (error "unbalanced begin/end_%s blocks with %S" type (buffer-substring match-start (point)))) (setq match-end (copy-marker (match-end 0))) (unless preserve-indent (setq body (save-match-data (org-remove-indentation ...)))) (unless (memq type types) (setq types (cons type types))) (save-match-data (interblock start match-start)) (when (setq func (cadr (assoc type org-export-blocks))) (let ((replacement ...)) (when replacement (delete-region match-start match-end) (goto-char match-start) (insert replacement) (unless preserve-indent ...)))) (set-marker match-start nil) (set-marker body-start nil) (set-marker match-end nil)) (setq start (point)))) (interblock start (point-max)) (run-hooks (quote org-export-blocks-postblock-hook)))
  (let ((case-fold-search t) (types (quote nil)) matched indentation type func start end body headers preserve-indent progress-marker) (flet ((interblock (start end) (mapcar (lambda (pair) (funcall (second pair) start end)) org-export-interblocks))) (goto-char (point-min)) (setq start (point)) (let ((beg-re "^\\([ 	]*\\)#\\+begin_\\(\\S-+\\)[ 	]*\\(.*\\)?[\n]")) (while (re-search-forward beg-re nil t) (let* ((match-start (copy-marker ...)) (body-start (copy-marker ...)) (indentation (length ...)) (inner-re (format "[\n][ 	]*#\\+\\(begin\\|end\\)_%s" ...)) (type (intern ...)) (headers (save-match-data ...)) (balanced 1) (preserve-indent (or org-src-preserve-indentation ...)) match-end) (while (and (not ...) (re-search-forward inner-re nil t)) (if (string= ... "end") (decf balanced) (incf balanced))) (when (not (zerop balanced)) (error "unbalanced begin/end_%s blocks with %S" type (buffer-substring match-start ...))) (setq match-end (copy-marker (match-end 0))) (unless preserve-indent (setq body (save-match-data ...))) (unless (memq type types) (setq types (cons type types))) (save-match-data (interblock start match-start)) (when (setq func (cadr ...)) (let (...) (when replacement ... ... ... ...))) (set-marker match-start nil) (set-marker body-start nil) (set-marker match-end nil)) (setq start (point)))) (interblock start (point-max)) (run-hooks (quote org-export-blocks-postblock-hook))))
  (progn (let ((case-fold-search t) (types (quote nil)) matched indentation type func start end body headers preserve-indent progress-marker) (flet ((interblock (start end) (mapcar (lambda (pair) (funcall ... start end)) org-export-interblocks))) (goto-char (point-min)) (setq start (point)) (let ((beg-re "^\\([ 	]*\\)#\\+begin_\\(\\S-+\\)[ 	]*\\(.*\\)?[\n]")) (while (re-search-forward beg-re nil t) (let* ((match-start ...) (body-start ...) (indentation ...) (inner-re ...) (type ...) (headers ...) (balanced 1) (preserve-indent ...) match-end) (while (and ... ...) (if ... ... ...)) (when (not ...) (error "unbalanced begin/end_%s blocks with %S" type ...)) (setq match-end (copy-marker ...)) (unless preserve-indent (setq body ...)) (unless (memq type types) (setq types ...)) (save-match-data (interblock start match-start)) (when (setq func ...) (let ... ...)) (set-marker match-start nil) (set-marker body-start nil) (set-marker match-end nil)) (setq start (point)))) (interblock start (point-max)) (run-hooks (quote org-export-blocks-postblock-hook)))))
  (unwind-protect (progn (let ((case-fold-search t) (types (quote nil)) matched indentation type func start end body headers preserve-indent progress-marker) (flet ((interblock (start end) (mapcar (lambda ... ...) org-export-interblocks))) (goto-char (point-min)) (setq start (point)) (let ((beg-re "^\\([ 	]*\\)#\\+begin_\\(\\S-+\\)[ 	]*\\(.*\\)?[\n]")) (while (re-search-forward beg-re nil t) (let* (... ... ... ... ... ... ... ... match-end) (while ... ...) (when ... ...) (setq match-end ...) (unless preserve-indent ...) (unless ... ...) (save-match-data ...) (when ... ...) (set-marker match-start nil) (set-marker body-start nil) (set-marker match-end nil)) (setq start (point)))) (interblock start (point-max)) (run-hooks (quote org-export-blocks-postblock-hook))))) (set-window-configuration wconfig))
  (let ((wconfig (current-window-configuration))) (unwind-protect (progn (let ((case-fold-search t) (types (quote nil)) matched indentation type func start end body headers preserve-indent progress-marker) (flet ((interblock (start end) (mapcar ... org-export-interblocks))) (goto-char (point-min)) (setq start (point)) (let ((beg-re "^\\([ 	]*\\)#\\+begin_\\(\\S-+\\)[ 	]*\\(.*\\)?[\n]")) (while (re-search-forward beg-re nil t) (let* ... ... ... ... ... ... ... ... ... ... ...) (setq start ...))) (interblock start (point-max)) (run-hooks (quote org-export-blocks-postblock-hook))))) (set-window-configuration wconfig)))
  (save-window-excursion (let ((case-fold-search t) (types (quote nil)) matched indentation type func start end body headers preserve-indent progress-marker) (flet ((interblock (start end) (mapcar (lambda (pair) (funcall ... start end)) org-export-interblocks))) (goto-char (point-min)) (setq start (point)) (let ((beg-re "^\\([ 	]*\\)#\\+begin_\\(\\S-+\\)[ 	]*\\(.*\\)?[\n]")) (while (re-search-forward beg-re nil t) (let* ((match-start ...) (body-start ...) (indentation ...) (inner-re ...) (type ...) (headers ...) (balanced 1) (preserve-indent ...) match-end) (while (and ... ...) (if ... ... ...)) (when (not ...) (error "unbalanced begin/end_%s blocks with %S" type ...)) (setq match-end (copy-marker ...)) (unless preserve-indent (setq body ...)) (unless (memq type types) (setq types ...)) (save-match-data (interblock start match-start)) (when (setq func ...) (let ... ...)) (set-marker match-start nil) (set-marker body-start nil) (set-marker match-end nil)) (setq start (point)))) (interblock start (point-max)) (run-hooks (quote org-export-blocks-postblock-hook)))))
  org-export-blocks-preprocess()
  (progn (erase-buffer) (insert string) (setq case-fold-search t) (let ((inhibit-read-only t)) (remove-text-properties (point-min) (point-max) (quote (read-only t)))) (org-export-kill-licensed-text) (let ((org-inhibit-startup t)) (org-mode)) (setq case-fold-search t) (org-clone-local-variables source-buffer "^\\(org-\\|orgtbl-\\)") (org-install-letbind) (run-hooks (quote org-export-preprocess-hook)) (untabify (point-min) (point-max)) (org-export-handle-include-files-recurse) (run-hooks (quote org-export-preprocess-after-include-files-hook)) (org-export-remove-archived-trees archived-trees) (org-export-remove-comment-blocks-and-subtrees) (org-export-handle-export-tags (plist-get parameters :select-tags) (plist-get parameters :exclude-tags)) (run-hooks (quote org-export-preprocess-after-tree-selection-hook)) (org-export-remove-tasks (plist-get parameters :tasks)) (when (plist-get parameters :footnotes) (org-footnote-normalize nil parameters)) (org-export-mark-list-end) (org-export-preprocess-apply-macros) (run-hooks (quote org-export-preprocess-after-macros-hook)) (org-export-blocks-preprocess) (org-export-mark-list-properties) (org-export-replace-src-segments-and-examples) (org-export-protect-colon-examples) (org-export-convert-protected-spaces) (setq target-alist (org-export-define-heading-targets target-alist)) (run-hooks (quote org-export-preprocess-after-headline-targets-hook)) (org-export-remember-html-container-classes) (org-export-remove-or-extract-drawers drawers (plist-get parameters :drawers)) (when (plist-get parameters :skip-before-1st-heading) (goto-char (point-min)) (when (re-search-forward "^\\(#.*\n\\)?\\*+[ 	]" nil t) (delete-region (point-min) (match-beginning 0)) (goto-char (point-min)) (insert "\n"))) (when (plist-get parameters :add-text) (goto-char (point-min)) (insert (plist-get parameters :add-text) "\n")) (org-export-remove-headline-metadata parameters) (setq target-alist (org-export-handle-invisible-targets target-alist)) (run-hooks (quote org-export-preprocess-before-selecting-backend-code-hook)) (org-export-select-backend-specific-text) (org-export-protect-quoted-subtrees) (org-export-remove-clock-lines) (org-export-protect-verbatim) (org-export-mark-blockquote-verse-center) (run-hooks (quote org-export-preprocess-after-blockquote-hook)) (unless (plist-get parameters :timestamps) (org-export-remove-timestamps)) (setq target-alist (org-export-attach-captions-and-attributes target-alist)) (org-export-mark-radio-links) (run-hooks (quote org-export-preprocess-after-radio-targets-hook)) (org-export-concatenate-multiline-links) (run-hooks (quote org-export-preprocess-before-normalizing-links-hook)) (org-export-normalize-links) ...)
  (unwind-protect (progn (erase-buffer) (insert string) (setq case-fold-search t) (let ((inhibit-read-only t)) (remove-text-properties (point-min) (point-max) (quote (read-only t)))) (org-export-kill-licensed-text) (let ((org-inhibit-startup t)) (org-mode)) (setq case-fold-search t) (org-clone-local-variables source-buffer "^\\(org-\\|orgtbl-\\)") (org-install-letbind) (run-hooks (quote org-export-preprocess-hook)) (untabify (point-min) (point-max)) (org-export-handle-include-files-recurse) (run-hooks (quote org-export-preprocess-after-include-files-hook)) (org-export-remove-archived-trees archived-trees) (org-export-remove-comment-blocks-and-subtrees) (org-export-handle-export-tags (plist-get parameters :select-tags) (plist-get parameters :exclude-tags)) (run-hooks (quote org-export-preprocess-after-tree-selection-hook)) (org-export-remove-tasks (plist-get parameters :tasks)) (when (plist-get parameters :footnotes) (org-footnote-normalize nil parameters)) (org-export-mark-list-end) (org-export-preprocess-apply-macros) (run-hooks (quote org-export-preprocess-after-macros-hook)) (org-export-blocks-preprocess) (org-export-mark-list-properties) (org-export-replace-src-segments-and-examples) (org-export-protect-colon-examples) (org-export-convert-protected-spaces) (setq target-alist (org-export-define-heading-targets target-alist)) (run-hooks (quote org-export-preprocess-after-headline-targets-hook)) (org-export-remember-html-container-classes) (org-export-remove-or-extract-drawers drawers (plist-get parameters :drawers)) (when (plist-get parameters :skip-before-1st-heading) (goto-char (point-min)) (when (re-search-forward "^\\(#.*\n\\)?\\*+[ 	]" nil t) (delete-region (point-min) (match-beginning 0)) (goto-char (point-min)) (insert "\n"))) (when (plist-get parameters :add-text) (goto-char (point-min)) (insert (plist-get parameters :add-text) "\n")) (org-export-remove-headline-metadata parameters) (setq target-alist (org-export-handle-invisible-targets target-alist)) (run-hooks (quote org-export-preprocess-before-selecting-backend-code-hook)) (org-export-select-backend-specific-text) (org-export-protect-quoted-subtrees) (org-export-remove-clock-lines) (org-export-protect-verbatim) (org-export-mark-blockquote-verse-center) (run-hooks (quote org-export-preprocess-after-blockquote-hook)) (unless (plist-get parameters :timestamps) (org-export-remove-timestamps)) (setq target-alist (org-export-attach-captions-and-attributes target-alist)) (org-export-mark-radio-links) (run-hooks (quote org-export-preprocess-after-radio-targets-hook)) (org-export-concatenate-multiline-links) (run-hooks (quote org-export-preprocess-before-normalizing-links-hook)) (org-export-normalize-links) ...) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))
  (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (erase-buffer) (insert string) (setq case-fold-search t) (let ((inhibit-read-only t)) (remove-text-properties (point-min) (point-max) (quote (read-only t)))) (org-export-kill-licensed-text) (let ((org-inhibit-startup t)) (org-mode)) (setq case-fold-search t) (org-clone-local-variables source-buffer "^\\(org-\\|orgtbl-\\)") (org-install-letbind) (run-hooks (quote org-export-preprocess-hook)) (untabify (point-min) (point-max)) (org-export-handle-include-files-recurse) (run-hooks (quote org-export-preprocess-after-include-files-hook)) (org-export-remove-archived-trees archived-trees) (org-export-remove-comment-blocks-and-subtrees) (org-export-handle-export-tags (plist-get parameters :select-tags) (plist-get parameters :exclude-tags)) (run-hooks (quote org-export-preprocess-after-tree-selection-hook)) (org-export-remove-tasks (plist-get parameters :tasks)) (when (plist-get parameters :footnotes) (org-footnote-normalize nil parameters)) (org-export-mark-list-end) (org-export-preprocess-apply-macros) (run-hooks (quote org-export-preprocess-after-macros-hook)) (org-export-blocks-preprocess) (org-export-mark-list-properties) (org-export-replace-src-segments-and-examples) (org-export-protect-colon-examples) (org-export-convert-protected-spaces) (setq target-alist (org-export-define-heading-targets target-alist)) (run-hooks (quote org-export-preprocess-after-headline-targets-hook)) (org-export-remember-html-container-classes) (org-export-remove-or-extract-drawers drawers (plist-get parameters :drawers)) (when (plist-get parameters :skip-before-1st-heading) (goto-char (point-min)) (when (re-search-forward "^\\(#.*\n\\)?\\*+[ 	]" nil t) (delete-region (point-min) (match-beginning 0)) (goto-char (point-min)) (insert "\n"))) (when (plist-get parameters :add-text) (goto-char (point-min)) (insert (plist-get parameters :add-text) "\n")) (org-export-remove-headline-metadata parameters) (setq target-alist (org-export-handle-invisible-targets target-alist)) (run-hooks (quote org-export-preprocess-before-selecting-backend-code-hook)) (org-export-select-backend-specific-text) (org-export-protect-quoted-subtrees) (org-export-remove-clock-lines) (org-export-protect-verbatim) (org-export-mark-blockquote-verse-center) (run-hooks (quote org-export-preprocess-after-blockquote-hook)) (unless (plist-get parameters :timestamps) (org-export-remove-timestamps)) (setq target-alist (org-export-attach-captions-and-attributes target-alist)) (org-export-mark-radio-links) (run-hooks (quote org-export-preprocess-after-radio-targets-hook)) (org-export-concatenate-multiline-links) (run-hooks (quote org-export-preprocess-before-normalizing-links-hook)) (org-export-normalize-links) ...) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
  (with-current-buffer temp-buffer (unwind-protect (progn (erase-buffer) (insert string) (setq case-fold-search t) (let ((inhibit-read-only t)) (remove-text-properties (point-min) (point-max) (quote (read-only t)))) (org-export-kill-licensed-text) (let ((org-inhibit-startup t)) (org-mode)) (setq case-fold-search t) (org-clone-local-variables source-buffer "^\\(org-\\|orgtbl-\\)") (org-install-letbind) (run-hooks (quote org-export-preprocess-hook)) (untabify (point-min) (point-max)) (org-export-handle-include-files-recurse) (run-hooks (quote org-export-preprocess-after-include-files-hook)) (org-export-remove-archived-trees archived-trees) (org-export-remove-comment-blocks-and-subtrees) (org-export-handle-export-tags (plist-get parameters :select-tags) (plist-get parameters :exclude-tags)) (run-hooks (quote org-export-preprocess-after-tree-selection-hook)) (org-export-remove-tasks (plist-get parameters :tasks)) (when (plist-get parameters :footnotes) (org-footnote-normalize nil parameters)) (org-export-mark-list-end) (org-export-preprocess-apply-macros) (run-hooks (quote org-export-preprocess-after-macros-hook)) (org-export-blocks-preprocess) (org-export-mark-list-properties) (org-export-replace-src-segments-and-examples) (org-export-protect-colon-examples) (org-export-convert-protected-spaces) (setq target-alist (org-export-define-heading-targets target-alist)) (run-hooks (quote org-export-preprocess-after-headline-targets-hook)) (org-export-remember-html-container-classes) (org-export-remove-or-extract-drawers drawers (plist-get parameters :drawers)) (when (plist-get parameters :skip-before-1st-heading) (goto-char (point-min)) (when (re-search-forward "^\\(#.*\n\\)?\\*+[ 	]" nil t) (delete-region (point-min) (match-beginning 0)) (goto-char (point-min)) (insert "\n"))) (when (plist-get parameters :add-text) (goto-char (point-min)) (insert (plist-get parameters :add-text) "\n")) (org-export-remove-headline-metadata parameters) (setq target-alist (org-export-handle-invisible-targets target-alist)) (run-hooks (quote org-export-preprocess-before-selecting-backend-code-hook)) (org-export-select-backend-specific-text) (org-export-protect-quoted-subtrees) (org-export-remove-clock-lines) (org-export-protect-verbatim) (org-export-mark-blockquote-verse-center) (run-hooks (quote org-export-preprocess-after-blockquote-hook)) (unless (plist-get parameters :timestamps) (org-export-remove-timestamps)) (setq target-alist (org-export-attach-captions-and-attributes target-alist)) (org-export-mark-radio-links) (run-hooks (quote org-export-preprocess-after-radio-targets-hook)) (org-export-concatenate-multiline-links) (run-hooks (quote org-export-preprocess-before-normalizing-links-hook)) (org-export-normalize-links) ...) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
  (let ((temp-buffer (generate-new-buffer " *temp*"))) (with-current-buffer temp-buffer (unwind-protect (progn (erase-buffer) (insert string) (setq case-fold-search t) (let ((inhibit-read-only t)) (remove-text-properties (point-min) (point-max) (quote (read-only t)))) (org-export-kill-licensed-text) (let ((org-inhibit-startup t)) (org-mode)) (setq case-fold-search t) (org-clone-local-variables source-buffer "^\\(org-\\|orgtbl-\\)") (org-install-letbind) (run-hooks (quote org-export-preprocess-hook)) (untabify (point-min) (point-max)) (org-export-handle-include-files-recurse) (run-hooks (quote org-export-preprocess-after-include-files-hook)) (org-export-remove-archived-trees archived-trees) (org-export-remove-comment-blocks-and-subtrees) (org-export-handle-export-tags (plist-get parameters :select-tags) (plist-get parameters :exclude-tags)) (run-hooks (quote org-export-preprocess-after-tree-selection-hook)) (org-export-remove-tasks (plist-get parameters :tasks)) (when (plist-get parameters :footnotes) (org-footnote-normalize nil parameters)) (org-export-mark-list-end) (org-export-preprocess-apply-macros) (run-hooks (quote org-export-preprocess-after-macros-hook)) (org-export-blocks-preprocess) (org-export-mark-list-properties) (org-export-replace-src-segments-and-examples) (org-export-protect-colon-examples) (org-export-convert-protected-spaces) (setq target-alist (org-export-define-heading-targets target-alist)) (run-hooks (quote org-export-preprocess-after-headline-targets-hook)) (org-export-remember-html-container-classes) (org-export-remove-or-extract-drawers drawers (plist-get parameters :drawers)) (when (plist-get parameters :skip-before-1st-heading) (goto-char (point-min)) (when (re-search-forward "^\\(#.*\n\\)?\\*+[ 	]" nil t) (delete-region (point-min) (match-beginning 0)) (goto-char (point-min)) (insert "\n"))) (when (plist-get parameters :add-text) (goto-char (point-min)) (insert (plist-get parameters :add-text) "\n")) (org-export-remove-headline-metadata parameters) (setq target-alist (org-export-handle-invisible-targets target-alist)) (run-hooks (quote org-export-preprocess-before-selecting-backend-code-hook)) (org-export-select-backend-specific-text) (org-export-protect-quoted-subtrees) (org-export-remove-clock-lines) (org-export-protect-verbatim) (org-export-mark-blockquote-verse-center) (run-hooks (quote org-export-preprocess-after-blockquote-hook)) (unless (plist-get parameters :timestamps) (org-export-remove-timestamps)) (setq target-alist (org-export-attach-captions-and-attributes target-alist)) (org-export-mark-radio-links) (run-hooks (quote org-export-preprocess-after-radio-targets-hook)) (org-export-concatenate-multiline-links) (run-hooks (quote org-export-preprocess-before-normalizing-links-hook)) (org-export-normalize-links) ...) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))
  (with-temp-buffer (erase-buffer) (insert string) (setq case-fold-search t) (let ((inhibit-read-only t)) (remove-text-properties (point-min) (point-max) (quote (read-only t)))) (org-export-kill-licensed-text) (let ((org-inhibit-startup t)) (org-mode)) (setq case-fold-search t) (org-clone-local-variables source-buffer "^\\(org-\\|orgtbl-\\)") (org-install-letbind) (run-hooks (quote org-export-preprocess-hook)) (untabify (point-min) (point-max)) (org-export-handle-include-files-recurse) (run-hooks (quote org-export-preprocess-after-include-files-hook)) (org-export-remove-archived-trees archived-trees) (org-export-remove-comment-blocks-and-subtrees) (org-export-handle-export-tags (plist-get parameters :select-tags) (plist-get parameters :exclude-tags)) (run-hooks (quote org-export-preprocess-after-tree-selection-hook)) (org-export-remove-tasks (plist-get parameters :tasks)) (when (plist-get parameters :footnotes) (org-footnote-normalize nil parameters)) (org-export-mark-list-end) (org-export-preprocess-apply-macros) (run-hooks (quote org-export-preprocess-after-macros-hook)) (org-export-blocks-preprocess) (org-export-mark-list-properties) (org-export-replace-src-segments-and-examples) (org-export-protect-colon-examples) (org-export-convert-protected-spaces) (setq target-alist (org-export-define-heading-targets target-alist)) (run-hooks (quote org-export-preprocess-after-headline-targets-hook)) (org-export-remember-html-container-classes) (org-export-remove-or-extract-drawers drawers (plist-get parameters :drawers)) (when (plist-get parameters :skip-before-1st-heading) (goto-char (point-min)) (when (re-search-forward "^\\(#.*\n\\)?\\*+[ 	]" nil t) (delete-region (point-min) (match-beginning 0)) (goto-char (point-min)) (insert "\n"))) (when (plist-get parameters :add-text) (goto-char (point-min)) (insert (plist-get parameters :add-text) "\n")) (org-export-remove-headline-metadata parameters) (setq target-alist (org-export-handle-invisible-targets target-alist)) (run-hooks (quote org-export-preprocess-before-selecting-backend-code-hook)) (org-export-select-backend-specific-text) (org-export-protect-quoted-subtrees) (org-export-remove-clock-lines) (org-export-protect-verbatim) (org-export-mark-blockquote-verse-center) (run-hooks (quote org-export-preprocess-after-blockquote-hook)) (unless (plist-get parameters :timestamps) (org-export-remove-timestamps)) (setq target-alist (org-export-attach-captions-and-attributes target-alist)) (org-export-mark-radio-links) (run-hooks (quote org-export-preprocess-after-radio-targets-hook)) (org-export-concatenate-multiline-links) (run-hooks (quote org-export-preprocess-before-normalizing-links-hook)) (org-export-normalize-links) ...)
  (let* ((org-export-current-backend (or (plist-get parameters :for-backend) org-export-current-backend)) (archived-trees (plist-get parameters :archived-trees)) (inhibit-read-only t) (drawers org-drawers) (source-buffer (current-buffer)) target-alist rtn) (setq org-export-target-aliases nil org-export-preferred-target-alist nil org-export-id-target-alist nil org-export-code-refs nil) (with-temp-buffer (erase-buffer) (insert string) (setq case-fold-search t) (let ((inhibit-read-only t)) (remove-text-properties (point-min) (point-max) (quote (read-only t)))) (org-export-kill-licensed-text) (let ((org-inhibit-startup t)) (org-mode)) (setq case-fold-search t) (org-clone-local-variables source-buffer "^\\(org-\\|orgtbl-\\)") (org-install-letbind) (run-hooks (quote org-export-preprocess-hook)) (untabify (point-min) (point-max)) (org-export-handle-include-files-recurse) (run-hooks (quote org-export-preprocess-after-include-files-hook)) (org-export-remove-archived-trees archived-trees) (org-export-remove-comment-blocks-and-subtrees) (org-export-handle-export-tags (plist-get parameters :select-tags) (plist-get parameters :exclude-tags)) (run-hooks (quote org-export-preprocess-after-tree-selection-hook)) (org-export-remove-tasks (plist-get parameters :tasks)) (when (plist-get parameters :footnotes) (org-footnote-normalize nil parameters)) (org-export-mark-list-end) (org-export-preprocess-apply-macros) (run-hooks (quote org-export-preprocess-after-macros-hook)) (org-export-blocks-preprocess) (org-export-mark-list-properties) (org-export-replace-src-segments-and-examples) (org-export-protect-colon-examples) (org-export-convert-protected-spaces) (setq target-alist (org-export-define-heading-targets target-alist)) (run-hooks (quote org-export-preprocess-after-headline-targets-hook)) (org-export-remember-html-container-classes) (org-export-remove-or-extract-drawers drawers (plist-get parameters :drawers)) (when (plist-get parameters :skip-before-1st-heading) (goto-char (point-min)) (when (re-search-forward "^\\(#.*\n\\)?\\*+[ 	]" nil t) (delete-region (point-min) (match-beginning 0)) (goto-char (point-min)) (insert "\n"))) (when (plist-get parameters :add-text) (goto-char (point-min)) (insert (plist-get parameters :add-text) "\n")) (org-export-remove-headline-metadata parameters) (setq target-alist (org-export-handle-invisible-targets target-alist)) (run-hooks (quote org-export-preprocess-before-selecting-backend-code-hook)) (org-export-select-backend-specific-text) (org-export-protect-quoted-subtrees) (org-export-remove-clock-lines) (org-export-protect-verbatim) (org-export-mark-blockquote-verse-center) (run-hooks (quote org-export-preprocess-after-blockquote-hook)) (unless (plist-get parameters :timestamps) (org-export-remove-timestamps)) (setq target-alist (org-export-attach-captions-and-attributes target-alist)) (org-export-mark-radio-links) (run-hooks (quote org-export-preprocess-after-radio-targets-hook)) (org-export-concatenate-multiline-links) (run-hooks (quote org-export-preprocess-before-normalizing-links-hook)) (org-export-normalize-links) ...) rtn)
  org-export-preprocess-string(#("#+Title: overview of the execution of a C code block\n#+Author: Eric Schulte\n#+Style: <style type=\"text/css\">pre{background:#232323; color:#E6E1DC;}h1,h2{border-bottom-style: solid; border-bottom-color: gray;}</style>\n\nThe =org-babel-execute:C= is used to execute a block of C code.  The\nsource code of this function is presented below with inline comments\nexplaining the sequence of operations.\n\nIn actuality =org-babel-execute:C= just calls =org-babel-C-execute=,\nwhich is used to execute both C and C++ code blocks.  The evaluation\nprocess is as follows. Note: hover your mouse over references to see\nthe corresponding point in the source code -- this behavior is\ndescribed in the Org-mode [[http://orgmode.org/manual/Literal-examples.html][manual]].\n\n1. A temporary file [[(tmp-file)]] is created to hold the source code\n   present in the code block.  A language appropriate extension is\n   added [[(ext)]].\n2. Another temporary file is created [[(bin-file)]] to hold the compiled\n   binary executable.\n3. Two header arguments which are specific to C/C++ code blocks are\n   collected.\n   - =:cmdline= [[(cmdline)]] which holds a string to pass on the command\n     line to the compiled binary when it is evaluated\n   - =:flags= [[(flags)]] which holds a string of flags to pass to the\n     compiler during execution\n4. The body of the code block is expanded [[(expand)]].  Every language\n   has an expansion function which is responsible for adding variables\n   to the code block, and in some cases wrapping the code block for\n   the collection of results.\n5. To compile the code block, the expanded body is dumped into the\n   temporary sourced code file [[(src-dump)]], the compiler command is\n   generated from the compiler, src-file-name, bin-file-name and flags\n   respectively [[(cmpl)]].\n6. The resulting binary file is then evaluated [[(evaluation)]] and the\n   output is passed to an anonymous function [[(results-processing)]] as\n   the local variable named =results=.\n7. The results are then either read into a table [[(table)]] or read into\n   an elisp data structure [[(elisp)]] depending on the values of the\n   =:results= header argument.  Optional column [[(colname)]] and row\n   [[(rowname)]] names are applied again according to the corresponding\n   header arguments.\n8. Finally the processed results are handed back to the rest of the\n   code block machinery which handles the incorporation of the results\n   into the Org-mode buffer.\n\n#+begin_src emacs-lisp -n -l \"ref:%s\"\n  (defun org-babel-C-execute (body params)\n    \"This function should only be called by `org-babel-execute:C'\n  or `org-babel-execute:C++'.\"\n    (let* ((tmp-src-file (org-babel-temp-file ; ref:tmp-file\n                          \"C-src-\"\n                          (cond           ; ref:ext\n                           ((equal org-babel-c-variant 'c) \".c\")\n                           ((equal org-babel-c-variant 'cpp) \".cpp\"))))\n           (tmp-bin-file (org-babel-temp-file \"C-bin-\")) ; ref:bin-file\n           (cmdline (cdr (assoc :cmdline params)))       ; ref:cmdline\n           (flags (cdr (assoc :flags params)))           ; ref:flags\n           (full-body (org-babel-C-expand body params))  ; ref:expand\n           (compile\n            (progn\n              (with-temp-file tmp-src-file (insert full-body))  ; ref:src-dump\n              (org-babel-eval\n               (format \"%s -o %s %s %s\"   ; ref:cmpl\n                       (cond\n                        ((equal org-babel-c-variant 'c) org-babel-C-compiler)\n                        ((equal org-babel-c-variant 'cpp) org-babel-C++-compiler))\n                       (org-babel-process-file-name tmp-bin-file)\n                       (mapconcat 'identity\n                                  (if (listp flags) flags (list flags)) \" \")\n                       (org-babel-process-file-name tmp-src-file)) \"\"))))\n      ((lambda (results)                  ; ref:results-processing\n         (org-babel-reassemble-table\n          (if (member \"vector\" (cdr (assoc :result-params params)))\n              (let ((tmp-file (org-babel-temp-file \"c-\")))\n                (with-temp-file tmp-file (insert results))\n                (org-babel-import-elisp-from-file tmp-file)) ; ref:table\n            (org-babel-read results))     ; ref:elisp\n          (org-babel-pick-name            ; ref:colname\n           (cdr (assoc :colname-names params)) (cdr (assoc :colnames params)))\n          (org-babel-pick-name            ; ref:rowname\n           (cdr (assoc :rowname-names params)) (cdr (assoc :rownames params)))))\n       (org-babel-trim\n        (org-babel-eval                   ; ref:evaluation\n         (concat tmp-bin-file (if cmdline (concat \" \" cmdline) \"\")) \"\")))))\n#+end_src\n" 0 8 (fontified nil font-lock-fontified t) 8 9 (fontified nil) 9 52 (fontified nil font-lock-fontified t) 52 53 (fontified nil) 53 62 (fontified nil font-lock-fontified t) 62 63 (fontified nil) 63 75 (fontified nil font-lock-fontified t) 75 76 (fontified nil) 76 216 (fontified nil font-lock-fontified t) 216 217 (fontified nil font-lock-fontified t) 217 221 (fontified nil :org-license-to-kill t) 221 222 (fontified nil :org-license-to-kill t) 222 223 (fontified nil :org-license-to-kill t) 223 242 (fontified nil :org-license-to-kill t) 242 243 (fontified nil :org-license-to-kill t) 243 244 (fontified nil :org-license-to-kill t) 244 408 (fontified nil :org-license-to-kill t) 408 409 (fontified nil :org-license-to-kill t) 409 410 (fontified nil :org-license-to-kill t) 410 429 (fontified nil :org-license-to-kill t) 429 430 (fontified nil :org-license-to-kill t) 430 431 (fontified nil :org-license-to-kill t) 431 441 (fontified nil :org-license-to-kill t) 441 442 (fontified nil :org-license-to-kill t) 442 443 (fontified nil :org-license-to-kill t) 443 462 (fontified nil :org-license-to-kill t) 462 463 (fontified nil :org-license-to-kill t) 463 464 (fontified nil :org-license-to-kill t) 464 534 (fontified nil :org-license-to-kill t) 534 646 (fontified nil :org-license-to-kill t) 646 649 (fontified nil :org-license-to-kill t) 649 692 (fontified nil :org-license-to-kill t) 692 694 (fontified nil help-echo "LINK: http://orgmode.org/manual/Literal-examples.html" :org-license-to-kill t) 694 742 (fontified nil help-echo "LINK: http://orgmode.org/manual/Literal-examples.html" :org-license-to-kill t) 742 743 (fontified nil help-echo "LINK: http://orgmode.org/manual/Literal-examples.html" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 743 748 (fontified nil help-echo "LINK: http://orgmode.org/manual/Literal-examples.html" :org-license-to-kill t) 748 749 (fontified nil rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) help-echo "LINK: http://orgmode.org/manual/Literal-examples.html" :org-license-to-kill t) 749 750 (fontified nil help-echo "LINK: http://orgmode.org/manual/Literal-examples.html" :org-license-to-kill t) 750 751 (fontified nil help-echo "LINK: http://orgmode.org/manual/Literal-examples.html" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 751 754 (fontified nil :org-license-to-kill t) 754 756 (fontified nil :org-license-to-kill t) 756 774 (fontified nil :org-license-to-kill t) 774 775 (fontified nil help-echo "LINK: (tmp-file)" :org-license-to-kill t) 775 776 (fontified nil help-echo "LINK: (tmp-file)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 776 785 (fontified nil help-echo "LINK: (tmp-file)" :org-license-to-kill t) 785 786 (fontified nil help-echo "LINK: (tmp-file)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 786 787 (fontified nil help-echo "LINK: (tmp-file)" :org-license-to-kill t) 787 788 (fontified nil help-echo "LINK: (tmp-file)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 788 900 (fontified nil :org-license-to-kill t) 900 901 (fontified nil help-echo "LINK: (ext)" :org-license-to-kill t) 901 902 (fontified nil help-echo "LINK: (ext)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 902 906 (fontified nil help-echo "LINK: (ext)" :org-license-to-kill t) 906 907 (fontified nil help-echo "LINK: (ext)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 907 908 (fontified nil help-echo "LINK: (ext)" :org-license-to-kill t) 908 909 (fontified nil help-echo "LINK: (ext)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 909 911 (fontified nil :org-license-to-kill t) 911 913 (fontified nil :org-license-to-kill t) 913 948 (fontified nil :org-license-to-kill t) 948 949 (fontified nil help-echo "LINK: (bin-file)" :org-license-to-kill t) 949 950 (fontified nil help-echo "LINK: (bin-file)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 950 959 (fontified nil help-echo "LINK: (bin-file)" :org-license-to-kill t) 959 960 (fontified nil help-echo "LINK: (bin-file)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 960 961 (fontified nil help-echo "LINK: (bin-file)" :org-license-to-kill t) 961 962 (fontified nil help-echo "LINK: (bin-file)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 962 1006 (fontified nil :org-license-to-kill t) 1006 1008 (fontified nil :org-license-to-kill t) 1008 1074 (fontified nil :org-license-to-kill t) 1074 1091 (fontified nil :org-license-to-kill t) 1091 1092 (fontified nil :org-license-to-kill t) 1092 1093 (fontified nil :org-license-to-kill t) 1093 1094 (fontified nil :org-license-to-kill t) 1094 1102 (fontified nil :org-license-to-kill t) 1102 1103 (fontified nil :org-license-to-kill t) 1103 1104 (fontified nil :org-license-to-kill t) 1104 1105 (fontified nil help-echo "LINK: (cmdline)" :org-license-to-kill t) 1105 1106 (fontified nil help-echo "LINK: (cmdline)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 1106 1114 (fontified nil help-echo "LINK: (cmdline)" :org-license-to-kill t) 1114 1115 (fontified nil help-echo "LINK: (cmdline)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 1115 1116 (fontified nil help-echo "LINK: (cmdline)" :org-license-to-kill t) 1116 1117 (fontified nil help-echo "LINK: (cmdline)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 1117 1219 (fontified nil :org-license-to-kill t) 1219 1220 (fontified nil :org-license-to-kill t) 1220 1221 (fontified nil :org-license-to-kill t) 1221 1222 (fontified nil :org-license-to-kill t) 1222 1228 (fontified nil :org-license-to-kill t) 1228 1229 (fontified nil :org-license-to-kill t) 1229 1230 (fontified nil :org-license-to-kill t) 1230 1231 (fontified nil help-echo "LINK: (flags)" :org-license-to-kill t) 1231 1232 (fontified nil help-echo "LINK: (flags)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 1232 1238 (fontified nil help-echo "LINK: (flags)" :org-license-to-kill t) 1238 1239 (fontified nil help-echo "LINK: (flags)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 1239 1240 (fontified nil help-echo "LINK: (flags)" :org-license-to-kill t) 1240 1241 (fontified nil help-echo "LINK: (flags)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 1241 1318 (fontified nil :org-license-to-kill t) 1318 1320 (fontified nil :org-license-to-kill t) 1320 1360 (fontified nil :org-license-to-kill t) 1360 1361 (fontified nil help-echo "LINK: (expand)" :org-license-to-kill t) 1361 1362 (fontified nil help-echo "LINK: (expand)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 1362 1369 (fontified nil help-echo "LINK: (expand)" :org-license-to-kill t) 1369 1370 (fontified nil help-echo "LINK: (expand)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 1370 1371 (fontified nil help-echo "LINK: (expand)" :org-license-to-kill t) 1371 1372 (fontified nil help-echo "LINK: (expand)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 1372 1559 (fontified nil :org-license-to-kill t) 1559 1561 (fontified nil :org-license-to-kill t) 1561 1626 (fontified nil :org-license-to-kill t) 1626 1657 (fontified nil :org-license-to-kill t) 1657 1658 (fontified nil help-echo "LINK: (src-dump)" :org-license-to-kill t) 1658 1659 (fontified nil help-echo "LINK: (src-dump)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 1659 1668 (fontified nil help-echo "LINK: (src-dump)" :org-license-to-kill t) 1668 1669 (fontified nil help-echo "LINK: (src-dump)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 1669 1670 (fontified nil help-echo "LINK: (src-dump)" :org-license-to-kill t) 1670 1671 (fontified nil help-echo "LINK: (src-dump)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 1671 1784 (fontified nil :org-license-to-kill t) 1784 1785 (fontified nil help-echo "LINK: (cmpl)" :org-license-to-kill t) 1785 1786 (fontified nil help-echo "LINK: (cmpl)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 1786 1791 (fontified nil help-echo "LINK: (cmpl)" :org-license-to-kill t) 1791 1792 (fontified nil help-echo "LINK: (cmpl)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 1792 1793 (fontified nil help-echo "LINK: (cmpl)" :org-license-to-kill t) 1793 1794 (fontified nil help-echo "LINK: (cmpl)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 1794 1796 (fontified nil :org-license-to-kill t) 1796 1798 (fontified nil :org-license-to-kill t) 1798 1843 (fontified nil :org-license-to-kill t) 1843 1844 (fontified nil help-echo "LINK: (evaluation)" :org-license-to-kill t) 1844 1845 (fontified nil help-echo "LINK: (evaluation)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 1845 1856 (fontified nil help-echo "LINK: (evaluation)" :org-license-to-kill t) 1856 1857 (fontified nil help-echo "LINK: (evaluation)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 1857 1858 (fontified nil help-echo "LINK: (evaluation)" :org-license-to-kill t) 1858 1859 (fontified nil help-echo "LINK: (evaluation)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 1859 1913 (fontified nil :org-license-to-kill t) 1913 1914 (fontified nil help-echo "LINK: (results-processing)" :org-license-to-kill t) 1914 1915 (fontified nil help-echo "LINK: (results-processing)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 1915 1934 (fontified nil help-echo "LINK: (results-processing)" :org-license-to-kill t) 1934 1935 (fontified nil help-echo "LINK: (results-processing)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 1935 1936 (fontified nil help-echo "LINK: (results-processing)" :org-license-to-kill t) 1936 1937 (fontified nil help-echo "LINK: (results-processing)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 1937 1968 (fontified nil :org-license-to-kill t) 1968 1969 (fontified nil :org-license-to-kill t) 1969 1970 (fontified nil :org-license-to-kill t) 1970 1977 (fontified nil :org-license-to-kill t) 1977 1978 (fontified nil :org-license-to-kill t) 1978 1979 (fontified nil :org-license-to-kill t) 1979 1980 (fontified nil :org-license-to-kill t) 1980 1982 (fontified nil :org-license-to-kill t) 1982 2029 (fontified nil :org-license-to-kill t) 2029 2030 (fontified nil help-echo "LINK: (table)" :org-license-to-kill t) 2030 2031 (fontified nil help-echo "LINK: (table)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 2031 2037 (fontified nil help-echo "LINK: (table)" :org-license-to-kill t) 2037 2038 (fontified nil help-echo "LINK: (table)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 2038 2039 (fontified nil help-echo "LINK: (table)" :org-license-to-kill t) 2039 2040 (fontified nil help-echo "LINK: (table)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 2040 2081 (fontified nil :org-license-to-kill t) 2081 2082 (fontified nil help-echo "LINK: (elisp)" :org-license-to-kill t) 2082 2083 (fontified nil help-echo "LINK: (elisp)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 2083 2089 (fontified nil help-echo "LINK: (elisp)" :org-license-to-kill t) 2089 2090 (fontified nil help-echo "LINK: (elisp)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 2090 2091 (fontified nil help-echo "LINK: (elisp)" :org-license-to-kill t) 2091 2092 (fontified nil help-echo "LINK: (elisp)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 2092 2126 (fontified nil :org-license-to-kill t) 2126 2127 (fontified nil :org-license-to-kill t) 2127 2128 (fontified nil :org-license-to-kill t) 2128 2136 (fontified nil :org-license-to-kill t) 2136 2137 (fontified nil :org-license-to-kill t) 2137 2138 (fontified nil :org-license-to-kill t) 2138 2172 (fontified nil :org-license-to-kill t) 2172 2173 (fontified nil help-echo "LINK: (colname)" :org-license-to-kill t) 2173 2174 (fontified nil help-echo "LINK: (colname)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 2174 2182 (fontified nil help-echo "LINK: (colname)" :org-license-to-kill t) 2182 2183 (fontified nil help-echo "LINK: (colname)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 2183 2184 (fontified nil help-echo "LINK: (colname)" :org-license-to-kill t) 2184 2185 (fontified nil help-echo "LINK: (colname)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 2185 2194 (fontified nil :org-license-to-kill t) 2194 2197 (fontified nil :org-license-to-kill t) 2197 2198 (fontified nil help-echo "LINK: (rowname)" :org-license-to-kill t) 2198 2199 (fontified nil help-echo "LINK: (rowname)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 2199 2207 (fontified nil help-echo "LINK: (rowname)" :org-license-to-kill t) 2207 2208 (fontified nil help-echo "LINK: (rowname)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 2208 2209 (fontified nil help-echo "LINK: (rowname)" :org-license-to-kill t) 2209 2210 (fontified nil help-echo "LINK: (rowname)" rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo org-linked-text) :org-license-to-kill t) 2210 2287 (fontified nil :org-license-to-kill t) 2287 2289 (fontified nil :org-license-to-kill t) 2289 2456 (fontified nil :org-license-to-kill t) 2456 2463 (fontified nil font-lock-fontified t) 2463 2467 (fontified nil font-lock-fontified t) 2467 2493 (fontified nil font-lock-fontified t) 2493 2494 (fontified nil font-lock-fontified t) 2494 2497 (fontified nil font-lock-fontified t :org-license-to-kill t) 2497 2498 (fontified nil font-lock-fontified t :org-license-to-kill t) 2498 2502 (fontified nil font-lock-fontified t :org-license-to-kill t) 2502 2503 (fontified nil font-lock-fontified t :org-license-to-kill t) 2503 2504 (fontified nil font-lock-fontified t :org-license-to-kill t) 2504 2522 (fontified nil font-lock-fontified t :org-license-to-kill t) 2522 2523 (fontified nil font-lock-fontified t :org-license-to-kill t) 2523 2541 (fontified nil font-lock-fontified t :org-license-to-kill t) 2541 2542 (fontified nil font-lock-fontified t :org-license-to-kill t) 2542 2582 (fontified nil font-lock-fontified t :org-license-to-kill t) 2582 2583 (fontified nil font-lock-fontified t :org-license-to-kill t) 2583 2601 (fontified nil font-lock-fontified t :org-license-to-kill t) 2601 2602 (fontified nil font-lock-fontified t :org-license-to-kill t) 2602 2609 (fontified nil font-lock-fontified t :org-license-to-kill t) 2609 2610 (fontified nil font-lock-fontified t :org-license-to-kill t) 2610 2630 (fontified nil font-lock-fontified t :org-license-to-kill t) 2630 2631 (fontified nil font-lock-fontified t :org-license-to-kill t) 2631 2633 (fontified nil font-lock-fontified t :org-license-to-kill t) 2633 2634 (fontified nil font-lock-fontified t :org-license-to-kill t) 2634 2639 (fontified nil font-lock-fontified t :org-license-to-kill t) 2639 2640 (fontified nil font-lock-fontified t :org-license-to-kill t) 2640 2642 (fontified nil font-lock-fontified t :org-license-to-kill t) 2642 2643 (fontified nil font-lock-fontified t :org-license-to-kill t) 2643 2644 (fontified nil font-lock-fontified t :org-license-to-kill t) 2644 2680 (fontified nil font-lock-fontified t :org-license-to-kill t) 2680 2681 (fontified nil font-lock-fontified t :org-license-to-kill t) 2681 2682 (fontified nil font-lock-fontified t :org-license-to-kill t) 2682 2683 (fontified nil font-lock-fontified t :org-license-to-kill t) 2683 2695 (fontified nil font-lock-fontified t :org-license-to-kill t) 2695 2696 (fontified nil font-lock-fontified t :org-license-to-kill t) 2696 2721 (fontified nil font-lock-fontified t :org-license-to-kill t) 2721 2722 (fontified nil font-lock-fontified t :org-license-to-kill t) 2722 2729 (fontified nil font-lock-fontified t :org-license-to-kill t) 2729 2730 (fontified nil font-lock-fontified t :org-license-to-kill t) 2730 2757 (fontified nil font-lock-fontified t :org-license-to-kill t) 2757 2758 (fontified nil font-lock-fontified t :org-license-to-kill t) 2758 2761 (fontified nil font-lock-fontified t :org-license-to-kill t) 2761 2762 (fontified nil font-lock-fontified t :org-license-to-kill t) 2762 2772 (fontified nil font-lock-fontified t :org-license-to-kill t) 2772 2773 (fontified nil font-lock-fontified t :org-license-to-kill t) 2773 2774 (fontified nil font-lock-fontified t :org-license-to-kill t) 2774 2775 (fontified nil font-lock-fontified t :org-license-to-kill t) 2775 2782 (fontified nil font-lock-fontified t :org-license-to-kill t) 2782 2783 (fontified nil font-lock-fontified t :org-license-to-kill t) 2783 2841 (fontified nil font-lock-fontified t :org-license-to-kill t) 2841 2842 (fontified nil font-lock-fontified t :org-license-to-kill t) 2842 2845 (fontified nil font-lock-fontified t :org-license-to-kill t) 2845 2846 (fontified nil font-lock-fontified t :org-license-to-kill t) 2846 2908 (fontified nil font-lock-fontified t :org-license-to-kill t) 2908 2909 (fontified nil font-lock-fontified t :org-license-to-kill t) 2909 2914 (fontified nil font-lock-fontified t :org-license-to-kill t) 2914 2915 (fontified nil font-lock-fontified t :org-license-to-kill t) 2915 2965 (fontified nil font-lock-fontified t :org-license-to-kill t) 2965 2966 (fontified nil font-lock-fontified t :org-license-to-kill t) 2966 2973 (fontified nil font-lock-fontified t :org-license-to-kill t) 2973 2974 (fontified nil font-lock-fontified t :org-license-to-kill t) 2974 2976 (fontified nil font-lock-fontified t :org-license-to-kill t) 2976 2977 (fontified nil font-lock-fontified t :org-license-to-kill t) 2977 2978 (fontified nil font-lock-fontified t :org-license-to-kill t) 2978 2979 (fontified nil font-lock-fontified t :org-license-to-kill t) 2979 2991 (fontified nil font-lock-fontified t :org-license-to-kill t) 2991 2992 (fontified nil font-lock-fontified t :org-license-to-kill t) 2992 3023 (fontified nil font-lock-fontified t :org-license-to-kill t) 3023 3024 (fontified nil font-lock-fontified t :org-license-to-kill t) 3024 3031 (fontified nil font-lock-fontified t :org-license-to-kill t) 3031 3032 (fontified nil font-lock-fontified t :org-license-to-kill t) 3032 3048 (fontified nil font-lock-fontified t :org-license-to-kill t) 3048 3049 (fontified nil font-lock-fontified t :org-license-to-kill t) 3049 3050 (fontified nil font-lock-fontified t :org-license-to-kill t) 3050 3051 (fontified nil font-lock-fontified t :org-license-to-kill t) 3051 3062 (fontified nil font-lock-fontified t :org-license-to-kill t) 3062 3063 (fontified nil font-lock-fontified t :org-license-to-kill t) 3063 3092 (fontified nil font-lock-fontified t :org-license-to-kill t) 3092 3093 (fontified nil font-lock-fontified t :org-license-to-kill t) 3093 3098 (fontified nil font-lock-fontified t :org-license-to-kill t) 3098 3099 (fontified nil font-lock-fontified t :org-license-to-kill t) 3099 3119 (fontified nil font-lock-fontified t :org-license-to-kill t) 3119 3120 (fontified nil font-lock-fontified t :org-license-to-kill t) 3120 3121 (fontified nil font-lock-fontified t :org-license-to-kill t) 3121 3122 (fontified nil font-lock-fontified t :org-license-to-kill t) 3122 3131 (fontified nil font-lock-fontified t :org-license-to-kill t) 3131 3132 (fontified nil font-lock-fontified t :org-license-to-kill t) 3132 3188 (fontified nil font-lock-fontified t :org-license-to-kill t) 3188 3189 (fontified nil font-lock-fontified t :org-license-to-kill t) 3189 3190 (fontified nil font-lock-fontified t :org-license-to-kill t) 3190 3191 (fontified nil font-lock-fontified t :org-license-to-kill t) 3191 3201 (fontified nil font-lock-fontified t :org-license-to-kill t) 3201 3202 (fontified nil font-lock-fontified t :org-license-to-kill t) 3202 3234 (fontified nil font-lock-fontified t :org-license-to-kill t) 3234 3235 (fontified nil font-lock-fontified t :org-license-to-kill t) 3235 3239 (fontified nil font-lock-fontified t :org-license-to-kill t) 3239 3240 (fontified nil font-lock-fontified t :org-license-to-kill t) 3240 3255 (fontified nil font-lock-fontified t :org-license-to-kill t) 3255 3256 (fontified nil font-lock-fontified t :org-license-to-kill t) 3256 3269 (fontified nil font-lock-fontified t :org-license-to-kill t) 3269 3270 (fontified nil font-lock-fontified t :org-license-to-kill t) 3270 3304 (fontified nil font-lock-fontified t :org-license-to-kill t) 3304 3305 (fontified nil font-lock-fontified t :org-license-to-kill t) 3305 3306 (fontified nil font-lock-fontified t :org-license-to-kill t) 3306 3307 (fontified nil font-lock-fontified t :org-license-to-kill t) 3307 3319 (fontified nil font-lock-fontified t :org-license-to-kill t) 3319 3320 (fontified nil font-lock-fontified t :org-license-to-kill t) 3320 3372 (fontified nil font-lock-fontified t :org-license-to-kill t) 3372 3373 (fontified nil font-lock-fontified t :org-license-to-kill t) 3373 3388 (fontified nil font-lock-fontified t :org-license-to-kill t) 3388 3389 (fontified nil font-lock-fontified t :org-license-to-kill t) 3389 3391 (fontified nil font-lock-fontified t :org-license-to-kill t) 3391 3392 (fontified nil font-lock-fontified t :org-license-to-kill t) 3392 3393 (fontified nil font-lock-fontified t :org-license-to-kill t) 3393 3394 (fontified nil font-lock-fontified t :org-license-to-kill t) 3394 3402 (fontified nil font-lock-fontified t :org-license-to-kill t) 3402 3403 (fontified nil font-lock-fontified t :org-license-to-kill t) 3403 3426 (fontified nil font-lock-fontified t :org-license-to-kill t) 3426 3427 (fontified nil font-lock-fontified t :org-license-to-kill t) 3427 3430 (fontified nil font-lock-fontified t :org-license-to-kill t) 3430 3431 (fontified nil font-lock-fontified t :org-license-to-kill t) 3431 3587 (fontified nil font-lock-fontified t :org-license-to-kill t) 3587 3588 (fontified nil font-lock-fontified t :org-license-to-kill t) 3588 3589 (fontified nil font-lock-fontified t :org-license-to-kill t) 3589 3590 (fontified nil font-lock-fontified t :org-license-to-kill t) 3590 3591 (fontified nil font-lock-fontified t :org-license-to-kill t) 3591 3737 (fontified nil font-lock-fontified t :org-license-to-kill t) 3737 3738 (fontified nil font-lock-fontified t :org-license-to-kill t) 3738 3739 (fontified nil font-lock-fontified t :org-license-to-kill t) 3739 3740 (fontified nil font-lock-fontified t :org-license-to-kill t) 3740 3774 (fontified nil font-lock-fontified t :org-license-to-kill t) 3774 3775 (fontified nil font-lock-fontified t :org-license-to-kill t) 3775 3777 (fontified nil font-lock-fontified t :org-license-to-kill t) 3777 3778 (fontified nil font-lock-fontified t :org-license-to-kill t) 3778 3846 (fontified nil font-lock-fontified t :org-license-to-kill t) 3846 3847 (fontified nil font-lock-fontified t :org-license-to-kill t) 3847 3848 (fontified nil font-lock-fontified t :org-license-to-kill t) 3848 3849 (fontified nil font-lock-fontified t :org-license-to-kill t) 3849 3861 (fontified nil font-lock-fontified t :org-license-to-kill t) 3861 3862 (fontified nil font-lock-fontified t :org-license-to-kill t) 3862 3867 (fontified nil font-lock-fontified t :org-license-to-kill t) 3867 3868 (fontified nil font-lock-fontified t :org-license-to-kill t) 3868 3895 (fontified nil font-lock-fontified t :org-license-to-kill t) 3895 3896 (fontified nil font-lock-fontified t :org-license-to-kill t) 3896 3897 (fontified nil font-lock-fontified t :org-license-to-kill t) 3897 3898 (fontified nil font-lock-fontified t :org-license-to-kill t) 3898 3920 (fontified nil font-lock-fontified t :org-license-to-kill t) 3920 3921 (fontified nil font-lock-fontified t :org-license-to-kill t) 3921 3968 (fontified nil font-lock-fontified t :org-license-to-kill t) 3968 3969 (fontified nil font-lock-fontified t :org-license-to-kill t) 3969 3970 (fontified nil font-lock-fontified t :org-license-to-kill t) 3970 3971 (fontified nil font-lock-fontified t :org-license-to-kill t) 3971 3979 (fontified nil font-lock-fontified t :org-license-to-kill t) 3979 3980 (fontified nil font-lock-fontified t :org-license-to-kill t) 3980 3987 (fontified nil font-lock-fontified t :org-license-to-kill t) 3987 3988 (fontified nil font-lock-fontified t :org-license-to-kill t) 3988 4000 (fontified nil font-lock-fontified t :org-license-to-kill t) 4000 4001 (fontified nil font-lock-fontified t :org-license-to-kill t) 4001 4014 (fontified nil font-lock-fontified t :org-license-to-kill t) 4014 4015 (fontified nil font-lock-fontified t :org-license-to-kill t) 4015 4040 (fontified nil font-lock-fontified t :org-license-to-kill t) 4040 4041 (fontified nil font-lock-fontified t :org-license-to-kill t) 4041 4043 (fontified nil font-lock-fontified t :org-license-to-kill t) 4043 4044 (fontified nil font-lock-fontified t :org-license-to-kill t) 4044 4076 (fontified nil font-lock-fontified t :org-license-to-kill t) 4076 4077 (fontified nil font-lock-fontified t :org-license-to-kill t) 4077 4080 (fontified nil font-lock-fontified t :org-license-to-kill t) 4080 4081 (fontified nil font-lock-fontified t :org-license-to-kill t) 4081 4101 (fontified nil font-lock-fontified t :org-license-to-kill t) 4101 4102 (fontified nil font-lock-fontified t :org-license-to-kill t) 4102 4115 (fontified nil font-lock-fontified t :org-license-to-kill t) 4115 4116 (fontified nil font-lock-fontified t :org-license-to-kill t) 4116 4204 (fontified nil font-lock-fontified t :org-license-to-kill t) 4204 4205 (fontified nil font-lock-fontified t :org-license-to-kill t) 4205 4206 (fontified nil font-lock-fontified t :org-license-to-kill t) 4206 4207 (fontified nil font-lock-fontified t :org-license-to-kill t) 4207 4216 (fontified nil font-lock-fontified t :org-license-to-kill t) 4216 4217 (fontified nil font-lock-fontified t :org-license-to-kill t) 4217 4258 (fontified nil font-lock-fontified t :org-license-to-kill t) 4258 4259 (fontified nil font-lock-fontified t :org-license-to-kill t) 4259 4260 (fontified nil font-lock-fontified t :org-license-to-kill t) 4260 4261 (fontified nil font-lock-fontified t :org-license-to-kill t) 4261 4270 (fontified nil font-lock-fontified t :org-license-to-kill t) 4270 4271 (fontified nil font-lock-fontified t :org-license-to-kill t) 4271 4312 (fontified nil font-lock-fontified t :org-license-to-kill t) 4312 4313 (fontified nil font-lock-fontified t :org-license-to-kill t) 4313 4314 (fontified nil font-lock-fontified t :org-license-to-kill t) 4314 4315 (fontified nil font-lock-fontified t :org-license-to-kill t) 4315 4326 (fontified nil font-lock-fontified t :org-license-to-kill t) 4326 4327 (fontified nil font-lock-fontified t :org-license-to-kill t) 4327 4349 (fontified nil font-lock-fontified t :org-license-to-kill t) 4349 4350 (fontified nil font-lock-fontified t :org-license-to-kill t) 4350 4363 (fontified nil font-lock-fontified t :org-license-to-kill t) 4363 4364 (fontified nil font-lock-fontified t :org-license-to-kill t) 4364 4385 (fontified nil font-lock-fontified t :org-license-to-kill t) 4385 4386 (fontified nil font-lock-fontified t :org-license-to-kill t) 4386 4394 (fontified nil font-lock-fontified t :org-license-to-kill t) 4394 4395 (fontified nil font-lock-fontified t :org-license-to-kill t) 4395 4447 (fontified nil font-lock-fontified t :org-license-to-kill t) 4447 4448 (fontified nil font-lock-fontified t :org-license-to-kill t) 4448 4449 (fontified nil font-lock-fontified t :org-license-to-kill t) 4449 4450 (fontified nil font-lock-fontified t :org-license-to-kill t) 4450 4461 (fontified nil font-lock-fontified t :org-license-to-kill t) 4461 4462 (fontified nil font-lock-fontified t :org-license-to-kill t) 4462 4484 (fontified nil font-lock-fontified t :org-license-to-kill t) 4484 4485 (fontified nil font-lock-fontified t :org-license-to-kill t) 4485 4498 (fontified nil font-lock-fontified t :org-license-to-kill t) 4498 4499 (fontified nil font-lock-fontified t :org-license-to-kill t) 4499 4520 (fontified nil font-lock-fontified t :org-license-to-kill t) 4520 4521 (fontified nil font-lock-fontified t :org-license-to-kill t) 4521 4529 (fontified nil font-lock-fontified t :org-license-to-kill t) 4529 4530 (fontified nil font-lock-fontified t :org-license-to-kill t) 4530 4539 (fontified nil font-lock-fontified t :org-license-to-kill t) 4539 4540 (fontified nil font-lock-fontified t :org-license-to-kill t) 4540 4541 (fontified nil font-lock-fontified t :org-license-to-kill t) 4541 4542 (fontified nil font-lock-fontified t :org-license-to-kill t) 4542 4607 (fontified nil font-lock-fontified t :org-license-to-kill t) 4607 4608 (fontified nil font-lock-fontified t :org-license-to-kill t) 4608 4609 (fontified nil font-lock-fontified t :org-license-to-kill t) 4609 4610 (fontified nil font-lock-fontified t :org-license-to-kill t) 4610 4624 (fontified nil font-lock-fontified t :org-license-to-kill t) 4624 4625 (fontified nil font-lock-fontified t :org-license-to-kill t) 4625 4655 (fontified nil font-lock-fontified t :org-license-to-kill t) 4655 4656 (fontified nil font-lock-fontified t :org-license-to-kill t) 4656 4657 (fontified nil font-lock-fontified t :org-license-to-kill t) 4657 4658 (fontified nil font-lock-fontified t :org-license-to-kill t) 4658 4674 (fontified nil font-lock-fontified t :org-license-to-kill t) 4674 4675 (fontified nil font-lock-fontified t :org-license-to-kill t) 4675 4677 (fontified nil font-lock-fontified t :org-license-to-kill t) 4677 4678 (fontified nil font-lock-fontified t :org-license-to-kill t) 4678 4687 (fontified nil font-lock-fontified t :org-license-to-kill t) 4687 4688 (fontified nil font-lock-fontified t :org-license-to-kill t) 4688 4689 (fontified nil font-lock-fontified t :org-license-to-kill t) 4689 4690 (fontified nil font-lock-fontified t :org-license-to-kill t) 4690 4692 (fontified nil font-lock-fontified t :org-license-to-kill t) 4692 4693 (fontified nil font-lock-fontified t :org-license-to-kill t) 4693 4695 (fontified nil font-lock-fontified t :org-license-to-kill t) 4695 4699 (fontified nil font-lock-fontified t :org-license-to-kill t) 4699 4700 (fontified nil font-lock-fontified t :org-license-to-kill t) 4700 4705 (fontified nil font-lock-fontified t) 4705 4709 (fontified nil font-lock-fontified t) 4709 4710 (fontified nil rear-nonsticky t)) :emph-multiline t :for-backend latex :comments nil :tags not-in-toc :priority t :footnotes t :drawers nil :timestamps t :todo-keywords t :tasks t :add-text nil :skip-before-1st-heading nil :select-tags ("export") :exclude-tags ("noexport") :LaTeX-fragments nil)
  (let* ((wcf (current-window-configuration)) (opt-plist (org-export-process-option-filters org-export-latex-options-plist)) (region-p (org-region-active-p)) (rbeg (and region-p (region-beginning))) (rend (and region-p (region-end))) (subtree-p (if (plist-get opt-plist :ignore-subtree-p) nil (when region-p (save-excursion (goto-char rbeg) (and (org-at-heading-p) (>= ... rend)))))) (opt-plist (setq org-export-opt-plist (if subtree-p (org-export-add-subtree-options opt-plist rbeg) opt-plist))) (org-export-latex-options-plist (setq org-export-opt-plist opt-plist)) (org-current-export-dir (or pub-dir (org-export-directory :html opt-plist))) (org-current-export-file buffer-file-name) (title (or (and subtree-p (org-export-get-title-from-subtree)) (plist-get opt-plist :title) (and (not (plist-get opt-plist :skip-before-1st-heading)) (org-export-grab-title-from-buffer)) (and buffer-file-name (file-name-sans-extension (file-name-nondirectory buffer-file-name))) "No Title")) (filename (and (not to-buffer) (concat (file-name-as-directory (or pub-dir (org-export-directory :LaTeX ext-plist))) (file-name-sans-extension (or (and subtree-p ...) (file-name-nondirectory ...))) ".tex"))) (filename (and filename (if (equal (file-truename filename) (file-truename (or buffer-file-name "dummy.org"))) (concat filename ".tex") filename))) (auto-insert nil) (TeX-master t) (buffer (if to-buffer (cond ((eq to-buffer (quote string)) (get-buffer-create "*Org LaTeX Export*")) (t (get-buffer-create to-buffer))) (find-file-noselect filename))) (odd org-odd-levels-only) (header (org-export-latex-make-header title opt-plist)) (skip (cond (subtree-p nil) (region-p nil) (t (plist-get opt-plist :skip-before-1st-heading)))) (text (plist-get opt-plist :text)) (org-export-preprocess-hook (cons (\` (lambda nil (org-set-local (quote org-complex-heading-regexp) (\, org-export-latex-complex-heading-re)))) org-export-preprocess-hook)) (first-lines (if skip "" (org-export-latex-first-lines opt-plist (if subtree-p (save-excursion (goto-char rbeg) (point-at-bol 2)) rbeg) (if region-p rend)))) (coding-system (and (boundp (quote buffer-file-coding-system)) buffer-file-coding-system)) (coding-system-for-write (or org-export-latex-coding-system coding-system)) (save-buffer-coding-system (or org-export-latex-coding-system coding-system)) (region (buffer-substring (if region-p (region-beginning) (point-min)) (if region-p (region-end) (point-max)))) (text (and text (string-match "\\S-" text) (org-export-preprocess-string text :emph-multiline t :for-backend (quote latex) :comments nil :tags (plist-get opt-plist :tags) :priority (plist-get opt-plist :priority) :footnotes (plist-get opt-plist :footnotes) :drawers (plist-get opt-plist :drawers) :timestamps (plist-get opt-plist :timestamps) :todo-keywords (plist-get opt-plist :todo-keywords) :tasks (plist-get opt-plist :tasks) :add-text nil :skip-before-1st-heading skip :select-tags nil :exclude-tags nil :LaTeX-fragments nil))) (string-for-export (org-export-preprocess-string region :emph-multiline t :for-backend (quote latex) :comments nil :tags (plist-get opt-plist :tags) :priority (plist-get opt-plist :priority) :footnotes (plist-get opt-plist :footnotes) :drawers (plist-get opt-plist :drawers) :timestamps (plist-get opt-plist :timestamps) :todo-keywords (plist-get opt-plist :todo-keywords) :tasks (plist-get opt-plist :tasks) :add-text (if (eq to-buffer (quote string)) nil text) :skip-before-1st-heading skip :select-tags (plist-get opt-plist :select-tags) :exclude-tags (plist-get opt-plist :exclude-tags) :LaTeX-fragments nil))) (set-buffer buffer) (erase-buffer) (org-install-letbind) (and (fboundp (quote set-buffer-file-coding-system)) (set-buffer-file-coding-system coding-system-for-write)) (unless (or (eq to-buffer (quote string)) body-only) (insert header)) (when (and text (not (eq to-buffer (quote string)))) (insert (org-export-latex-content text (quote (lists tables fixed-width keywords))) "\n\n")) (unless (or skip (string-match "^\\*" first-lines)) (insert first-lines)) (org-export-latex-global (with-temp-buffer (insert string-for-export) (goto-char (point-min)) (when (re-search-forward "^\\(\\*+\\) " nil t) (let* ((asters (length ...)) (level (if odd ... ...))) (setq org-export-latex-add-level (if odd (1- ...) (1- asters))) (org-export-latex-parse-global level odd))))) (unless body-only (insert "\n\\end{document}")) (goto-char (point-min)) (while (re-search-forward "^[ 	]*\\\\item\\([ 	]+\\)\\[" nil t) (delete-region (match-beginning 1) (match-end 1))) (goto-char (point-min)) (when (re-search-forward "\\[TABLE-OF-CONTENTS\\]" nil t) (goto-char (point-min)) (while (re-search-forward "\\\\tableofcontents\\>[ 	]*\n?" nil t) (replace-match "")) (goto-char (point-min)) (and (re-search-forward "\\[TABLE-OF-CONTENTS\\]" nil t) (replace-match "\\tableofcontents" t t))) (goto-char (point-min)) (while (re-search-forward "^[ 	]*\\\\item\\>.*\\(\\\\\\\\\\)[ 	]*\\(\n\\\\label.*\\)*\n\\\\begin" nil t) (delete-region (match-beginning 1) (match-end 1))) (goto-char (point-min)) (while (re-search-forward "^[ 	]*\\\\item\\>.*\\(\\\\\\\\\\)[ 	]*\\(\n\\\\label.*\\)*" nil t) (if (looking-at "[\n 	]+") (replace-match "\n"))) (run-hooks (quote org-export-latex-final-hook)) (if to-buffer (unless (eq major-mode (quote latex-mode)) (latex-mode)) (save-buffer)) (org-export-latex-fix-inputenc) (run-hooks (quote org-export-latex-after-save-hook)) (goto-char (point-min)) (or (org-export-push-to-kill-ring "LaTeX") (message "Exporting to LaTeX...done")) (prog1 (if (eq to-buffer (quote string)) (prog1 (buffer-substring (point-min) (point-max)) (kill-buffer (current-buffer))) (current-buffer)) (set-window-configuration wcf)))
  org-export-as-latex(nil nil nil nil nil nil)
  (let* ((wconfig (current-window-configuration)) (lbuf (org-export-as-latex arg hidden ext-plist to-buffer body-only pub-dir)) (file (buffer-file-name lbuf)) (base (file-name-sans-extension (buffer-file-name lbuf))) (pdffile (concat base ".pdf")) (cmds (if (eq org-export-latex-listings (quote minted)) (mapcar (lambda (cmd) (replace-regexp-in-string "pdflatex " "pdflatex -shell-escape " cmd)) org-latex-to-pdf-process) org-latex-to-pdf-process)) (outbuf (get-buffer-create "*Org PDF LaTeX Output*")) (bibtex-p (with-current-buffer lbuf (save-excursion (goto-char (point-min)) (re-search-forward "\\\\bibliography{" nil t)))) cmd output-dir errors) (with-current-buffer outbuf (erase-buffer)) (message (concat "Processing LaTeX file " file "...")) (setq output-dir (file-name-directory file)) (with-current-buffer lbuf (save-excursion (if (and cmds (symbolp cmds)) (funcall cmds (shell-quote-argument file)) (while cmds (setq cmd (pop cmds)) (while (string-match "%b" cmd) (setq cmd (replace-match ... t t cmd))) (while (string-match "%f" cmd) (setq cmd (replace-match ... t t cmd))) (while (string-match "%o" cmd) (setq cmd (replace-match ... t t cmd))) (shell-command cmd outbuf))))) (message (concat "Processing LaTeX file " file "...done")) (setq errors (org-export-latex-get-error outbuf)) (if (not (file-exists-p pdffile)) (error (concat "PDF file " pdffile " was not produced" (if errors (concat ":" errors "") ""))) (set-window-configuration wconfig) (when org-export-pdf-remove-logfiles (dolist (ext org-export-pdf-logfiles) (setq file (concat base "." ext)) (and (file-exists-p file) (delete-file file)))) (message (concat "Exporting to PDF...done" (if errors (concat ", with some errors:" errors) ""))) pdffile))
  org-export-as-pdf(nil)
  (let ((pdffile (org-export-as-pdf arg))) (if pdffile (progn (org-open-file pdffile) (when org-export-kill-product-buffer-when-displayed (kill-buffer (find-buffer-visiting (concat (file-name-sans-extension ...) ".tex"))))) (error "PDF file was not produced")))
  org-export-as-pdf-and-open(nil)
  call-interactively(org-export-as-pdf-and-open)
  (if (and bg (nth 2 ass) (not (buffer-base-buffer)) (not (org-region-active-p))) (let ((p (start-process (concat "Exporting " (file-name-nondirectory (buffer-file-name))) "*Org Processes*" (expand-file-name invocation-name invocation-directory) "-batch" "-l" user-init-file "--eval" "(require 'org-exp)" "--eval" "(setq org-wait .2)" (buffer-file-name) "-f" (symbol-name (nth 1 ass))))) (set-process-sentinel p (quote org-export-process-sentinel)) (message "Background process \"%s\": started" p)) (if subtree-p (progn (org-mark-subtree) (org-activate-mark))) (call-interactively (nth 1 ass)) (when (and bpos (get-buffer-window cbuf)) (let ((cw (selected-window))) (select-window (get-buffer-window cbuf)) (goto-char cpos) (deactivate-mark) (select-window cw))))
  (let* ((bg (org-xor (equal arg (quote (16))) org-export-run-in-background)) (subtree-p (or (org-region-active-p) (eq org-export-initial-scope (quote subtree)))) (help "[t]   insert the export option template\n[v]   limit export to visible part of outline tree\n[1]   switch buffer/subtree export\n[SPC] publish enclosing subtree (with LaTeX_CLASS or EXPORT_FILE_NAME prop)\n\n[a/n/u] export as ASCII/Latin-1/UTF-8         [A/N/U] to temporary buffer\n\n[h] export as HTML      [H] to temporary buffer   [R] export region\n[b] export as HTML and open in browser\n\n[l] export as LaTeX     [L] to temporary buffer\n[p] export as LaTeX and process to PDF            [d] ... and open PDF file\n\n[D] export as DocBook   [V] export as DocBook, process to PDF, and open\n\n[o] export as OpenDocumentText                    [O] ... and open\n\n[j] export as TaskJuggler                         [J] ... and open\n\n[m] export as Freemind mind map\n[x] export as XOXO\n[g] export using Wes Hardaker's generic exporter\n\n[i] export current file as iCalendar file\n[I] export all agenda files as iCalendar files   [c] ...as one combined file\n\n[F] publish current file          [P] publish current project\n[X] publish a project...          [E] publish every projects") (cmds (quote ((116 org-insert-export-options-template nil) (118 org-export-visible nil) (97 org-export-as-ascii t) (65 org-export-as-ascii-to-buffer t) (110 org-export-as-latin1 t) (78 org-export-as-latin1-to-buffer t) (117 org-export-as-utf8 t) (85 org-export-as-utf8-to-buffer t) (104 org-export-as-html t) (98 org-export-as-html-and-open t) (72 org-export-as-html-to-buffer nil) (82 org-export-region-as-html nil) (120 org-export-as-xoxo t) (103 org-export-generic t) (68 org-export-as-docbook t) (86 org-export-as-docbook-pdf-and-open t) (111 org-export-as-odt t) (79 org-export-as-odt-and-open t) (106 org-export-as-taskjuggler t) (74 org-export-as-taskjuggler-and-open t) (109 org-export-as-freemind t) (108 org-export-as-latex t) (112 org-export-as-pdf t) (100 org-export-as-pdf-and-open t) (76 org-export-as-latex-to-buffer nil) (105 org-export-icalendar-this-file t) (73 org-export-icalendar-all-agenda-files t) (99 org-export-icalendar-combine-agenda-files t) (70 org-publish-current-file t) (80 org-publish-current-project t) (88 org-publish t) (69 org-publish-all t)))) r1 r2 ass (cpos (point)) (cbuf (current-buffer)) bpos) (save-excursion (save-window-excursion (if subtree-p (message "Export subtree: ") (message "Export buffer: ")) (delete-other-windows) (with-output-to-temp-buffer "*Org Export/Publishing Help*" (princ help)) (org-fit-window-to-buffer (get-buffer-window "*Org Export/Publishing Help*")) (while (eq (setq r1 (read-char-exclusive)) 49) (cond (subtree-p (setq subtree-p nil) (message "Export buffer: ")) ((not subtree-p) (setq subtree-p t) (setq bpos (point)) (message "Export subtree: ")))) (when (eq r1 32) (let ((case-fold-search t) (end (save-excursion ... ...))) (outline-next-heading) (if (re-search-backward "^[ 	]+\\(:latex_class:\\|:export_title:\\|:export_file_name:\\)[ 	]+\\S-" end t) (progn (org-back-to-heading t) (setq subtree-p t) (setq bpos ...) (message "Select command (for subtree): ") (setq r1 ...)) (error "No enclosing node with LaTeX_CLASS or EXPORT_TITLE or EXPORT_FILE_NAME")))))) (if (fboundp (quote redisplay)) (redisplay)) (and bpos (goto-char bpos)) (setq r2 (if (< r1 27) (+ r1 96) r1)) (unless (setq ass (assq r2 cmds)) (error "No command associated with key %c" r1)) (if (and bg (nth 2 ass) (not (buffer-base-buffer)) (not (org-region-active-p))) (let ((p (start-process (concat "Exporting " (file-name-nondirectory ...)) "*Org Processes*" (expand-file-name invocation-name invocation-directory) "-batch" "-l" user-init-file "--eval" "(require 'org-exp)" "--eval" "(setq org-wait .2)" (buffer-file-name) "-f" (symbol-name (nth 1 ass))))) (set-process-sentinel p (quote org-export-process-sentinel)) (message "Background process \"%s\": started" p)) (if subtree-p (progn (org-mark-subtree) (org-activate-mark))) (call-interactively (nth 1 ass)) (when (and bpos (get-buffer-window cbuf)) (let ((cw (selected-window))) (select-window (get-buffer-window cbuf)) (goto-char cpos) (deactivate-mark) (select-window cw)))))
  org-export(nil)
  call-interactively(org-export nil nil)
#+end_src

Best regards,
  Seb

-- 
Sebastien Vauban

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Details of compling and running C++ code from Org-mode?
  2011-11-18 19:39 ` Eric Schulte
  2011-11-18 23:07   ` [bug] " Sebastien Vauban
@ 2011-11-19 20:27   ` Michael Hannon
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Hannon @ 2011-11-19 20:27 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Org-Mode List

Nice.  Very interesting and informative.  Thanks, Eric.

-- Mike



----- Original Message -----
> From: Eric Schulte <schulte.eric@gmail.com>
> To: Michael Hannon <jm_hannon@yahoo.com>
> Cc: Org-Mode List <emacs-orgmode@gnu.org>
> Sent: Friday, November 18, 2011 11:39 AM
> Subject: Re: [O] Details of compling and running C++ code from Org-mode?
> 
> Hi Michael,
> 
> Michael Hannon <jm_hannon@yahoo.com> writes:
> 
>>  Greetings.  I'm curious about the process of executing a program that 
> is
>>  compiled from a source block in Org-mode.
>> 
>>  Some background: I was playing with some C++ code (a slight generalization 
> of
>>  some code I found in a book).  I wanted to use the "assign" 
> method to
>>  initialize a vector, as:
>> 
>>      vector<int> testVec(5, 0);
>>      testVec.assign({2, 4, 6, 8, 10});
>> 
>>  It turns out that to do this one has to tell g++ (in my case) to use the
>>  latest version of the C++ standard.  I discovered that I could do this via:
>> 
>>      (setq org-babel-C++-compiler "g++ -std=c++0x")
>> 
> 
> You could also use the :flags header argument (:flags "-std=c++0x") to
> pass this flag to g++.
> 
>> 
>>  This got me to wondering if there were any similar hooks that relate to
>>  running the program once it's compiled.  I looked through the list of
>>  org-babel* variables, but didn't find anything obvious.
>> 
>>  So what does happen when I hit C-c C-c in, say, a cpp source-code block?  
> The
>>  contents of the file are evidently written to a temporary file, after which
>>  the command specified by org-babel-C++-compiler is run on that file.  The
>>  results of the compilation are stuck some place -- another temporary file, 
> I
>>  suppose.  Then the second, executable file is run and the results
>>  collected.
> 
> Thanks for asking this question, and sorry it took so long to respond.
> I've placed an annotated copy of the relevant code up at [1] which
> should explain the evaluation process for c/c++ code.  In many cases
> browsing the relevant org-babel-execute:* function for your language is
> the best way to discover what flags are available.
> 
>> 
>>  What command runs the file?
> 
> The file itself is called directly.
> 
>>    Is there any control from Org-mode over this second stage of the
>>  process?
> 
> Yes, the :cmdline header argument may be used to pass values to the
> executing file.
> 
> Best -- Eric
> 
>> 
>>  Thanks,
>> 
>>  -- Mike
>> 
> 
> 
> Footnotes: 
> [1]  http://cs.unm.edu/~eschulte/data/babel-c-execution.html
>      http://cs.unm.edu/~eschulte/data/babel-c-execution.org
> 
> -- 
> Eric Schulte
> http://cs.unm.edu/~eschulte/
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-11-19 20:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-05  7:44 Details of compling and running C++ code from Org-mode? Michael Hannon
2011-11-18 19:39 ` Eric Schulte
2011-11-18 23:07   ` [bug] " Sebastien Vauban
2011-11-19 20:27   ` Michael Hannon

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).