0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-08-24 18:02:53 +00:00

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.
This commit is contained in:
Eric Schulte 2012-03-05 08:22:35 -07:00
parent aceddafc06
commit efe039db93
2 changed files with 8 additions and 4 deletions

View file

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

View file

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