Browse Source

Merge branch 'origin-maint'

Eric Schulte 13 years ago
parent
commit
f6ea7c581c
2 changed files with 8 additions and 4 deletions
  1. 5 3
      lisp/ob-tangle.el
  2. 3 1
      lisp/ob.el

+ 5 - 3
lisp/ob-tangle.el

@@ -192,9 +192,11 @@ exported source code blocks by language."
   (when only-this-block
     (unless (org-babel-where-is-src-block-head)
       (error "Point is not currently inside of a code block"))
-    (unless target-file
-      (setq target-file
-	    (read-from-minibuffer "Tangle to: " (buffer-file-name))))
+    (save-match-data
+      (unless (or (cdr (assoc :tangle (nth 2 (org-babel-get-src-block-info))))
+		  target-file)
+	(setq target-file
+	      (read-from-minibuffer "Tangle to: " (buffer-file-name)))))
     (narrow-to-region (match-beginning 0) (match-end 0)))
   (save-excursion
     (let ((block-counter 0)

+ 3 - 1
lisp/ob.el

@@ -2225,6 +2225,8 @@ block but are passed literally to the \"example-block\"."
           (setq index (point))
           (nb-add
 	   (with-current-buffer parent-buffer
+	     (save-restriction
+	       (widen)
 	     (mapconcat ;; interpose PREFIX between every line
 	      #'identity
 	      (split-string
@@ -2284,7 +2286,7 @@ block but are passed literally to the \"example-block\"."
 				   "could not be resolved (see "
 				   "`org-babel-noweb-error-langs')"))
 		    "")))
-	       "[\n\r]") (concat "\n" prefix)))))
+	       "[\n\r]") (concat "\n" prefix))))))
         (nb-add (buffer-substring index (point-max)))))
     new-body))