summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <carsten.dominik@gmail.com>2011-06-21 20:07:08 +0200
committerCarsten Dominik <carsten.dominik@gmail.com>2011-06-21 20:07:08 +0200
commite860e08e5881392489ee928ffafdb65201855738 (patch)
treeb6bb4a7cc9e160cc6d1c10c74e5affd26983dc44
parent6413de8e916559cce5d9625174512827e3a36682 (diff)
parentd315f253d4e815eac1610fa16d444bb1178ec4fd (diff)
downloadorg-mode-e860e08e5881392489ee928ffafdb65201855738.tar.gz
Merge branch 'master' of orgmode.org:org-mode
-rw-r--r--doc/org.texi18
-rw-r--r--lisp/ob-emacs-lisp.el19
-rw-r--r--lisp/ob-python.el8
-rw-r--r--lisp/org-agenda.el2
-rw-r--r--lisp/org-list.el31
-rw-r--r--lisp/org-table.el2
-rw-r--r--lisp/org-wl.el2
-rw-r--r--lisp/org.el13
8 files changed, 60 insertions, 35 deletions
diff --git a/doc/org.texi b/doc/org.texi
index cfb5314..176475f 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -12789,11 +12789,19 @@ future work.)
@subsection Session
@subsubsection @code{:results value}
-The code is passed to the interpreter running as an interactive Emacs
-inferior process. The result returned is the result of the last evaluation
-performed by the interpreter. (This is obtained in a language-specific
-manner: the value of the variable @code{_} in Python and Ruby, and the value
-of @code{.Last.value} in R).
+The code is passed to an interpreter running as an interactive Emacs inferior
+process. Only languages which provide tools for interactive evaluation of
+code have session support, so some language (e.g., C and ditaa) do not
+support the @code{:session} header argument, and in other languages (e.g.,
+Python and Haskell) which have limitations on the code which may be entered
+into interactive sessions, those limitations apply to the code in code blocks
+using the @code{:session} header argument as well.
+
+Unless the @code{:results output} option is supplied (see below) the result
+returned is the result of the last evaluation performed by the
+interpreter. (This is obtained in a language-specific manner: the value of
+the variable @code{_} in Python and Ruby, and the value of @code{.Last.value}
+in R).
@subsubsection @code{:results output}
The code is passed to the interpreter running as an interactive Emacs
diff --git a/lisp/ob-emacs-lisp.el b/lisp/ob-emacs-lisp.el
index 9e7dc72..b8013c1 100644
--- a/lisp/ob-emacs-lisp.el
+++ b/lisp/ob-emacs-lisp.el
@@ -56,16 +56,23 @@
(defun org-babel-execute:emacs-lisp (body params)
"Execute a block of emacs-lisp code with Babel."
(save-window-excursion
- (org-babel-reassemble-table
+ ((lambda (result)
+ (if (or (member "scalar" (cdr (assoc :result-params params)))
+ (member "verbatim" (cdr (assoc :result-params params))))
+ (let ((print-level nil)
+ (print-length nil))
+ (format "%S" result))
+ (org-babel-reassemble-table
+ result
+ (org-babel-pick-name (cdr (assoc :colname-names params))
+ (cdr (assoc :colnames params)))
+ (org-babel-pick-name (cdr (assoc :rowname-names params))
+ (cdr (assoc :rownames params))))))
(eval (read (format (if (member "output"
(cdr (assoc :result-params params)))
"(with-output-to-string %s)"
"(progn %s)")
- (org-babel-expand-body:emacs-lisp body params))))
- (org-babel-pick-name (cdr (assoc :colname-names params))
- (cdr (assoc :colnames params)))
- (org-babel-pick-name (cdr (assoc :rowname-names params))
- (cdr (assoc :rownames params))))))
+ (org-babel-expand-body:emacs-lisp body params)))))))
(provide 'ob-emacs-lisp)
diff --git a/lisp/ob-python.el b/lisp/ob-python.el
index f3f4a03..6cb2c44 100644
--- a/lisp/ob-python.el
+++ b/lisp/ob-python.el
@@ -267,9 +267,11 @@ last statement in BODY, as elisp."
(org-babel-comint-with-output
(session org-babel-python-eoe-indicator t body)
(let ((comint-process-echoes nil))
- (input-body body)
- (insert org-babel-python-eoe-indicator)
- (comint-send-input))) 2) "\n"))
+ (mapc
+ (lambda (line)
+ (insert line) (comint-send-input nil t))
+ (append (split-string body "[\n\r]") (list org-babel-python-eoe-indicator)))))
+ 2) "\n"))
(value
(let ((tmp-file (org-babel-temp-file "python-")))
(org-babel-comint-with-output
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 3735edd..5f01848 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -3489,7 +3489,7 @@ By default, all four types are turned on.
Never set this variable globally using `setq', because then it
will apply to all future agenda commands. Instead, bind it with
-`let' to scope it dynamically into the the agenda-constructing
+`let' to scope it dynamically into the agenda-constructing
command. A good way to set it is through options in
`org-agenda-custom-commands'. For a more flexible (though
somewhat less efficient) way of determining what is included in
diff --git a/lisp/org-list.el b/lisp/org-list.el
index a8520fd..e7aba3e 100644
--- a/lisp/org-list.el
+++ b/lisp/org-list.el
@@ -2176,17 +2176,19 @@ in subtree, ignoring drawers."
(defun org-reset-checkbox-state-subtree ()
"Reset all checkboxes in an entry subtree."
(interactive "*")
- (save-restriction
- (save-excursion
- (org-narrow-to-subtree)
- (org-show-subtree)
- (goto-char (point-min))
- (let ((end (point-max)))
- (while (< (point) end)
- (when (org-at-item-checkbox-p)
- (replace-match "[ ]" t t nil 1))
- (beginning-of-line 2))))
- (org-update-checkbox-count-maybe)))
+ (if (org-before-first-heading-p)
+ (error "Not inside a tree")
+ (save-restriction
+ (save-excursion
+ (org-narrow-to-subtree)
+ (org-show-subtree)
+ (goto-char (point-min))
+ (let ((end (point-max)))
+ (while (< (point) end)
+ (when (org-at-item-checkbox-p)
+ (replace-match "[ ]" t t nil 1))
+ (beginning-of-line 2)))
+ (org-update-checkbox-count-maybe 'all)))))
(defun org-update-checkbox-count (&optional all)
"Update the checkbox statistics in the current section.
@@ -2272,7 +2274,8 @@ With optional prefix argument ALL, do this for the whole buffer."
;; next headline, and save them in STRUCTS-BAK.
((org-on-heading-p)
(setq backup-end (save-excursion
- (outline-next-heading) (point)))
+ (outline-next-heading) (point))
+ structs-bak nil)
(while (org-list-search-forward box-re backup-end 'move)
(let* ((struct (org-list-struct))
(bottom (org-list-get-bottom-point struct)))
@@ -2327,10 +2330,10 @@ Otherwise it will be `org-todo'."
'org-checkbox-statistics-done
'org-checkbox-statistics-todo)))
-(defun org-update-checkbox-count-maybe ()
+(defun org-update-checkbox-count-maybe (&optional all)
"Update checkbox statistics unless turned off by user."
(when (cdr (assq 'checkbox org-list-automatic-rules))
- (org-update-checkbox-count))
+ (org-update-checkbox-count all))
(run-hooks 'org-checkbox-statistics-hook))
(defvar org-last-indent-begin-marker (make-marker))
diff --git a/lisp/org-table.el b/lisp/org-table.el
index 155a972..a57295f 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -4580,7 +4580,7 @@ a \"#+TBLNAME:\" directive. The first table following this line
will then be used. Alternatively, it may be an ID referring to
any entry, also in a different file. In this case, the first table
in that entry will be referenced.
-FORM is a field or range descriptor like \"@2$3\" or or \"B3\" or
+FORM is a field or range descriptor like \"@2$3\" or \"B3\" or
\"@I$2..@II$2\". All the references must be absolute, not relative.
The return value is either a single string for a single field, or a
diff --git a/lisp/org-wl.el b/lisp/org-wl.el
index 3630b10..83cf01a 100644
--- a/lisp/org-wl.el
+++ b/lisp/org-wl.el
@@ -119,7 +119,7 @@ googlegroups otherwise."
(defun org-wl-folder-type (folder)
"Return symbol that indicates the type of FOLDER.
FOLDER is the wanderlust folder name. The first character of the
-folder name determines the the folder type."
+folder name determines the folder type."
(let* ((indicator (substring folder 0 1))
(type (cdr (assoc indicator org-wl-folder-types))))
;; maybe access or file folder
diff --git a/lisp/org.el b/lisp/org.el
index fee3174..b1edfa3 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5157,6 +5157,11 @@ will be prompted for."
:group 'org-babel)
(defun org-fontify-meta-lines-and-blocks (limit)
+ (condition-case nil
+ (org-fontify-meta-lines-and-blocks-1 limit)
+ (error (message "org-mode fontification error"))))
+
+(defun org-fontify-meta-lines-and-blocks-1 (limit)
"Fontify #+ lines and blocks, in the correct ways."
(let ((case-fold-search t))
(if (re-search-forward
@@ -6586,8 +6591,8 @@ in an indirect buffer, in overview mode. You can dive into the tree in
that copy, use org-occur and incremental search to find a location.
When pressing RET or `Q', the command returns to the original buffer in
which the visibility is still unchanged. After RET is will also jump to
-the location selected in the indirect buffer and expose the
-the headline hierarchy above."
+the location selected in the indirect buffer and expose the headline
+hierarchy above."
(interactive "P")
(let* ((org-refile-targets `((nil . (:maxlevel . ,org-goto-max-level))))
(org-refile-use-outline-path t)
@@ -16115,8 +16120,8 @@ sequence appearing also before point.
Even though the matchers for math are configurable, this function assumes
that \\begin, \\(, \\[, and $$ are always used. Only the single dollar
delimiters are skipped when they have been removed by customization.
-The return value is nil, or a cons cell with the delimiter and
-and the position of this delimiter.
+The return value is nil, or a cons cell with the delimiter and the
+position of this delimiter.
This function does a reasonably good job, but can locally be fooled by
for example currency specifications. For example it will assume being in