From 57838f82867b18b4027385216ce74bb40e9a3c2c Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Fri, 17 Jul 2009 19:02:01 +0200 Subject: [PATCH] Fixed premature deletion of data when scripting org-plot. This patch was sent by James TD Smith. --- lisp/ChangeLog | 3 +++ lisp/org-plot.el | 2 +- lisp/org.el | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 22f21aa30..fb26fbd5a 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -3,6 +3,9 @@ * org.el (org-tags-sort-function): New option for sorting tags. (org-set-tags): Use the new option to sort tags. + * org-plot.el (org-plot/gnuplot): Run with an idle timer to avoid + premature deletion of the data when using org-plot in a script. + 2009-07-17 Bastien Guerry * org-clock.el (org-clock-in-prepare-hook): New hook. diff --git a/lisp/org-plot.el b/lisp/org-plot.el index 0e8f5a2e6..3bcc928cc 100644 --- a/lisp/org-plot.el +++ b/lisp/org-plot.el @@ -346,7 +346,7 @@ line directly before or after the table." (gnuplot-send-buffer-to-gnuplot)) ;; cleanup (bury-buffer (get-buffer "*gnuplot*")) - (delete-file data-file)))) + (run-with-idle-timer 0.1 nil (lambda () (delete-file data-file)))))) (provide 'org-plot) diff --git a/lisp/org.el b/lisp/org.el index 426f89020..af9ce5a11 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -10849,9 +10849,9 @@ With prefix ARG, realign all tags in headings in the current buffer." (setq tags (replace-match ":" t t tags)))) (if org-tags-sort-function - (setq tags (mapconcat 'identity - (sort (org-split-string tags (org-re "[^[:alnum:]_@]+")) - org-tags-sort-function) ":"))) + (setq tags (mapconcat 'identity + (sort (org-split-string tags (org-re "[^[:alnum:]_@]+")) + org-tags-sort-function) ":"))) (if (string-match "\\`[\t ]*\\'" tags) (setq tags "") -- 2.11.4.GIT