[O] Can I export a file into another target directory by setting one variable?

2013-10-25 Thread Arne Babenhauserheide (IMK)
Hi,

For my autotools setup, I need a way to export org-mode files into a
different directory (for make distcheck). Currently I do that by copying
all dependencies into the output directory, building the result and then
killing the dependencies again - which is a horrible clutch (but works).¹

Is there a way to simply set a variable in emacs which is then used as
the output-directory?

Then I could call emacs with

echo yes | @emacs@ --batch --load ~/.emacs --visit $(notdir $)
--eval (setq variable $VPATH) --funcall org-beamer-export-to-pdf

I tried this hint from 2012 (#+bind: ...),
http://lists.gnu.org/archive/html/emacs-orgmode/2012-03/msg00272.html
but it does not seem to work anymore.

#+bind: org-export-publishing-directory ./exports

¹: http://draketo.de/light/english/free-software/makefile-to-autotools#sec-4

Best wishes,
Arne
-- 
Doktorand
Gruppe: GHG

Raum: 435/410
Tel.: +49 721 608-22885
arne.babenhauserhe...@kit.edu

Karlsruher Institut für Technologie
IMK-ASF
Postfach 36 40
76021 Karlsruhe


0xA70DA09E.asc
Description: application/pgp-keys
attachment: arne_babenhauserheide.vcf

signature.asc
Description: OpenPGP digital signature


Re: [O] Bug: startup: hidestars does not use the real window background color [7.8.11]

2012-09-18 Thread Arne Babenhauserheide (IMK)
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Bastien,

That’s great, thanks!

Best wishes,
Arne

Am 18.09.2012 12:25, schrieb Bastien:
 Hi Arne,
 
 Arne Babenhauserheide (IMK) arne.babenhauserhe...@kit.edu
 writes:
 
 Dear org Hackers,
 
 I use a custom color scheme in KDE with brown window background
 color, and when I activate #+STARTUP: hidestars, the first stars
 are white instead of brown.
 
 My color scheme is Antiford ?
 http://opendesktop.org/content/show.php/Antiford?content=142571
 
 This is now fixed: the `org-hide' face is a bit more clever when
 trying the get the background color.
 
 Thanks,
 

-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJQWHIBAAoJEFyD82SnDaCeb+0IAKOflOrD/pzUJarzVLTzwYPx
SBIy3oLtYgjQ1NTgBo2jWgi3goElps5JIMDGL1ZZmdm5RHi+bpPBReJJvUq4Hm04
5zstB0YCwC+LTRb+xfHX2kXdISugjuO+dDfCsdWE2G9Hcrt48bmtZRAWG62ge4iV
tWlsNZjy41j/FBPlYbXdMHrIeHYbrn/N5To2PniCR59he5JEOPdlpL4vqTg8ZrkW
kv7Pjwt4x7pofiJ2MfWQeQ3dCG+YhDe07B2HQU+F0whaCRvt0eLBWPEIfwFw44gH
p15O6FzlGnwlm1DrgcVzT+5r5Pi7E0iT974OBcs2rgg3ofwBYQ3s8KK6STrwywM=
=lX36
-END PGP SIGNATURE-



Re: [O] babel for ditaa-eps

2012-09-13 Thread Arne Babenhauserheide (IMK)
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Eric,

It’s much easier to answer, what this does not share with ob-ditaa.el :)

If I cut out the obvious renaming (to be able to use a ditaa-exp
source type), it’s just this diff (and the first half of that only
defines variables…):

- --- /usr/share/emacs/site-lisp/org-mode/ob-ditaa.el   2012-05-25
23:12:51.0 +0200
+++ ob-ditaa-eps.el 2012-09-12 15:37:50.942191587 +0200
@@ -44,6 +47,20 @@

- -(defvar org-ditaa-jar-path)
- -(defun org-babel-execute:ditaa (body params)
+(defcustom org-ditaa-eps-jar-path (expand-file-name
+   DitaaEps.jar
+   (file-name-as-directory
+(expand-file-name
+ scripts
+ (file-name-as-directory
+  (expand-file-name
+   ../contrib
+   (file-name-directory (find-library-name 
org)))
+  Path to the ditaa-eps jar executable.
+  :group 'org-babel
+  :type 'string)
+
+
+(defvar org-ditaa-eps-jar-path)
+(defun org-babel-execute:ditaa-eps (body params)
   Execute a block of Ditaa code with org-babel.
 This function is called by `org-babel-execute-src-block'.
   (let* ((result-params (split-string (or (cdr (assoc :results
params)) )))
@@ -55,14 +72,18 @@
 (cmdline (cdr (assoc :cmdline params)))
 (java (cdr (assoc :java params)))
 (in-file (org-babel-temp-file ditaa-))
- -  (cmd (concat java  java  -jar 
+(cmd0 (concat java  java  -jar 
  (shell-quote-argument
- -(expand-file-name org-ditaa-jar-path))
+  (expand-file-name org-ditaa-eps-jar-path))
cmdline
(org-babel-process-file-name in-file)
- - (org-babel-process-file-name out-file
- -(unless (file-exists-p org-ditaa-jar-path)
- -  (error Could not find ditaa.jar at %s org-ditaa-jar-path))
+   (org-babel-process-file-name (concat in-file 
.eps
+(cmd1 (concat epstopdf
+   (org-babel-process-file-name (concat in-file .eps))
+  -o= (org-babel-process-file-name out-file
+(unless (file-exists-p org-ditaa-eps-jar-path)
+  (error Could not find ditaa.jar at %s org-ditaa-eps-jar-path))
 (with-temp-file in-file (insert body))
- -(message cmd) (shell-command cmd)
+(message cmd0) (shell-command cmd0)
+(message cmd1) (shell-command cmd1)
 nil)) ;; signal that output has already been written to file


Best wishes,
Arne

Am 13.09.2012 07:16, schrieb Eric Schulte:
 It sounds like there is a good deal of desire for this
 functionality. How much code does this file share with ob-ditaa?
 If it is a large percentage perhaps it would be possible to instead
 add a new header argument to ditaa code blocks to run ditaa-eps.
 Some code blocks (e.g., sql) already have an :engine header
 argument which may be used to change the back-end tool which
 executes the block.
 
 Thanks for sharing!
 
 Arne Babenhauserheide (IMK) arne.babenhauserhe...@kit.edu
 writes:
 
 Dear org hackers,
 
 I don’t know if there’s already a babel-ditaa-option for using 
 ditaa-eps, so I modified ob-ditaa.el to use ditaa-eps and convert
 the result using epstopdf.
 
 Feel free to use it.
 
 ;;; ob-ditaa-eps.el --- org-babel functions for ditaa evaluation
 
 ;; Copyright (C) 2009-2012  Free Software Foundation, Inc.
 
 ;; Author: Eric Schulte und Arne Babenhauserheide ;; Keywords:
 literate programming, reproducible research ;; Homepage:
 http://orgmode.org
 
 ;; This file is part of GNU Emacs.
 
 ;; GNU Emacs is free software: you can redistribute it and/or
 modify ;; it under the terms of the GNU General Public License as
 published by ;; the Free Software Foundation, either version 3 of
 the License, or ;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful, 
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty
 of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
 the ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public
 License ;; along with GNU Emacs.  If not, see
 http://www.gnu.org/licenses/.
 
 ;;; Commentary:
 
 ;; Org-Babel support for evaluating ditaa source code as
 eps/pdf. ;; ;; Almost verbatim copy from ob-ditaa, but with
 ditaa-eps and epstopdf ;; as intermediate step. ;; ;; Ditaa
 differs from most standard languages in that ;; ;; 1) there is no
 such thing as a session in ditaa ;; ;; 2) we are generally only
 going to return results of type file ;; ;; 3) we are adding the
 file and cmdline header arguments ;; ;; 4) there are no
 variables (at least for now)
 
 ;;; Code: (require 'ob)
 
 (defvar org-babel-default-header-args:ditaa-eps '((:results .
 file) (:exports . results) (:java

[O] Bug: org-preview-latex-fragment does not work with pygmentize (-shell-escape missing) [with patch] [7.8.11]

2012-09-12 Thread Arne Babenhauserheide (IMK)
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

 http://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org-mode mailing list.
- 

Dear org hackers,

When using the minted package, latex requires the -shell-escape argument
to call pygmentize. Due to this, org-preview-latex-fragment fails for me
(used via C-c C-x C-l).

If I change the function org-create-formula-image to call latex with
- -shell-escape, it works for me.

In MikTex --enable-write18 should do the same.

Note, though, that -shell-escape is disabled for security
reasons, since it can call arbitrary code (
http://scrolls.mafgani.net/2011/03/latex-shell-escape/ )

The reason why texmf does not activate shell-escape for pygmentize by
default is

% pygmentize - but is the filter feature insecure?
? /etc/texmf/web2c/texmf.cnf
? info: http://pygments.org/docs/filters/

I think the best solution would be to check pygmentize, maybe define a
subset of the functionality (without the filters) and get it into
the shell_escape_commands (setting it myself did not work for me?).

But since that is not readily accessible, I adapted the preview function
instead:

diff -u /usr/share/emacs/site-lisp/org-mode/org.el /home/arne/org.el.new
- --- /usr/share/emacs/site-lisp/org-mode/org.el2012-05-25
23:12:51.0 +0200
+++ /home/arne/org.el.new   2012-09-12 09:37:00.788632982 +0200
@@ -17075,7 +17075,7 @@
   (condition-case nil
  (progn
(cd tmpdir)
- - (call-process latex nil nil nil texfile))
+   (call-process latex nil nil nil -shell-escape texfile))
(error nil))
   (cd dir))
 (if (not (file-exists-p dvifile))

Best wishes,
Arne

Emacs  : GNU Emacs 23.4.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.10)
 of 2012-07-10 on imkpcghg
Package: Org-mode version 7.8.11

current state:
==
(setq
 org-ditaa-jar-path ~/.emacs.d/private/org/ditaa0_9/ditaa0_9.jar
 org-export-latex-after-initial-vars-hook '(org-beamer-after-initial-vars)
 org-export-latex-listings 'minted
 org-speed-command-hook '(org-speed-command-default-hook
org-babel-speed-command-hook)
 org-agenda-custom-commands '((o Agenda and TODOs
   ((tags KANBAN) (agenda nil) (todo 
~/plan.org)))
  )
 org-agenda-files '(~/plan.org)
 org-agenda-include-diary t
 org-babel-load-languages '((python . t) (sh . t) (emacs-lisp . t)
(ditaa . t) (dot . t)
(C . t) (R . t) (gnuplot . t) (org . t))
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-babel-tangle-lang-exts '((C++ . cpp) (python . py)
(emacs-lisp . el))
 org-export-latex-format-toc-function 'org-export-latex-format-toc-default
 org-agenda-skip-scheduled-if-done t
 org-latex-to-pdf-process '(pdflatex -interaction nonstopmode
- -shell-escape -output-directory %o %f bibtex $(basename %b)
pdflatex -interaction nonstopmode -shell-escape -output-directory %o
%f pdflatex -interaction nonstopmode -shell-escape -output-directory
%o %f)
 org-tab-first-hook '(org-hide-block-toggle-maybe
org-src-native-tab-command-maybe
  org-babel-hide-result-toggle-maybe)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
org-src-mode-configure-edit-buffer)
 org-confirm-shell-link-function 'yes-or-no-p
 org-export-first-hook '(org-beamer-initialize-open-trackers)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-export-latex-packages-alist '(( color) ( minted))
 org-default-notes-file ~/.emacs.d/private/org/emacs-remember-mode.org
 org-directory ~/.emacs.d/private/org
 outline-mode-hook '((lambda nil (require (quote outline-magic
 org-babel-pre-tangle-hook '(save-buffer)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
  org-cycle-show-empty-lines
org-optimize-window-after-visibility-change)
 org-export-latex-classes '((article \\documentclass[11pt]{scrartcl}
 (\\section{%s} . \\section*{%s})
 (\\subsection{%s} . \\subsection*{%s})
 (\\subsubsection{%s} .
\\subsubsection*{%s})
 (\\paragraph{%s} . \\paragraph*{%s})
 (\\subparagraph{%s} .
\\subparagraph*{%s}))
(report \\documentclass[11pt]{scrreprt}
 (\\part{%s} . \\part*{%s})
 (\\chapter{%s} . \\chapter*{%s})
 (\\section{%s} . \\section*{%s})
 (\\subsection{%s} . \\subsection*{%s})
 (\\subsubsection{%s} .
\\subsubsection*{%s})
 

[O] babel for ditaa-eps

2012-09-12 Thread Arne Babenhauserheide (IMK)
Dear org hackers,

I don’t know if there’s already a babel-ditaa-option for using
ditaa-eps, so I modified ob-ditaa.el to use ditaa-eps and convert the
result using epstopdf.

Feel free to use it.

;;; ob-ditaa-eps.el --- org-babel functions for ditaa evaluation

;; Copyright (C) 2009-2012  Free Software Foundation, Inc.

;; Author: Eric Schulte und Arne Babenhauserheide
;; Keywords: literate programming, reproducible research
;; Homepage: http://orgmode.org

;; This file is part of GNU Emacs.

;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs.  If not, see http://www.gnu.org/licenses/.

;;; Commentary:

;; Org-Babel support for evaluating ditaa source code as eps/pdf.
;;
;; Almost verbatim copy from ob-ditaa, but with ditaa-eps and epstopdf
;; as intermediate step.
;;
;; Ditaa differs from most standard languages in that
;;
;; 1) there is no such thing as a session in ditaa
;;
;; 2) we are generally only going to return results of type file
;;
;; 3) we are adding the file and cmdline header arguments
;;
;; 4) there are no variables (at least for now)

;;; Code:
(require 'ob)

(defvar org-babel-default-header-args:ditaa-eps
  '((:results . file) (:exports . results) (:java .
-Dfile.encoding=UTF-8))
  Default arguments for evaluating a ditaa source block.)

(defcustom org-ditaa-eps-jar-path (expand-file-name
DitaaEps.jar
(file-name-as-directory
 (expand-file-name
  scripts
  (file-name-as-directory
   (expand-file-name
../contrib
(file-name-directory (find-library-name 
org)))
  Path to the ditaa-eps jar executable.
  :group 'org-babel
  :type 'string)


(defvar org-ditaa-eps-jar-path)
(defun org-babel-execute:ditaa-eps (body params)
  Execute a block of Ditaa code with org-babel.
This function is called by `org-babel-execute-src-block'.
  (let* ((result-params (split-string (or (cdr (assoc :results params))
)))
 (out-file ((lambda (el)
  (or el
  (error
   ditaa code block requires :file header argument)))
(cdr (assoc :file params
 (cmdline (cdr (assoc :cmdline params)))
 (java (cdr (assoc :java params)))
 (in-file (org-babel-temp-file ditaa-))
 (cmd0 (concat java  java  -jar 
  (shell-quote-argument
   (expand-file-name org-ditaa-eps-jar-path))
cmdline
(org-babel-process-file-name in-file)
(org-babel-process-file-name (concat in-file 
.eps
 (cmd1 (concat epstopdf
(org-babel-process-file-name (concat in-file .eps))
   -o= (org-babel-process-file-name out-file
(unless (file-exists-p org-ditaa-eps-jar-path)
  (error Could not find ditaa.jar at %s org-ditaa-eps-jar-path))
(with-temp-file in-file (insert body))
(message cmd0) (shell-command cmd0)
(message cmd1) (shell-command cmd1)
nil)) ;; signal that output has already been written to file

(defun org-babel-prep-session:ditaa-eps (session params)
  Return an error because ditaa does not support sessions.
  (error Ditaa does not support sessions))

(defun ditaa-eps-mode ()
  (artist-mode))

(provide 'ob-ditaa-eps)

;;; ob-ditaa-eps.el ends here

Best wishes,
Arne
;;; ob-ditaa-eps.el --- org-babel functions for ditaa evaluation

;; Copyright (C) 2009-2012  Free Software Foundation, Inc.

;; Author: Eric Schulte und Arne Babenhauserheide
;; Keywords: literate programming, reproducible research
;; Homepage: http://orgmode.org

;; This file is part of GNU Emacs.

;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs.  If not, see http://www.gnu.org/licenses/.


[O] Bug: startup: hidestars does not use the real window background color [7.8.11]

2012-09-04 Thread Arne Babenhauserheide (IMK)
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

 http://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org-mode mailing list.
- 

Dear org Hackers,

I use a custom color scheme in KDE with brown window background color,
and when I activate #+STARTUP: hidestars, the first stars are white
instead of brown.

My color scheme is Antiford
? http://opendesktop.org/content/show.php/Antiford?content=142571

Best wishes,
Arne



Emacs  : GNU Emacs 23.4.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.10)
 of 2012-07-10 on 
Package: Org-mode version 7.8.11

current state:
==
(setq
 org-ditaa-jar-path ~/.emacs.d/private/org/ditaa0_9/ditaa0_9.jar
 org-export-latex-after-initial-vars-hook '(org-beamer-after-initial-vars)
 org-export-latex-listings 'minted
 org-speed-command-hook '(org-speed-command-default-hook
org-babel-speed-command-hook)
 org-agenda-custom-commands '((o Agenda and TODOs ((tags KANBAN)
(agenda nil) (todo  ~/plan.org
 org-agenda-files '(~/plan.org)
 org-agenda-include-diary t
 org-babel-load-languages '((python . t) (sh . t) (emacs-lisp . t)
(ditaa . t) (dot . t) (C . t) (R . t) (gnuplot . t)
(org . t))
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-babel-tangle-lang-exts '((C++ . cpp) (python . py)
(emacs-lisp . el))
 org-export-latex-format-toc-function 'org-export-latex-format-toc-default
 org-agenda-skip-scheduled-if-done t
 org-latex-to-pdf-process '(pdflatex -interaction nonstopmode
- -shell-escape -output-directory %o %f bibtex $(basename %b)
pdflatex -interaction nonstopmode
- -shell-escape -output-directory %o %f
pdflatex -interaction nonstopmode
- -shell-escape -output-directory %o %f)
 org-tab-first-hook '(org-hide-block-toggle-maybe
org-src-native-tab-command-maybe org-babel-hide-result-toggle-maybe)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
org-src-mode-configure-edit-buffer)
 org-confirm-shell-link-function 'yes-or-no-p
 org-export-first-hook '(org-beamer-initialize-open-trackers)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-export-latex-packages-alist '(( color) ( minted))
 org-default-notes-file ~/.emacs.d/private/org/emacs-remember-mode.org
 org-directory ~/.emacs.d/private/org
 outline-mode-hook '((lambda nil (require (quote outline-magic
 org-babel-pre-tangle-hook '(save-buffer)
 org-cycle-hook '(org-cycle-hide-archived-subtrees
org-cycle-hide-drawers org-cycle-show-empty-lines
  org-optimize-window-after-visibility-change)
 org-export-latex-classes '((article
\\documentclass[11pt]{scrartcl} (\\section{%s} . \\section*{%s})
 (\\subsection{%s} .
\\subsection*{%s}) (\\subsubsection{%s} . \\subsubsection*{%s})
 (\\paragraph{%s} . \\paragraph*{%s})
(\\subparagraph{%s} . \\subparagraph*{%s}))
(report
\\documentclass[11pt]{scrreprt} (\\part{%s} . \\part*{%s})
 (\\chapter{%s} . \\chapter*{%s})
(\\section{%s} . \\section*{%s})
 (\\subsection{%s} .
\\subsection*{%s}) (\\subsubsection{%s} . \\subsubsection*{%s})
 (\\paragraph{%s} . \\paragraph*{%s})
(\\subparagraph{%s} . \\subparagraph*{%s}))
(book \\documentclass[11pt]{scrbook}
(\\part{%s} . \\part*{%s})
 (\\chapter{%s} . \\chapter*{%s})
(\\section{%s} . \\section*{%s})
 (\\subsection{%s} .
\\subsection*{%s}) (\\subsubsection{%s} . \\subsubsection*{%s}))
(beamer \\documentclass{beamer}
org-beamer-sectioning))
 org-export-preprocess-before-normalizing-links-hook
'(org-remove-file-link-modifiers)
 org-mode-hook '(org-mode-reftex-setup turn-on-font-lock
 #[nil \300\301\302\303\304$\207 [org-add-hook
change-major-mode-hook org-show-block-all append local] 5]
 #[nil \300\301\302\303\304$\207 [org-add-hook
change-major-mode-hook org-babel-show-result-all append local]
   5]
 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-extend-today-until 4
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point
org-babel-execute-safely-maybe)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-agenda-start-on-weekday nil
 org-export-interblocks '((src org-babel-exp-non-block-elements))
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-agenda-skip-deadline-if-done t
 org-occur-hook '(org-first-headline-recenter)
 org-from-is-user-regexp nil
 org-export-preprocess-before-selecting-backend-code-hook
'(org-beamer-select-beamer-code)