emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: James TD Smith <ahktenzero@mohorovi.cc>
To: emacs-orgmode@gnu.org
Subject: [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: Mon, 13 Jul 2009 09:28:02 +0100	[thread overview]
Message-ID: <1247473682-23338-6-git-send-email-ahktenzero@mohorovi.cc> (raw)
In-Reply-To: <1247473682-23338-5-git-send-email-ahktenzero@mohorovi.cc>

---
 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)
 
-- 
1.6.3.3

  reply	other threads:[~2009-07-13  9:12 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-13  8:27 Working on org again James TD Smith
2009-07-13  8:27 ` [misc-new-features 1/5] Add two new special properties, SINCE and SINCE_IA James TD Smith
2009-07-13  8:27   ` [misc-new-features 2/5] Bugfixes, documentation and custom options for org-checklist James TD Smith
2009-07-13  8:28     ` [misc-new-features 3/5] Add an option to sort tags automatically James TD Smith
2009-07-13  8:28       ` [misc-new-features 4/5] Allow org-insert-link to check the X clipboard and the Emacs kill-ring for links, as well as the stored links. This makes getting URLs into org from a browser much easier, as you don't have to paste the URL into the minibuffer to insert a link James TD Smith
2009-07-13  8:28         ` James TD Smith [this message]
2009-07-13 11:56           ` [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 Bernt Hansen
2009-07-14 11:57           ` Bastien
2009-07-17 17:03           ` Bastien
2009-07-13 11:55         ` [misc-new-features 4/5] Allow org-insert-link to check the X clipboard and the Emacs kill-ring for links, as well as the stored links. This makes getting URLs into org from a browser much easier, as you don't have to paste the URL into the minibuffer to insert a link Bernt Hansen
2009-07-13 12:13           ` [misc-new-features 4/5] extra long subject lines James TD Smith
2009-07-13 15:35             ` Bernt Hansen
2009-07-14 12:07         ` [misc-new-features 4/5] Allow org-insert-link to check the X clipboard and the Emacs kill-ring for links, as well as the stored links. This makes getting URLs into org from a browser much easier, as you don't have to paste the URL into the minibuffer to insert a link Bastien
2009-07-17 17:20         ` Bastien
2009-07-14 11:59       ` [misc-new-features 3/5] Add an option to sort tags automatically Bastien
2009-07-14 16:01         ` James TD Smith
2009-07-17 17:04           ` Bastien
2009-07-17 16:38       ` Bastien
2009-07-14 12:09     ` [misc-new-features 2/5] Bugfixes, documentation and custom options for org-checklist Bastien
2009-07-14  8:52       ` James TD Smith
2009-08-03 14:47     ` Carsten Dominik
2009-08-03 21:17       ` James TD Smith
2009-07-14 11:48   ` [misc-new-features 1/5] Add two new special properties, SINCE and SINCE_IA Bastien
2009-07-14 17:44     ` James TD Smith
2009-07-17 16:55   ` Bastien
2009-07-17 18:22     ` James TD Smith
2009-07-18  9:35       ` Bastien
2009-08-27 15:50         ` Manish
2009-08-28 17:59           ` James TD Smith

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1247473682-23338-6-git-send-email-ahktenzero@mohorovi.cc \
    --to=ahktenzero@mohorovi.cc \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).