Browse Source

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

Bastien Guerry 11 years ago
parent
commit
27533656d7
5 changed files with 48 additions and 30 deletions
  1. 5 0
      lisp/ob-C.el
  2. 6 0
      lisp/ob-eval.el
  3. 30 28
      lisp/org-element.el
  4. 1 1
      lisp/ox-icalendar.el
  5. 6 1
      testing/lisp/test-org-element.el

+ 5 - 0
lisp/ob-C.el

@@ -82,6 +82,11 @@ is currently being evaluated.")
 This function calls `org-babel-execute:C++'."
   (org-babel-execute:C++ body params))
 
+(defun org-babel-expand-body:cpp (body params)
+  "Expand a block of C++ code with org-babel according to it's
+header arguments."
+  (org-babel-expand-body:C++ body params))
+
 (defun org-babel-execute:C++ (body params)
   "Execute a block of C++ code with org-babel.
 This function is called by `org-babel-execute-src-block'."

+ 6 - 0
lisp/ob-eval.el

@@ -57,6 +57,12 @@ STDERR with `org-babel-eval-error-notify'."
 	  (progn
 	    (with-current-buffer err-buff
 	      (org-babel-eval-error-notify exit-code (buffer-string)))
+	    (save-excursion
+	      (when (get-buffer org-babel-error-buffer-name)
+		(with-current-buffer org-babel-error-buffer-name
+		  (compilation-mode)
+		  ;;compilation-mode enforces read-only
+		  (read-only-mode 0))))
 	    nil)
 	(buffer-string)))))
 

+ 30 - 28
lisp/org-element.el

@@ -933,36 +933,38 @@ CONTENTS is the contents of the element."
 					 (org-element-property :tags headline))
 				 (org-element-property :tags headline))))
 		 (and tag-list
-		      (format ":%s:" (mapconcat 'identity tag-list ":")))))
+		      (format ":%s:" (mapconcat #'identity tag-list ":")))))
 	 (commentedp (org-element-property :commentedp headline))
 	 (pre-blank (or (org-element-property :pre-blank headline) 0))
-	 (heading (concat (make-string (org-reduced-level level) ?*)
-			  (and todo (concat " " todo))
-			  (and commentedp (concat " " org-comment-string))
-			  (and priority
-			       (format " [#%s]" (char-to-string priority)))
-			  (cond ((and org-footnote-section
-				      (org-element-property
-				       :footnote-section-p headline))
-				 (concat " " org-footnote-section))
-				(title (concat " " title))))))
-    (concat heading
-	    ;; Align tags.
-	    (when tags
-	      (cond
-	       ((zerop org-tags-column) (format " %s" tags))
-	       ((< org-tags-column 0)
-		(concat
-		 (make-string
-		  (max (- (+ org-tags-column (length heading) (length tags))) 1)
-		  ? )
-		 tags))
-	       (t
-		(concat
-		 (make-string (max (- org-tags-column (length heading)) 1) ? )
-		 tags))))
-	    (make-string (1+ pre-blank) 10)
-	    contents)))
+	 (heading
+	  (concat (make-string (if org-odd-levels-only (1- (* level 2)) level)
+			       ?*)
+		  (and todo (concat " " todo))
+		  (and commentedp (concat " " org-comment-string))
+		  (and priority (format " [#%s]" (char-to-string priority)))
+		  " "
+		  (if (and org-footnote-section
+			   (org-element-property :footnote-section-p headline))
+		      org-footnote-section
+		    title))))
+    (concat
+     heading
+     ;; Align tags.
+     (when tags
+       (cond
+	((zerop org-tags-column) (format " %s" tags))
+	((< org-tags-column 0)
+	 (concat
+	  (make-string
+	   (max (- (+ org-tags-column (length heading) (length tags))) 1)
+	   ?\s)
+	  tags))
+	(t
+	 (concat
+	  (make-string (max (- org-tags-column (length heading)) 1) ?\s)
+	  tags))))
+     (make-string (1+ pre-blank) ?\n)
+     contents)))
 
 
 ;;;; Inlinetask

+ 1 - 1
lisp/ox-icalendar.el

@@ -903,7 +903,7 @@ This function assumes major mode for current buffer is
 			    (buffer-substring
 			     (point) (progn (outline-next-heading) (point)))))))))
 		   (forward-line)))))
-	   'icalendar file)))
+	   'icalendar t '(:ascii-charset utf-8 :ascii-links-to-notes nil))))
     (with-temp-file file
       (insert
        (org-icalendar--vcalendar

+ 6 - 1
testing/lisp/test-org-element.el

@@ -2260,7 +2260,12 @@ Outside list"
   (should
    (equal (org-test-parse-and-interpret
 	   "* Headline\n\n\nText after two blank lines.")
-	  "* Headline\n\n\nText after two blank lines.\n")))
+	  "* Headline\n\n\nText after two blank lines.\n"))
+  ;; 8. Preserve `org-odd-levels-only' state.
+  (should
+   (equal "* H\n*** H2\n"
+	  (let ((org-odd-levels-only t))
+	    (org-test-parse-and-interpret "* H\n*** H2")))))
 
 (ert-deftest test-org-element/inlinetask-interpreter ()
   "Test inlinetask interpretation."