From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Banel Subject: Re: [PATCH] key-binding for all plotting styles Date: Sat, 11 Oct 2014 19:46:59 +0200 Message-ID: <54396D13.5070501@free.fr> References: <53C2ADB0.2010404@free.fr> <87oaw9wg3s.fsf@bzg.ath.cx> <53E7F088.8010401@free.fr> <87tx4zhcvs.fsf@nicolasgoaziou.fr> <53FCE574.3010307@free.fr> <87vbpfnghj.fsf@nicolasgoaziou.fr> <53FCFF47.4060805@free.fr> <87r402oqce.fsf@nicolasgoaziou.fr> <53FE4F09.5080408@free.fr> <871ts1h5qv.fsf@nicolasgoaziou.fr> <53FF951B.4030300@free.fr> <87lhq7wrhg.fsf@nicolasgoaziou.fr> <54063C4F.30704@free.fr> <877g1kd0oa.fsf@nicolasgoaziou.fr> <540B1BA5.2070800@free.fr> <87sik29is3.fsf@nicolasgoaziou.fr> <541479A9.3060305@free.fr> <87k34c2cfz.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------050502050902090304070300" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60392) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xd0l1-00059d-LC for emacs-orgmode@gnu.org; Sat, 11 Oct 2014 13:47:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xd0kv-0006hZ-EC for emacs-orgmode@gnu.org; Sat, 11 Oct 2014 13:47:07 -0400 Received: from smtp4-g21.free.fr ([212.27.42.4]:17044) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xd0kv-0006hF-53 for emacs-orgmode@gnu.org; Sat, 11 Oct 2014 13:47:01 -0400 Received: from [IPv6:2a01:e35:2e21:def0:d1e7:2c0:5cbf:dd55] (unknown [IPv6:2a01:e35:2e21:def0:d1e7:2c0:5cbf:dd55]) by smtp4-g21.free.fr (Postfix) with ESMTP id 62F594C8049 for ; Sat, 11 Oct 2014 19:45:59 +0200 (CEST) In-Reply-To: <87k34c2cfz.fsf@nicolasgoaziou.fr> 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 a multi-part message in MIME format. --------------050502050902090304070300 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Here is a patch which bindskeys: C-c " a orgtbl-ascii-plot(creates an ascii plot for the column where the cursor is) C-c " g org-plot/gnuplot (nicely launches Gnuplot for all columns) It also adds a sub-menu named "Plot" in the "Tbl" menu with those two entries. Have fun Thierry Le 07/10/2014 16:15, Nicolas Goaziou a =E9crit : > Hello, > > Thierry Banel writes: > >> C-c " (currently unused) >> C-c | (currently does weird things within a table) > I'm fine with any of these, even though they may be shadowed by minor > modes. > > > Regards, > --------------050502050902090304070300 Content-Type: text/x-diff; name="0001-Ascii-and-Gnuplot-key-bindings.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Ascii-and-Gnuplot-key-bindings.patch" >From 41b262ca69636938bc894bc4b24d8de968e67c68 Mon Sep 17 00:00:00 2001 From: Thierry Banel Date: Sat, 11 Oct 2014 15:59:17 +0200 Subject: [PATCH] Ascii and Gnuplot key-bindings * org.el (org-mode-map): change key-binding from C-c p to C-c " a add C-c " g key-binding for Gnuplot (org-tbl-menu): add sub-menu for plotting featuring Gnuplot and ascii plot * org-table.el (orgtbl-setup): add sub-menu for plotting featuring Gnuplot and ascii plot --- lisp/org-table.el | 10 ++++++---- lisp/org.el | 14 ++++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/lisp/org-table.el b/lisp/org-table.el index 7607ead..0f2fda3 100644 --- a/lisp/org-table.el +++ b/lisp/org-table.el @@ -4276,8 +4276,7 @@ to execute outside of tables." ["Move Column Left" org-metaleft :active (org-at-table-p) :keys "M-"] ["Move Column Right" org-metaright :active (org-at-table-p) :keys "M-"] ["Delete Column" org-shiftmetaleft :active (org-at-table-p) :keys "M-S-"] - ["Insert Column" org-shiftmetaright :active (org-at-table-p) :keys "M-S-"] - ["Ascii plot" orgtbl-ascii-plot :active (org-at-table-p) :keys "C-c p"]) + ["Insert Column" org-shiftmetaright :active (org-at-table-p) :keys "M-S-"]) ("Row" ["Move Row Up" org-metaup :active (org-at-table-p) :keys "M-"] ["Move Row Down" org-metadown :active (org-at-table-p) :keys "M-"] @@ -4315,7 +4314,10 @@ to execute outside of tables." org-table-toggle-coordinate-overlays :active (org-at-table-p) :keys "C-c }" :style toggle :selected org-table-overlay-coordinates] - )) + "--" + ("Plot" + ["Ascii plot" orgtbl-ascii-plot :active (org-at-table-p) :keys "C-c \" a"] + ["Gnuplot" org-plot/gnuplot :active (org-at-table-p) :keys "C-c \" g"]))) t)) (defun orgtbl-ctrl-c-ctrl-c (arg) @@ -5052,7 +5054,7 @@ supported. It is also possible to use the following ones: ;; Put the cursor in a column containing numerical values ;; of an Org-Mode table, -;; type C-c p +;; type C-c " a ;; A new column is added with a bar plot. ;; When the table is refreshed (C-u C-c *), ;; the plot is updated to reflect the new values. diff --git a/lisp/org.el b/lisp/org.el index a6d8d1b..724fa62 100755 --- a/lisp/org.el +++ b/lisp/org.el @@ -163,6 +163,8 @@ Stars are put in group 1 and the trimmed body in group 2.") (declare-function org-table-paste-rectangle "org-table" ()) (declare-function org-table-maybe-eval-formula "org-table" ()) (declare-function org-table-maybe-recalculate-line "org-table" ()) +(declare-function orgtbl-ascii-plot "org-table" (&optional ask)) +(declare-function org-plot/gnuplot "org-plot" (&optional params)) (declare-function org-element-at-point "org-element" ()) (declare-function org-element-cache-reset "org-element" (&optional all)) @@ -19478,7 +19480,8 @@ boundaries." (org-defkey org-mode-map "\C-c=" 'org-table-eval-formula) (org-defkey org-mode-map "\C-c'" 'org-edit-special) (org-defkey org-mode-map "\C-c`" 'org-table-edit-field) -(org-defkey org-mode-map "\C-cp" 'orgtbl-ascii-plot) +(org-defkey org-mode-map "\C-c\"a" 'orgtbl-ascii-plot) +(org-defkey org-mode-map "\C-c\"g" 'org-plot/gnuplot) (org-defkey org-mode-map "\C-c|" 'org-table-create-or-convert-from-region) (org-defkey org-mode-map [(control ?#)] 'org-table-rotate-recalc-marks) (org-defkey org-mode-map "\C-c~" 'org-table-create-with-table.el) @@ -21161,8 +21164,7 @@ on context. See the individual commands for more information." ["Move Column Left" org-metaleft (org-at-table-p)] ["Move Column Right" org-metaright (org-at-table-p)] ["Delete Column" org-shiftmetaleft (org-at-table-p)] - ["Insert Column" org-shiftmetaright (org-at-table-p)] - ["Ascii plot" orgtbl-ascii-plot (org-at-table-p)]) + ["Insert Column" org-shiftmetaright (org-at-table-p)]) ("Row" ["Move Row Up" org-metaup (org-at-table-p)] ["Move Row Down" org-metadown (org-at-table-p)] @@ -21205,7 +21207,11 @@ on context. See the individual commands for more information." ["Import from File" org-table-import (not (org-at-table-p))] ["Export to File" org-table-export (org-at-table-p)] "--" - ["Create/Convert from/to table.el" org-table-create-with-table.el t])) + ["Create/Convert from/to table.el" org-table-create-with-table.el t] + "--" + ("Plot" + ["Ascii plot" orgtbl-ascii-plot :active (org-at-table-p) :keys "C-c \" a"] + ["Gnuplot" org-plot/gnuplot :active (org-at-table-p) :keys "C-c \" g"]))) (easy-menu-define org-org-menu org-mode-map "Org menu" '("Org" -- 1.9.1 --------------050502050902090304070300--