forked from mirrors/org-mode
babel: don’t move point when tangling a single block
* lisp/ob-tangle.el: (org-babel-tangle): don’t move point when called with single prefix arg Previously, C-u C-x C-v C-t would move point to the head of the source block.
This commit is contained in:
parent
327aff7a14
commit
a94501a132
|
@ -180,12 +180,12 @@ used to limit the exported source code blocks by language."
|
||||||
(run-hooks 'org-babel-pre-tangle-hook)
|
(run-hooks 'org-babel-pre-tangle-hook)
|
||||||
;; Possibly Restrict the buffer to the current code block
|
;; Possibly Restrict the buffer to the current code block
|
||||||
(save-restriction
|
(save-restriction
|
||||||
|
(save-excursion
|
||||||
(when (equal arg '(4))
|
(when (equal arg '(4))
|
||||||
(let ((head (org-babel-where-is-src-block-head)))
|
(let ((head (org-babel-where-is-src-block-head)))
|
||||||
(if head
|
(if head
|
||||||
(goto-char head)
|
(goto-char head)
|
||||||
(user-error "Point is not in a source code block"))))
|
(user-error "Point is not in a source code block"))))
|
||||||
(save-excursion
|
|
||||||
(let ((block-counter 0)
|
(let ((block-counter 0)
|
||||||
(org-babel-default-header-args
|
(org-babel-default-header-args
|
||||||
(if target-file
|
(if target-file
|
||||||
|
|
Loading…
Reference in a new issue