found some issues, and started addressing them
This commit is contained in:
parent
51a628bc5e
commit
48752e7d79
|
@ -0,0 +1,40 @@
|
||||||
|
#+TITLE: Examples of Litorgy in Action
|
||||||
|
#+OPTIONS: toc:nil num:nil ^:nil
|
||||||
|
|
||||||
|
* showing directory sizes
|
||||||
|
|
||||||
|
This will work for Linux and Mac users, and could be interesting
|
||||||
|
especially if combined with a nice R graph.
|
||||||
|
|
||||||
|
To run place the cursor on the =#+begin_src= line of the source block
|
||||||
|
labeled directory-pie and press =\C-c\C-c=.
|
||||||
|
|
||||||
|
Downsides
|
||||||
|
- will take a while to run, especially for users with large home directories
|
||||||
|
- Had to employ some emacs-lisp between the shell and R to clean up
|
||||||
|
the data. (actually those " marks should not have been introduced
|
||||||
|
in the shell output, so this could be simplified somewhat)
|
||||||
|
|
||||||
|
#+srcname: directories
|
||||||
|
#+begin_src bash :results :replace
|
||||||
|
du -sc *
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
#+srcname: cleaner
|
||||||
|
#+begin_src emacs-lisp :var table=directories
|
||||||
|
(delq nil (mapcar (lambda (el)
|
||||||
|
(let ((size (car el))
|
||||||
|
(name (cadr el)))
|
||||||
|
(setq name (if (string-match "\"\\(.+\\)\"" name)
|
||||||
|
(match-string 1 name)
|
||||||
|
name))
|
||||||
|
(unless (or (= size 0)
|
||||||
|
(string= name "total"))
|
||||||
|
(list size name))))
|
||||||
|
table))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
#+srcname: directory-pie
|
||||||
|
#+begin_src R :var dirs = cleaner
|
||||||
|
pie(as.vector(t(dirs[1])), labels = as.vector(t(dirs[2])))
|
||||||
|
#+end_src
|
|
@ -208,7 +208,7 @@ silent -- no results are inserted"
|
||||||
(if (stringp result) ;; assume the result is a table if it's not a string
|
(if (stringp result) ;; assume the result is a table if it's not a string
|
||||||
(litorgy-examplize-region (point) (progn (insert result) (point)))
|
(litorgy-examplize-region (point) (progn (insert result) (point)))
|
||||||
(progn
|
(progn
|
||||||
(insert
|
(insert ;; TODO ensure that string aren't over-quoted
|
||||||
(concat (orgtbl-to-orgtbl
|
(concat (orgtbl-to-orgtbl
|
||||||
(if (consp (car result)) result (list result))
|
(if (consp (car result)) result (list result))
|
||||||
'(:fmt (lambda (cell) (format "%S" cell)))) "\n"))
|
'(:fmt (lambda (cell) (format "%S" cell)))) "\n"))
|
||||||
|
|
36
rorg.org
36
rorg.org
|
@ -312,7 +312,41 @@ This is currently working only with emacs lisp as in the following
|
||||||
example in the [[* emacs lisp source reference][emacs lisp source reference]].
|
example in the [[* emacs lisp source reference][emacs lisp source reference]].
|
||||||
|
|
||||||
|
|
||||||
* Bugs [2/2]
|
* Bugs [2/4]
|
||||||
|
** TODO space trailing language name
|
||||||
|
fix regexp so it works when there's a space trailing the language name
|
||||||
|
|
||||||
|
** TODO extra quotes for nested string
|
||||||
|
when string are 2 deep in org-mode tables their quotes aren't being
|
||||||
|
stripped
|
||||||
|
|
||||||
|
these should not be quoted
|
||||||
|
#+srcname: ls
|
||||||
|
#+begin_src sh :results replace
|
||||||
|
ls
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
| "COPYING" |
|
||||||
|
| "README.markdown" |
|
||||||
|
| "block" |
|
||||||
|
| "examples.org" |
|
||||||
|
| "existing_tools" |
|
||||||
|
| "intro.org" |
|
||||||
|
| "litorgy" |
|
||||||
|
| "rorg.org" |
|
||||||
|
| "test-export.html" |
|
||||||
|
| "test-export.org" |
|
||||||
|
|
||||||
|
#+srcname: none
|
||||||
|
#+begin_src emacs-lisp :var ls = ls :results silent
|
||||||
|
(message (format "ls=%S" ls))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
#+srcname: ruby-quote-test
|
||||||
|
#+begin_src ruby
|
||||||
|
puts %w(eric michael schulte)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
** RESOLVED Args out of range error
|
** RESOLVED Args out of range error
|
||||||
|
|
||||||
The following block resulted in the error below [DED]. It ran without
|
The following block resulted in the error below [DED]. It ran without
|
||||||
|
|
Loading…
Reference in New Issue