Selaa lähdekoodia

DONE global variable indicating default to vector output

Eric Schulte 16 vuotta sitten
vanhempi
commit
6206e23ffd
3 muutettua tiedostoa jossa 28 lisäystä ja 5 poistoa
  1. 1 1
      litorgy/litorgy-exp.el
  2. 7 3
      litorgy/litorgy.el
  3. 20 1
      rorg.org

+ 1 - 1
litorgy/litorgy-exp.el

@@ -56,7 +56,7 @@ none ----- do not display either code or results upon export"
 (defun litorgy-exp-inline-src-blocks (start end)
   "Process inline src blocks between START and END for export.
 See `litorgy-exp-src-blocks' for export options, currently the
-options and are taken from `litorgy-inline-header-args'."
+options and are taken from `litorgy-defualt-inline-header-args'."
   (interactive)
   (save-excursion
     (goto-char start)

+ 7 - 3
litorgy/litorgy.el

@@ -40,7 +40,10 @@ then run `litorgy-execute-src-block'."
 
 (add-hook 'org-ctrl-c-ctrl-c-hook 'litorgy-execute-src-block-maybe)
 
-(defvar litorgy-inline-header-args '((:results . "silent") (:exports . "results"))
+(defvar litorgy-default-header-args '()
+  "Default arguments to use when evaluating a source block.")
+
+(defvar litorgy-default-inline-header-args '((:results . "silent") (:exports . "results"))
   "Default arguments to use when evaluating an inline source block.")
 
 (defvar litorgy-src-block-regexp nil
@@ -172,12 +175,13 @@ of the following form.  (language body header-arguments-alist)"
 (defun litorgy-parse-src-block-match ()
   (list (litorgy-clean-text-properties (match-string 1))
         (litorgy-clean-text-properties (match-string 4))
-        (litorgy-parse-header-arguments (litorgy-clean-text-properties (or (match-string 3) "")))))
+        (org-combine-plists litorgy-default-header-args
+                            (litorgy-parse-header-arguments (litorgy-clean-text-properties (or (match-string 3) ""))))))
 
 (defun litorgy-parse-inline-src-block-match ()
   (list (litorgy-clean-text-properties (match-string 1))
         (litorgy-clean-text-properties (match-string 4))
-        (org-combine-plists litorgy-inline-header-args
+        (org-combine-plists litorgy-default-inline-header-args
                             (litorgy-parse-header-arguments (litorgy-clean-text-properties (or (match-string 3) ""))))))
 
 (defun litorgy-parse-header-arguments (arg-string)

+ 20 - 1
rorg.org

@@ -3,7 +3,7 @@
 #+SEQ_TODO:  TODO PROPOSED | DONE DEFERRED REJECTED
 #+STARTUP: oddeven
 
-* Tasks [17/26]
+* Tasks [18/27]
 
 ** TODO re-implement R evaluation using ess-command or ess-execute
    I don't have any complaints with the current R evaluation code or
@@ -224,6 +224,15 @@ mean(mean(vec))
     posterity. Same for a shell session either in a *shell* buffer, or
     pasted from another terminal emulator. And python of course.
 
+** DONE global variable indicating default to vector output
+how about an alist... =litorgy-default-header-args= this may already
+exist... just execute the following and all source blocks will default
+to vector output
+
+#+begin_src emacs-lisp 
+(setq litorgy-default-header-args '((:results . "vector")))
+#+end_src
+
 ** DONE name named results if source block is named
 currently this isn't happening although it should be
 
@@ -540,6 +549,16 @@ This could probably be added to [[file:litorgy/litorgy-script.el][litorgy-script
 
 * Bugs [9/12]
 
+** TODO non-orgtbl formatted lists
+for example
+
+#+srcname: this-doesn't-match-orgtbl
+#+begin_src emacs-lisp :results replace
+'((:results . "replace"))
+#+end_src
+
+#+resname: this-doesn't-match-orgtbl
+
 ** TODO collapsing consecutive newlines in string output
 
 #+srcname: multi-line-string-output