From 82837535df3e0ad6edb597ae96dd5fd14abd80e6 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Fri, 27 Sep 2013 10:16:46 +0200 Subject: [PATCH 1/5] ox-publish: Update a docstring * lisp/ox-publish.el (org-publish-project-alist): Update docstring wrt recent Property drawers changes. --- lisp/ox-publish.el | 1 + 1 file changed, 1 insertion(+) diff --git a/lisp/ox-publish.el b/lisp/ox-publish.el index 906c81900..f89aa2745 100644 --- a/lisp/ox-publish.el +++ b/lisp/ox-publish.el @@ -170,6 +170,7 @@ included. See the back-end documentation for more information. :with-inlinetasks `org-export-with-inlinetasks' :with-latex `org-export-with-latex' :with-priority `org-export-with-priority' + :with-properties `org-export-with-properties' :with-smart-quotes `org-export-with-smart-quotes' :with-special-strings `org-export-with-special-strings' :with-statistics-cookies' `org-export-with-statistics-cookies' From 89f10a11fb96a2ee73145bf18d256d74063b1e9e Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Fri, 27 Sep 2013 13:34:03 +0200 Subject: [PATCH 2/5] * ob-core.el (org-babel-local-file-name): Simplify. (org-babel-process-file-name): Apply `expand-file-name' first. (org-babel-remote-temporary-directory): New defcustom. (org-babel-temp-file): Use it. --- lisp/ob-core.el | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/lisp/ob-core.el b/lisp/ob-core.el index 5a032a1f1..a7c227b24 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -2680,11 +2680,7 @@ Fixes a bug in `tramp-handle-call-process-region'." (defun org-babel-local-file-name (file) "Return the local name component of FILE." - (if (file-remote-p file) - (let (localname) - (with-parsed-tramp-file-name file nil - localname)) - file)) + (or (file-remote-p file 'localname) file)) (defun org-babel-process-file-name (name &optional no-quote-p) "Prepare NAME to be used in an external process. @@ -2694,7 +2690,10 @@ remotely. The file name is then processed by `expand-file-name'. Unless second argument NO-QUOTE-P is non-nil, the file name is additionally processed by `shell-quote-argument'" ((lambda (f) (if no-quote-p f (shell-quote-argument f))) - (expand-file-name (org-babel-local-file-name name)))) + ;; We must apply `expand-file-name' on the whole filename. If we + ;; would apply it on the local filename only, undesired effects + ;; like prepending a drive letter on MS Windows could happen. + (org-babel-local-file-name (expand-file-name name)))) (defvar org-babel-temporary-directory) (unless (or noninteractive (boundp 'org-babel-temporary-directory)) @@ -2707,6 +2706,11 @@ additionally processed by `shell-quote-argument'" Used by `org-babel-temp-file'. This directory will be removed on Emacs shutdown.")) +(defcustom org-babel-remote-temporary-directory "/tmp/" + "Directory to hold temporary files on remote hosts." + :group 'org-babel + :type 'string) + (defmacro org-babel-result-cond (result-params scalar-form &rest table-forms) "Call the code to parse raw string results according to RESULT-PARAMS." (declare (indent 1) @@ -2736,7 +2740,8 @@ of `org-babel-temporary-directory'." (if (file-remote-p default-directory) (let ((prefix (concat (file-remote-p default-directory) - (expand-file-name prefix temporary-file-directory)))) + (expand-file-name + prefix org-babel-remote-temporary-directory)))) (make-temp-file prefix nil suffix)) (let ((temporary-file-directory (or (and (boundp 'org-babel-temporary-directory) From 6f90d903e6de1ed54f0c1f19ed57d02e9327891c Mon Sep 17 00:00:00 2001 From: Eric Schulte Date: Sat, 28 Sep 2013 06:11:36 -0600 Subject: [PATCH 3/5] Revert "don't insert a padline at the top of the file" This reverts commit 6215960d99b47e2bb5141bcd97b229d9c90c4db2. --- lisp/ob-tangle.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el index 0e1614ae0..8141943ca 100644 --- a/lisp/ob-tangle.el +++ b/lisp/ob-tangle.el @@ -327,7 +327,7 @@ that the appropriate major-mode is set. SPEC has the form: (funcall insert-comment (org-fill-template org-babel-tangle-comment-format-beg link-data))) - (when (and padline (not (= (point) (point-min)))) (insert "\n")) + (when padline (insert "\n")) (insert (format "%s\n" From ae21350aaa5b3db36f02a2bd67b6d2be6dbce428 Mon Sep 17 00:00:00 2001 From: Eric Schulte Date: Sat, 28 Sep 2013 06:15:42 -0600 Subject: [PATCH 4/5] :padline insertion aware of placement in file * lisp/ob-tangle.el (org-babel-spec-to-string): Remove padline handling from here as there is insufficient information on context. (org-babel-tangle): Moved padline handling here where we can test for placement in the file. --- lisp/ob-tangle.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el index 8141943ca..63d0a4736 100644 --- a/lisp/ob-tangle.el +++ b/lisp/ob-tangle.el @@ -243,6 +243,10 @@ used to limit the exported source code blocks by language." (if (file-exists-p file-name) (insert-file-contents file-name)) (goto-char (point-max)) + ;; Handle :padlines unless first line in file + (unless (or (string= "no" (cdr (assoc :padline (nth 4 spec)))) + (= (point) (point-min))) + (insert "\n")) (insert content) (write-region nil nil file-name)))) ;; if files contain she-bangs, then make the executable @@ -307,7 +311,6 @@ that the appropriate major-mode is set. SPEC has the form: (body (nth 5 spec)) (comment (nth 6 spec)) (comments (cdr (assoc :comments (nth 4 spec)))) - (padline (not (string= "no" (cdr (assoc :padline (nth 4 spec)))))) (link-p (or (string= comments "both") (string= comments "link") (string= comments "yes") (string= comments "noweb"))) (link-data (mapcar (lambda (el) @@ -327,7 +330,6 @@ that the appropriate major-mode is set. SPEC has the form: (funcall insert-comment (org-fill-template org-babel-tangle-comment-format-beg link-data))) - (when padline (insert "\n")) (insert (format "%s\n" From 6857d139e1b5ea5c235e3555dbe15aeab227aaef Mon Sep 17 00:00:00 2001 From: Eric Schulte Date: Sat, 28 Sep 2013 06:37:54 -0600 Subject: [PATCH 5/5] set default emacs-lisp header args to nil The difference between elisp and every other language was causing confusion, so simpler just to set these to nil. * lisp/ob-emacs-lisp.el (org-babel-default-header-args:emacs-lisp): Set to nil. --- lisp/ob-emacs-lisp.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lisp/ob-emacs-lisp.el b/lisp/ob-emacs-lisp.el index 886645dc9..450512910 100644 --- a/lisp/ob-emacs-lisp.el +++ b/lisp/ob-emacs-lisp.el @@ -28,8 +28,7 @@ ;;; Code: (require 'ob) -(defvar org-babel-default-header-args:emacs-lisp - '((:hlines . "yes") (:colnames . "no")) +(defvar org-babel-default-header-args:emacs-lisp nil "Default arguments for evaluating an emacs-lisp source block.") (declare-function orgtbl-to-generic "org-table" (table params))