From be72bf875a9abd64869f1c0bd1c6ad50fa93e514 Mon Sep 17 00:00:00 2001 From: Mario Frasca Date: Sun, 2 Nov 2014 08:53:27 -0500 Subject: [PATCH 2/2] correct the callback for the and register it as soon as possible. --- lisp/org-plot.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/org-plot.el b/lisp/org-plot.el index 69d9250..faa34fc 100644 --- a/lisp/org-plot.el +++ b/lisp/org-plot.el @@ -294,6 +294,7 @@ line directly before or after the table." (table (org-table-to-lisp)) (num-cols (length (if (eq (first table) 'hline) (second table) (first table))))) + (run-with-idle-timer 0.1 nil #'delete-file data-file) (while (equal 'hline (first table)) (setf table (cdr table))) (when (equal (second table) 'hline) (setf params (plist-put params :labels (first table))) ;; headers to labels @@ -344,8 +345,7 @@ line directly before or after the table." (gnuplot-mode) (gnuplot-send-buffer-to-gnuplot)) ;; cleanup - (bury-buffer (get-buffer "*gnuplot*")) - (run-with-idle-timer 0.1 nil (lambda () (delete-file data-file)))))) + (bury-buffer (get-buffer "*gnuplot*"))))) (provide 'org-plot) -- 1.9.1