;; -*- coding: undecided-unix; -*- (with-temp-buffer (when org-export-async-debug '(setq debug-on-error t)) (setq kill-emacs-hook nil org-babel-confirm-evaluate-answer-no t) (require 'ox) (funcall (lambda nil (let ((inhibit-modification-hooks t)) (let ((org-mode-hook nil) (org-inhibit-startup t)) (org-mode)) (set (make-local-variable 'org-target-link-regexp) 'nil) (set (make-local-variable 'org-macro-templates) '(("date" . "") ("title" . "Foo Bar") ("email" . "") ("author" . "") ("input-file" . "foo.org") ("modification-time" . "(eval (format-time-string $1 (or (and (org-string-nw-p $2) (org-macro--vc-modified-time \"/home/mohkale/foo.org\")) '(24755 48598 358268 200000))))") ("n" . "(eval (org-macro--counter-increment $1 $2))") ("keyword" . "(eval (org-macro--find-keyword-value $1))") ("time" . "(eval (format-time-string $1))") ("property" . "(eval (org-macro--get-property $1 $2))"))) (set (make-local-variable 'org-table-may-need-update) 't) (set (make-local-variable 'org-latex-and-related-regexp) '"") (set (make-local-variable 'org-todo-line-tags-regexp) '"^\\(\\*+\\)\\(?: +\\(DONE\\|TODO\\)\\)?\\(?: +\\(.*?\\)\\)??\\(?:[ ]+\\(:[[:alnum:]:_@#%]+:\\)\\)?[ ]*$") (set (make-local-variable 'org-complex-heading-regexp-format) '"^\\(\\*+\\)\\(?: +\\(DONE\\|TODO\\)\\)?\\(?: +\\(\\[#.\\]\\)\\)?\\(?: +\\(?:\\[[0-9%%/]+\\] *\\)*\\(%s\\)\\(?: *\\[[0-9%%/]+\\]\\)*\\)\\(?:[ ]+\\(:[[:alnum:]_@#%%:]+:\\)\\)?[ ]*$") (set (make-local-variable 'org-complex-heading-regexp) '"^\\(\\*+\\)\\(?: +\\(DONE\\|TODO\\)\\)?\\(?: +\\(\\[#.\\]\\)\\)?\\(?: +\\(.*?\\)\\)??\\(?:[ ]+\\(:[[:alnum:]_@#%:]+:\\)\\)?[ ]*$") (set (make-local-variable 'org-todo-line-regexp) '"^\\(\\*+\\)\\(?: +\\(DONE\\|TODO\\)\\)?\\(?: +\\(.*?\\)\\)?[ ]*$") (set (make-local-variable 'org-not-done-heading-regexp) '"^\\(\\*+\\)\\(?: +\\(TODO\\)\\)\\(?: +\\(.*?\\)\\)?[ ]*$") (set (make-local-variable 'org-not-done-regexp) '"\\(TODO\\)") (set (make-local-variable 'org-todo-regexp) '"\\(DONE\\|TODO\\)") (set (make-local-variable 'org-not-done-keywords) '("TODO")) (set (make-local-variable 'org-todo-log-states) 'nil) (set (make-local-variable 'org-todo-sets) '(("TODO" "DONE"))) (set (make-local-variable 'org-todo-heads) '("TODO")) (set (make-local-variable 'org-done-keywords) '("DONE")) (set (make-local-variable 'org-todo-keywords-1) '("TODO" "DONE")) (set (make-local-variable 'org-todo-key-trigger) 'nil) (set (make-local-variable 'org-todo-key-alist) '((:startgroup) ("TODO" . 116) ("DONE" . 100) (:endgroup))) (set (make-local-variable 'org-todo-kwd-alist) '(("TODO" sequence "TODO" "DONE" "DONE") ("DONE" sequence "TODO" "DONE" "DONE"))) (set (make-local-variable 'org-table-formula-constants-local) 'nil) (set (make-local-variable 'org-keyword-properties) 'nil) (set (make-local-variable 'org-tag-groups-alist) 'nil) (set (make-local-variable 'org-current-tag-alist) 'nil) (set (make-local-variable 'org-file-tags) 'nil) (set (make-local-variable 'buffer-file-name) '"/home/mohkale/foo.org") (set (make-local-variable 'default-directory) '"/home/mohkale/") (set (make-local-variable 'buffer-file-coding-system) 'undecided-unix) (insert #("#+TITLE: Foo Bar Hello world can you believe it buddy. " 0 8 (fontified t font-lock-fontified t face org-document-info-keyword) 8 9 (fontified t) 9 17 (fontified t font-lock-fontified t face org-document-title) 17 56 (fontified t))) (narrow-to-region 1 57) (goto-char 19)))) (restore-buffer-modified-p nil) (print (progn (let ((output (org-export-as 'latex nil nil nil '(:output-file "foo.tex")))) (with-temp-buffer (insert output) (let ((coding-system-for-write 'undecided-unix)) (write-file "foo.tex"))) (or (ignore-errors (funcall '# "foo.tex")) "foo.tex")))))