diff options
author | Eric Schulte <eric.schulte@gmx.com> | 2012-03-05 08:22:35 -0700 |
---|---|---|
committer | Eric Schulte <eric.schulte@gmx.com> | 2012-03-05 08:22:35 -0700 |
commit | efe039db93ec95899f06fb335f8309e4fa7d2a44 (patch) | |
tree | 4b68cfa8a7c52d75ee162968141c640c7c976007 | |
parent | aceddafc064b9a04a3d8efb3a0f43cc750606661 (diff) | |
download | org-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.el | 8 | ||||
-rw-r--r-- | lisp/ob.el | 4 |
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) @@ -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)) |