mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-09-12 07:39:58 +00:00
Merge branch 'master' into gnuplot
This commit is contained in:
commit
a7e504870e
|
@ -11,7 +11,6 @@
|
|||
#+srcname: R-plot(data=R-plot-example-data)
|
||||
#+begin_src R :session *R*
|
||||
plot(data)
|
||||
"R plot complete"
|
||||
#+end_src
|
||||
|
||||
#+tblname: R-plot-example-data
|
||||
|
@ -24,7 +23,7 @@ plot(data)
|
|||
#+lob: R-plot(data=R-plot-example-data)
|
||||
|
||||
#+resname: R-plot(data=R-plot-example-data)
|
||||
: R plot complete
|
||||
: nil
|
||||
|
||||
* Etc
|
||||
#+srcname: python-identity(a=1)
|
||||
|
|
|
@ -61,6 +61,14 @@ then run `org-babel-pop-to-session'."
|
|||
(defvar org-babel-inline-src-block-regexp nil
|
||||
"Regexp used to test when on an inline org-babel src-block")
|
||||
|
||||
(defvar org-babel-min-lines-for-block-output 10
|
||||
"If number of lines of output is equal to or exceeds this
|
||||
value, the output is placed in a
|
||||
#+begin_example...#+end_example block. Otherwise the output is
|
||||
marked as literal by inserting colons at the starts of the
|
||||
lines. This variable only takes effect if the :results output
|
||||
option is in effect.")
|
||||
|
||||
(defun org-babel-named-src-block-regexp-for-name (name)
|
||||
"Regexp used to match named src block."
|
||||
(concat "#\\+srcname:[ \t]*" (regexp-quote name) "[ \t\n]*"
|
||||
|
@ -168,11 +176,11 @@ the header arguments specified at the source code block."
|
|||
(setq result (multiple-value-bind (session vars result-params result-type) processed-params
|
||||
(funcall cmd body params)))
|
||||
(if (eq result-type 'value)
|
||||
(setq result (org-babel-process-result result result-params)))
|
||||
(setq result (org-babel-process-value-result result result-params)))
|
||||
(org-babel-insert-result result result-params)
|
||||
(case result-type (output nil) (value result))))
|
||||
|
||||
(defun org-babel-process-result (result result-params)
|
||||
(defun org-babel-process-value-result (result result-params)
|
||||
"Process returned value for insertion in buffer.
|
||||
|
||||
Currently, this function forces to table output if :results
|
||||
|
@ -443,11 +451,15 @@ relies on `org-babel-insert-result'."
|
|||
(save-excursion
|
||||
(if (org-at-table-p)
|
||||
(org-table-end)
|
||||
(while (if (looking-at "\\(: \\|\\[\\[\\)")
|
||||
(progn (while (looking-at "\\(: \\|\\[\\[\\)")
|
||||
(forward-line 1)) t))
|
||||
(forward-line 1))
|
||||
(forward-line -1)
|
||||
(let ((case-fold-search nil))
|
||||
(if (looking-at-p "#\\+begin_example")
|
||||
(search-forward "#+end_example" nil t)
|
||||
(progn
|
||||
(while (if (looking-at "\\(: \\|\\[\\[\\)")
|
||||
(progn (while (looking-at "\\(: \\|\\[\\[\\)")
|
||||
(forward-line 1)) t))
|
||||
(forward-line 1))
|
||||
(forward-line -1))))
|
||||
(point))))
|
||||
|
||||
(defun org-babel-result-to-file (result)
|
||||
|
@ -462,14 +474,21 @@ non-nil."
|
|||
(interactive "*r")
|
||||
(let ((size (abs (- (line-number-at-pos end)
|
||||
(line-number-at-pos beg)))))
|
||||
(if (= size 0)
|
||||
(let ((result (buffer-substring beg end)))
|
||||
(delete-region beg end)
|
||||
(insert (concat ": " result)))
|
||||
(save-excursion
|
||||
(goto-char beg)
|
||||
(dotimes (n size)
|
||||
(move-beginning-of-line 1) (insert ": ") (forward-line 1))))))
|
||||
(save-excursion
|
||||
(cond ((= size 0)
|
||||
(error "This should be impossible: a newline was appended to result if missing")
|
||||
(let ((result (buffer-substring beg end)))
|
||||
(delete-region beg end)
|
||||
(insert (concat ": " result))))
|
||||
((< size org-babel-min-lines-for-block-output)
|
||||
(goto-char beg)
|
||||
(dotimes (n size)
|
||||
(move-beginning-of-line 1) (insert ": ") (forward-line 1)))
|
||||
(t
|
||||
(goto-char beg)
|
||||
(insert "#+begin_example\n")
|
||||
(forward-char (- end beg))
|
||||
(insert "#+end_example\n"))))))
|
||||
|
||||
(defun org-babel-merge-params (&rest plists)
|
||||
"Combine all parameter association lists in PLISTS. Later
|
||||
|
|
|
@ -204,13 +204,13 @@ would then be [[#sandbox][the sandbox]].
|
|||
#+end_src
|
||||
|
||||
|
||||
* Tasks [31/51]
|
||||
* Tasks [32/51]
|
||||
** PROPOSED optional timestamp for output
|
||||
Add option to place an (inactive) timestamp at the #+resname, to
|
||||
record when that output was generated.
|
||||
|
||||
*** source code block timestamps (optional addition)
|
||||
If we did this would we then want to place a timestamp on the
|
||||
[Eric] If we did this would we then want to place a timestamp on the
|
||||
source-code block, so that we would know if the results are
|
||||
current or out of date? This would have the effect of caching the
|
||||
results of calculations and then only re-running if the
|
||||
|
@ -219,27 +219,17 @@ would then be [[#sandbox][the sandbox]].
|
|||
timestamps of any tables or source-code blocks referenced by the
|
||||
original source-code block.
|
||||
|
||||
[Dan] I do remember getting frustrated by Sweave always having to
|
||||
re-do everything, so this could be desirable, as long as it's easy
|
||||
to over-ride of course. I'm not sure it should be the default
|
||||
behaviour unless we are very confident that it works well.
|
||||
|
||||
**** maintaining source-code block timestamps
|
||||
It may make sense to add a hook to `org-edit-special' which could
|
||||
update the source-code blocks timestamp. If the user edits the
|
||||
contents of a source-code block directly I can think of no
|
||||
efficient way of maintaining the timestamp.
|
||||
|
||||
** TODO use example block for large amounts of stdout output?
|
||||
We're currently `examplizing' with : at the beginning of the line,
|
||||
but should larger amounts of output be in a
|
||||
\#+begin_example...\#+end_example block? What's the cutoff? > 1
|
||||
line? This would be nice as it would allow folding of lengthy
|
||||
output. Sometimes one will want to see stdout just to check
|
||||
everything looks OK, and then fold it away.
|
||||
|
||||
I'm addressing this in branch 'examplizing-output'.
|
||||
Yea, that makes sense. (either that or allow folding of large
|
||||
blocks escaped with =:=).
|
||||
|
||||
Proposed cutoff of 10 lines, we can save this value in a user
|
||||
customizable variable.
|
||||
|
||||
** TODO make tangle files read-only?
|
||||
With a file-local variable setting, yea that makes sense. Maybe
|
||||
the header should reference the related org-mode file.
|
||||
|
@ -888,6 +878,22 @@ $0
|
|||
[[file:snippets/org-mode/sb][sb -- snippet]]
|
||||
|
||||
waiting for guidance from those more familiar with yasnippets
|
||||
|
||||
** DONE use example block for large amounts of stdout output?
|
||||
We're currently `examplizing' with : at the beginning of the line,
|
||||
but should larger amounts of output be in a
|
||||
\#+begin_example...\#+end_example block? What's the cutoff? > 1
|
||||
line? This would be nice as it would allow folding of lengthy
|
||||
output. Sometimes one will want to see stdout just to check
|
||||
everything looks OK, and then fold it away.
|
||||
|
||||
I'm addressing this in branch 'examplizing-output'.
|
||||
Yea, that makes sense. (either that or allow folding of large
|
||||
blocks escaped with =:=).
|
||||
|
||||
Proposed cutoff of 10 lines, we can save this value in a user
|
||||
customizable variable.
|
||||
*** DONE add ability to remove such results
|
||||
** DONE exclusive =exports= params
|
||||
|
||||
#+srcname: implement-export-exclusivity
|
||||
|
@ -2074,7 +2080,15 @@ plot "data" using 1:2 with lines
|
|||
(see [[* file result types][file result types]])
|
||||
|
||||
|
||||
* Bugs [20/31]
|
||||
* Bugs [21/34]
|
||||
** TODO avoid stripping whitespace from output when :results output
|
||||
** TODO problem with newlines in output when :results value
|
||||
#+begin_src python :results value
|
||||
'\n'.join(map(str, range(4)))
|
||||
#+end_src
|
||||
|
||||
#+resname:
|
||||
: 0
|
||||
** TODO prompt characters appearing in output with R
|
||||
#+begin_src R :session *R* :results output
|
||||
x <- 6
|
||||
|
@ -2154,12 +2168,6 @@ the same for the other languages. [Dan]
|
|||
#+end_src
|
||||
** TODO use new merge function [[file:lisp/org-babel-ref.el::t%20nil%20org%20combine%20plists%20args%20nil][here]]?
|
||||
And at other occurrences of org-combine-plists?
|
||||
** TODO LoB: with output to buffer, not working in buffers other than library-of-babel.org
|
||||
I haven't fixed this yet. org-babel-ref-resolve-reference moves
|
||||
point around, inside a save-excursion. Somehow when it comes to
|
||||
inserting the results (after possible further recursive calls to
|
||||
org-babel-ref-resolve-reference), point hasn't gone back to the
|
||||
lob line.
|
||||
** TODO creeping blank lines
|
||||
There's still inappropriate addition of blank lines in some circumstances. E.g.
|
||||
|
||||
|
@ -2167,6 +2175,7 @@ the same for the other languages. [Dan]
|
|||
b=5
|
||||
#+end_src
|
||||
|
||||
|
||||
Compare the results of
|
||||
#+lob: python-add(a=5, b=17)
|
||||
|
||||
|
@ -2186,6 +2195,9 @@ b=5
|
|||
LoB removes the entire (#+resname and result) and starts from
|
||||
scratch, whereas #+begin_src only removes the result. I haven't
|
||||
worked out what the correct fix is yet.
|
||||
** TODO LoB is not populated on startup
|
||||
org-babel-library-of-babel is nil for me on startup. I have to
|
||||
evaluate the [[file:lisp/org-babel-lob.el::][org-babel-lob-ingest]] line manually.
|
||||
** DEFERRED weird escaped characters in shell prompt break shell evaluation
|
||||
E.g. this doesn't work. Should the shell sessions set a sane prompt
|
||||
when they start up? Or is it a question of altering
|
||||
|
@ -2214,6 +2226,28 @@ b=5
|
|||
the user's regular emacs init. I can't think of a way for us to
|
||||
set this automatically, and we are SOL without a regexp to match
|
||||
the prompt.
|
||||
** DONE LoB: with output to buffer, not working in buffers other than library-of-babel.org
|
||||
*** Initial report
|
||||
I haven't fixed this yet. org-babel-ref-resolve-reference moves
|
||||
point around, inside a save-excursion. Somehow when it comes to
|
||||
inserting the results (after possible further recursive calls to
|
||||
org-babel-ref-resolve-reference), point hasn't gone back to the
|
||||
lob line.
|
||||
|
||||
#+tblname: test-data
|
||||
| 1 | 1 |
|
||||
| 2 | .5 |
|
||||
| 3 | .333 |
|
||||
|
||||
#+lob: R-plot(data=test-data)
|
||||
|
||||
#+lob: python-add(a=2, b=9)
|
||||
|
||||
#+resname: python-add(a=2, b=9)
|
||||
: 11
|
||||
|
||||
*** Now
|
||||
I think this got fixed in the bugfixes before merging results into master.
|
||||
|
||||
** DONE cursor movement when evaluating source blocks
|
||||
E.g. the pie chart example. Despite the save-window-excursion in
|
||||
|
|
Loading…
Reference in a new issue