Browse Source

Merge branch 'master' of orgmode.org:org-mode

Carsten Dominik 14 years ago
parent
commit
e860e08e58
8 changed files with 60 additions and 35 deletions
  1. 13 5
      doc/org.texi
  2. 13 6
      lisp/ob-emacs-lisp.el
  3. 5 3
      lisp/ob-python.el
  4. 1 1
      lisp/org-agenda.el
  5. 17 14
      lisp/org-list.el
  6. 1 1
      lisp/org-table.el
  7. 1 1
      lisp/org-wl.el
  8. 9 4
      lisp/org.el

+ 13 - 5
doc/org.texi

@@ -12789,11 +12789,19 @@ future work.)
 
 
 @subsection Session
 @subsection Session
 @subsubsection @code{:results value}
 @subsubsection @code{:results value}
-The code is passed to the interpreter running as an interactive Emacs
+The code is passed to an interpreter running as an interactive Emacs inferior
-inferior process. The result returned is the result of the last evaluation
+process. Only languages which provide tools for interactive evaluation of
-performed by the interpreter. (This is obtained in a language-specific
+code have session support, so some language (e.g., C and ditaa) do not
-manner: the value of the variable @code{_} in Python and Ruby, and the value
+support the @code{:session} header argument, and in other languages (e.g.,
-of @code{.Last.value} in R).
+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}
 @subsubsection @code{:results output}
 The code is passed to the interpreter running as an interactive Emacs
 The code is passed to the interpreter running as an interactive Emacs

+ 13 - 6
lisp/ob-emacs-lisp.el

@@ -56,16 +56,23 @@
 (defun org-babel-execute:emacs-lisp (body params)
 (defun org-babel-execute:emacs-lisp (body params)
   "Execute a block of emacs-lisp code with Babel."
   "Execute a block of emacs-lisp code with Babel."
   (save-window-excursion
   (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"
      (eval (read (format (if (member "output"
 				     (cdr (assoc :result-params params)))
 				     (cdr (assoc :result-params params)))
 			     "(with-output-to-string %s)"
 			     "(with-output-to-string %s)"
 			   "(progn %s)")
 			   "(progn %s)")
-			 (org-babel-expand-body:emacs-lisp body params))))
+			 (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))))))
 
 
 (provide 'ob-emacs-lisp)
 (provide 'ob-emacs-lisp)
 
 

+ 5 - 3
lisp/ob-python.el

@@ -267,9 +267,11 @@ last statement in BODY, as elisp."
 	  (org-babel-comint-with-output
 	  (org-babel-comint-with-output
 	      (session org-babel-python-eoe-indicator t body)
 	      (session org-babel-python-eoe-indicator t body)
 	    (let ((comint-process-echoes nil))
 	    (let ((comint-process-echoes nil))
-	      (input-body body)
+	      (mapc
-	      (insert org-babel-python-eoe-indicator)
+	       (lambda (line)
-	      (comint-send-input))) 2) "\n"))
+		 (insert line) (comint-send-input nil t))
+	       (append (split-string body "[\n\r]") (list org-babel-python-eoe-indicator)))))
+	  2) "\n"))
        (value
        (value
 	(let ((tmp-file (org-babel-temp-file "python-")))
 	(let ((tmp-file (org-babel-temp-file "python-")))
 	  (org-babel-comint-with-output
 	  (org-babel-comint-with-output

+ 1 - 1
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
 Never set this variable globally using `setq', because then it
 will apply to all future agenda commands.  Instead, bind it with
 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
 command.  A good way to set it is through options in
 `org-agenda-custom-commands'.  For a more flexible (though
 `org-agenda-custom-commands'.  For a more flexible (though
 somewhat less efficient) way of determining what is included in
 somewhat less efficient) way of determining what is included in

+ 17 - 14
lisp/org-list.el

@@ -2176,17 +2176,19 @@ in subtree, ignoring drawers."
 (defun org-reset-checkbox-state-subtree ()
 (defun org-reset-checkbox-state-subtree ()
   "Reset all checkboxes in an entry subtree."
   "Reset all checkboxes in an entry subtree."
   (interactive "*")
   (interactive "*")
-  (save-restriction
+  (if (org-before-first-heading-p)
-    (save-excursion
+      (error "Not inside a tree")
-      (org-narrow-to-subtree)
+    (save-restriction
-      (org-show-subtree)
+      (save-excursion
-      (goto-char (point-min))
+	(org-narrow-to-subtree)
-      (let ((end (point-max)))
+	(org-show-subtree)
-	(while (< (point) end)
+	(goto-char (point-min))
-	  (when (org-at-item-checkbox-p)
+	(let ((end (point-max)))
-	    (replace-match "[ ]" t t nil 1))
+	  (while (< (point) end)
-	  (beginning-of-line 2))))
+	    (when (org-at-item-checkbox-p)
-    (org-update-checkbox-count-maybe)))
+	      (replace-match "[ ]" t t nil 1))
+	    (beginning-of-line 2)))
+	(org-update-checkbox-count-maybe 'all)))))
 
 
 (defun org-update-checkbox-count (&optional all)
 (defun org-update-checkbox-count (&optional all)
   "Update the checkbox statistics in the current section.
   "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.
 	       ;; next headline, and save them in STRUCTS-BAK.
 	       ((org-on-heading-p)
 	       ((org-on-heading-p)
 		(setq backup-end (save-excursion
 		(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)
 		(while (org-list-search-forward box-re backup-end 'move)
 		  (let* ((struct (org-list-struct))
 		  (let* ((struct (org-list-struct))
 			 (bottom (org-list-get-bottom-point 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-done
       'org-checkbox-statistics-todo)))
       '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."
   "Update checkbox statistics unless turned off by user."
   (when (cdr (assq 'checkbox org-list-automatic-rules))
   (when (cdr (assq 'checkbox org-list-automatic-rules))
-    (org-update-checkbox-count))
+    (org-update-checkbox-count all))
   (run-hooks 'org-checkbox-statistics-hook))
   (run-hooks 'org-checkbox-statistics-hook))
 
 
 (defvar org-last-indent-begin-marker (make-marker))
 (defvar org-last-indent-begin-marker (make-marker))

+ 1 - 1
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
 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
 any entry, also in a different file.  In this case, the first table
 in that entry will be referenced.
 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.
 \"@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
 The return value is either a single string for a single field, or a

+ 1 - 1
lisp/org-wl.el

@@ -119,7 +119,7 @@ googlegroups otherwise."
 (defun org-wl-folder-type (folder)
 (defun org-wl-folder-type (folder)
   "Return symbol that indicates the type of FOLDER.
   "Return symbol that indicates the type of FOLDER.
 FOLDER is the wanderlust folder name.  The first character of the
 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))
   (let* ((indicator (substring folder 0 1))
 	 (type (cdr (assoc indicator org-wl-folder-types))))
 	 (type (cdr (assoc indicator org-wl-folder-types))))
     ;; maybe access or file folder
     ;; maybe access or file folder

+ 9 - 4
lisp/org.el

@@ -5157,6 +5157,11 @@ will be prompted for."
   :group 'org-babel)
   :group 'org-babel)
 
 
 (defun org-fontify-meta-lines-and-blocks (limit)
 (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."
   "Fontify #+ lines and blocks, in the correct ways."
   (let ((case-fold-search t))
   (let ((case-fold-search t))
     (if (re-search-forward
     (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.
 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
 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
 which the visibility is still unchanged.  After RET is will also jump to
-the location selected in the indirect buffer and expose the
+the location selected in the indirect buffer and expose the headline 
-the headline hierarchy above."
+hierarchy above."
   (interactive "P")
   (interactive "P")
   (let* ((org-refile-targets `((nil . (:maxlevel . ,org-goto-max-level))))
   (let* ((org-refile-targets `((nil . (:maxlevel . ,org-goto-max-level))))
 	 (org-refile-use-outline-path t)
 	 (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
 Even though the matchers for math are configurable, this function assumes
 that \\begin, \\(, \\[, and $$ are always used.  Only the single dollar
 that \\begin, \\(, \\[, and $$ are always used.  Only the single dollar
 delimiters are skipped when they have been removed by customization.
 delimiters are skipped when they have been removed by customization.
-The return value is nil, or a cons cell with the delimiter and
+The return value is nil, or a cons cell with the delimiter and the 
-and the position of this delimiter.
+position of this delimiter.
 
 
 This function does a reasonably good job, but can locally be fooled by
 This function does a reasonably good job, but can locally be fooled by
 for example currency specifications.  For example it will assume being in
 for example currency specifications.  For example it will assume being in