From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: [misc-new-features 5/5] Fix a problem I was having with plots using a script. Org-plot was deleting the data file before gnuplot read it in. I've moved the deletion of the temporary data file to an idle timer, which has fixed the problem. Date: Tue, 14 Jul 2009 13:57:49 +0200 Message-ID: <87iqhvv52q.fsf@bzg.ath.cx> References: <1247473682-23338-1-git-send-email-ahktenzero@mohorovi.cc> <1247473682-23338-2-git-send-email-ahktenzero@mohorovi.cc> <1247473682-23338-3-git-send-email-ahktenzero@mohorovi.cc> <1247473682-23338-4-git-send-email-ahktenzero@mohorovi.cc> <1247473682-23338-5-git-send-email-ahktenzero@mohorovi.cc> <1247473682-23338-6-git-send-email-ahktenzero@mohorovi.cc> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MQbDN-0008SA-OO for emacs-orgmode@gnu.org; Tue, 14 Jul 2009 02:10:09 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MQbDJ-0008RJ-Sa for emacs-orgmode@gnu.org; Tue, 14 Jul 2009 02:10:09 -0400 Received: from [199.232.76.173] (port=38387 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MQbDJ-0008RC-MA for emacs-orgmode@gnu.org; Tue, 14 Jul 2009 02:10:05 -0400 Received: from rv-out-0708.google.com ([209.85.198.243]:49648) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MQbDJ-000840-9m for emacs-orgmode@gnu.org; Tue, 14 Jul 2009 02:10:05 -0400 Received: by rv-out-0708.google.com with SMTP id f25so1208108rvb.6 for ; Mon, 13 Jul 2009 23:10:04 -0700 (PDT) In-Reply-To: <1247473682-23338-6-git-send-email-ahktenzero@mohorovi.cc> (James TD Smith's message of "Mon, 13 Jul 2009 09:28:02 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: schulte eric , James TD Smith Cc: emacs-orgmode@gnu.org Thanks. Eric, does it look good to you? James TD Smith writes: > --- > lisp/org-plot.el | 14 +++++++------- > 1 files changed, 7 insertions(+), 7 deletions(-) > > diff --git a/lisp/org-plot.el b/lisp/org-plot.el > index 0e8f5a2..c9d61b3 100644 > --- a/lisp/org-plot.el > +++ b/lisp/org-plot.el > @@ -333,12 +333,12 @@ line directly before or after the table." > (with-temp-buffer > (if (plist-get params :script) ;; user script > (progn (insert > - (org-plot/gnuplot-script data-file num-cols params t)) > - (insert "\n") > - (insert-file-contents (plist-get params :script)) > - (goto-char (point-min)) > - (while (re-search-forward "$datafile" nil t) > - (replace-match data-file nil nil))) > + (org-plot/gnuplot-script data-file num-cols params t)) > + (insert "\n") > + (insert-file-contents (plist-get params :script)) > + (goto-char (point-min)) > + (while (re-search-forward "$datafile" nil t) > + (replace-match data-file nil nil))) > (insert > (org-plot/gnuplot-script data-file num-cols params))) > ;; graph table > @@ -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) -- Bastien