From 15c94cda68575ccaea69fa0911abcd1f9c9a4545 Mon Sep 17 00:00:00 2001 From: ag91 Date: Mon, 11 Oct 2021 20:12:54 +0100 Subject: [PATCH] Fix tutorial https://github.com/ag91/moldable-emacs/issues/12 --- molds/contrib.el | 2 ++ molds/core.el | 3 ++- .../ListCurrentEmacsBuffersAndSizesInBarChart.org | 13 ++++++++----- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/molds/contrib.el b/molds/contrib.el index 6bdbd6e..6c32edb 100644 --- a/molds/contrib.el +++ b/molds/contrib.el @@ -58,6 +58,7 @@ following in your lein project.clj :key "CSVToBarChart" :given (:fn (and (executable-find "graph") + (me-require 'csv-mode) (eq major-mode 'csv-mode))) :then (:fn (let ((table nil) ;; TODO maybe I can use org-table-convert-region to produce a org table, also maybe another mold @@ -79,6 +80,7 @@ following in your lein project.clj (me-register-mold :key "CSVToLineChart" :given (:fn (and (executable-find "graph") + (me-require 'csv-mode) (eq major-mode 'csv-mode))) :then (:fn (let ((table nil) ;; TODO maybe I can use org-table-convert-region to produce a org table, also maybe another mold diff --git a/molds/core.el b/molds/core.el index 07ca280..fa10345 100644 --- a/molds/core.el +++ b/molds/core.el @@ -205,7 +205,7 @@ You can transform this to extract information with the Playground mold." (me-register-mold :key "CSVtoPlist" - :given (:fn (and (eq major-mode 'csv-mode))) + :given (:fn (and (me-require 'csv-mode) (eq major-mode 'csv-mode))) :then (:fn (save-excursion (goto-char (point-min)) @@ -598,6 +598,7 @@ It specializes for source code." :key "OrgTableToCSV" :given (:fn (and (eq major-mode 'org-mode) + (me-require 'csv-mode) (s-contains-p "org" (buffer-name) t) (s-contains-p "table" (buffer-name) t))) :then (:fn diff --git a/tutorials/ListCurrentEmacsBuffersAndSizesInBarChart.org b/tutorials/ListCurrentEmacsBuffersAndSizesInBarChart.org index 83c7a61..0eeef5e 100644 --- a/tutorials/ListCurrentEmacsBuffersAndSizesInBarChart.org +++ b/tutorials/ListCurrentEmacsBuffersAndSizesInBarChart.org @@ -9,8 +9,10 @@ :CREATED: [2021-10-04 Mon 21:41] :END: -You will only need =graph-cli= for the bar chart generation. This is -easy to install: =pip install graph-cli=. +You will need =csv-mode= (=M-x package-install csv-mode=) and +=graph-cli= for the bar chart generation. This is easy to install: +=pip install graph-cli=. Also make sure to have followed the setup in +the README: in particular =(me-setup-molds)= makes molds available. ** Aim :PROPERTIES: @@ -24,9 +26,10 @@ chart would be ideal. ** Let's do it :PROPERTIES: :CREATED: [2021-10-04 Mon 21:45] +:ID: 62190bd1-5cc5-43ba-a517-c445d454e5fc :END: -1) invoke M-x and type =me/mold= +1) invoke M-x and type =me-mold= This is the command that let you access the molds that can be useful in this context. 2) type "Playground" @@ -47,13 +50,13 @@ chart would be ideal. This creates a =plist= with the buffers name and its size. 5) move the cursor on the first open parenthesis -6) invoke M-x and type =me/mold= +6) invoke M-x and type =me-mold= 7) type "EvalSexp" and hit return You should see a buffer "EvalSexp" with a =plist= containing all your open buffers and sizes. 8) move at the beginning of the buffer (the useful shortcut is =M-<=) -9) invoke M-x and type =me/mold= +9) invoke M-x and type =me-mold= 10) type "PlistToBarChart" and hit return "PlistToBarChart" is a composition of many molds: you will find