From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mario Frasca Subject: better interaction with gnuplot-mode Date: Sun, 02 Nov 2014 15:38:58 -0500 Message-ID: <54569662.20302@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="MXSt39oXJpcrce77LvJgbgHi5x9HWQvk6" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33111) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xl1vn-0006qw-BF for emacs-orgmode@gnu.org; Sun, 02 Nov 2014 15:39:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xl1vi-0000Ma-IG for emacs-orgmode@gnu.org; Sun, 02 Nov 2014 15:39:23 -0500 Received: from mail-qc0-x229.google.com ([2607:f8b0:400d:c01::229]:37306) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xl1vi-0000MQ-Bi for emacs-orgmode@gnu.org; Sun, 02 Nov 2014 15:39:18 -0500 Received: by mail-qc0-f169.google.com with SMTP id i17so8319991qcy.28 for ; Sun, 02 Nov 2014 12:39:17 -0800 (PST) Received: from [192.168.1.100] ([191.66.10.103]) by mx.google.com with ESMTPSA id h79sm15081295qgd.27.2014.11.02.12.39.10 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Nov 2014 12:39:17 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --MXSt39oXJpcrce77LvJgbgHi5x9HWQvk6 Content-Type: multipart/mixed; boundary="------------090205010404040008080905" This is a multi-part message in MIME format. --------------090205010404040008080905 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable a couple of weeks ago I decided I would use emacs for my spreadsheets. I first tried with `ses`, then I was pointed at the spreadsheet capabilities of org-mode. but I also needed to see a graph representation of the data. http://stackoverflow.com/questions/26614536/ tables in org-mode work really nice, but I wanted the resulting graph in an emacs buffer, and in svg format. so I first ask the developer of gnuplot-mode about it and we (well, actually _he_) came with a couple of small edits that permit this. https://github.com/bruceravel/gnuplot-mode/issues/20 during the process we found two spots in org-plot/gnuplot that we think are in need of editing. one is relative to the cleaning up of the temporary files. the other is relative to killing (or not) the gnuplot process. the patches are attached. the discussion is in the issue:20 of https://github.com/bruceravel/gnuplot-mode/ MF --------------090205010404040008080905 Content-Type: text/x-patch; name="0002-correct-the-callback-for-the-and-register-it-as-soon.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename*0="0002-correct-the-callback-for-the-and-register-it-as-soon.pa"; filename*1="tch" =46rom 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 soo= n 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 la= bels @@ -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*"))))) =20 (provide 'org-plot) =20 --=20 1.9.1 --------------090205010404040008080905 Content-Type: text/x-patch; name="0001-do-not-kill-the-gnuplot-process.-just-jump-to-end-of.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename*0="0001-do-not-kill-the-gnuplot-process.-just-jump-to-end-of.pa"; filename*1="tch" =46rom ebd2cd9b23138a39ad9ea4b517934c93757c2b4d Mon Sep 17 00:00:00 2001 From: Mario Frasca Date: Sun, 2 Nov 2014 08:50:47 -0500 Subject: [PATCH 1/2] do not kill the gnuplot process. just jump to end of= buffer and rely on command to do the resetting job. --- lisp/org-plot.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lisp/org-plot.el b/lisp/org-plot.el index 556b9ef..69d9250 100644 --- a/lisp/org-plot.el +++ b/lisp/org-plot.el @@ -281,8 +281,7 @@ line directly before or after the table." (delete-other-windows) (when (get-buffer "*gnuplot*") ;; reset *gnuplot* if it already runn= ing (with-current-buffer "*gnuplot*" - (goto-char (point-max)) - (gnuplot-delchar-or-maybe-eof nil))) + (goto-char (point-max)))) (org-plot/goto-nearest-table) ;; set default options (mapc --=20 1.9.1 --------------090205010404040008080905-- --MXSt39oXJpcrce77LvJgbgHi5x9HWQvk6 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlRWlmIACgkQh1CCYC//Am6hagCgu7gbkkJJTwuNX4Jy2/eqpbgS JwQAoKqkob1BGIpzfwcVkYeWCrMvTQBv =I04v -----END PGP SIGNATURE----- --MXSt39oXJpcrce77LvJgbgHi5x9HWQvk6--