From e0c77f60d81f5444e158036a72e4c74f139efee3 Mon Sep 17 00:00:00 2001 From: Mikhail Titov Date: Thu, 12 May 2016 11:06:38 -0500 Subject: [PATCH] Support Emacs Org Mode based diffs We load ~/.emacs as --batch implies -q but some customization might be expected. For the same reason something like --tmpdirprefix . is necessary for .dir-locals.el to work. Finally, if on Windows and using Chocolatey, real emacs and not shim is neccesary as shim doesn't wait for process completion. path %ChocolateyInstall%\lib\emacs64\tools\emacs\bin;%PATH% --- git-latexdiff | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/git-latexdiff b/git-latexdiff index f9cffff..dac37e0 100755 --- a/git-latexdiff +++ b/git-latexdiff @@ -431,6 +431,13 @@ check_knitr () { main="${main%\.*}.tex" } +check_org () { + if test -z "$prepare_cmd"; then + prepare_cmd="emacs --batch --eval \"(load \\\"~/.emacs\\\")\" \"$main\" -f org-latex-export-to-latex --kill" + fi + main="${main%\.*}.tex" +} + log_cmd () { log=$1 shift @@ -463,6 +470,7 @@ ext=${main##*\.} case "$ext" in Rnw) check_knitr ;; Rtex) check_knitr ;; + org) check_org ;; *) ;; esac