summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Schulte <eric.schulte@gmx.com>2012-03-05 08:22:35 -0700
committerEric Schulte <eric.schulte@gmx.com>2012-03-05 08:22:35 -0700
commitefe039db93ec95899f06fb335f8309e4fa7d2a44 (patch)
tree4b68cfa8a7c52d75ee162968141c640c7c976007
parentaceddafc064b9a04a3d8efb3a0f43cc750606661 (diff)
downloadorg-mode-efe039db93ec95899f06fb335f8309e4fa7d2a44.tar.gz
fix two bugs related to calling tangle with a prefix argument
* lisp/ob-tangle.el (org-babel-tangle): Don't prompt for a file name if :tangle is specified. * lisp/ob.el (org-babel-expand-noweb-references): Widen buffer when expanding noweb references.
-rw-r--r--lisp/ob-tangle.el8
-rw-r--r--lisp/ob.el4
2 files changed, 8 insertions, 4 deletions
diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el
index f5dbb30..5ff00ba 100644
--- a/lisp/ob-tangle.el
+++ b/lisp/ob-tangle.el
@@ -185,9 +185,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)
diff --git a/lisp/ob.el b/lisp/ob.el
index 39f53ef..97878fb 100644
--- a/lisp/ob.el
+++ b/lisp/ob.el
@@ -2169,6 +2169,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
@@ -2228,7 +2230,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))