From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joon Ro Subject: Re: Can one tangle only the current blocks under header ? Date: Sat, 30 Jul 2016 13:38:42 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_4e4e4a03-c6c5-4b2d-b46d-26a4c315978b_" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53840) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bTZ9v-0007lG-MR for emacs-orgmode@gnu.org; Sat, 30 Jul 2016 14:38:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bTZ9p-0005JL-LH for emacs-orgmode@gnu.org; Sat, 30 Jul 2016 14:38:50 -0400 Received: from col004-omc3s9.hotmail.com ([65.55.34.147]:56853) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bTZ9p-0005J3-CH for emacs-orgmode@gnu.org; Sat, 30 Jul 2016 14:38:45 -0400 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Xebar Saram , org mode --_4e4e4a03-c6c5-4b2d-b46d-26a4c315978b_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable =0A= =0A= =0A= can one tangle only the current blocks under header or can you only tangle= the whole file?the issue is again for dotfiles managed by org that these f= iles are not proper org babel languages and look like this: #+BEGIN_SRC conf :mkdirp yes :tangle ~/.config/mpv/mpv.confsoftvol-max=3D60= 0 #+END_SRC the manual (http://orgmode.org/manual/Extracting-source-code.html) only sho= ws how to tangle the whole file any ideas? If you read the help for org-babel-tangle: With one universal prefix argument=2C only tangle the block at point.When t= wo universal prefix arguments=2C only tangle blocks for thetangle file of t= he block at point. So if you do c-u first before org-babel-tangle=2C it will only tangle the c= ode block at point.I use this a lot so I have the following in my init file= : (defun org-babel-tangle-block() (interactive) (let ((current-prefix-arg '= (4))) (call-interactively 'org-babel-tangle))) (eval-after-load "org" '(progn (define-key org-mode-map (kbd "C-c b") = 'org-babel-tangle-block))) So I can just do C-c b and it will just tangle the code block at point. And I agree with you I with the manual (http://orgmode.org/manual/Extractin= g-source-code.html) has this information. Hope this helps=2CJoon =0A= = --_4e4e4a03-c6c5-4b2d-b46d-26a4c315978b_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
=0A= =0A= =0A=
can one tangle only the c= urrent blocks under header or  =3Bcan you only tangle the whole file?
the issue is again for dot= files managed by org that these files are not proper org babel languages an= d look like this:

#+BEGIN_SRC conf :mkdirp yes :tang= le ~/.config/mpv/mpv.conf
softvol-max=3D600  =3B
#+END_SRC
the manual (http://= orgmode.org/manual/Extracting-source-code.html) only shows how to tangl= e the whole file

any ideas?

If you read the help for org-bab= el-tangle:

With one universal prefix argument=2C only tangle t= he block at point.
When two universal prefix arguments=2C only tangle bl= ocks for the
tangle file of the block at point.
<= /div>

So if you do c-u first before =3Bo= rg-babel-tangle=2C it will only tangle the code block at point.
I use this a lot so I have the fol= lowing in my init file:

(defun org-babel-tangle-block()
 =3B (interactive)
<= /div>
&nb= sp=3B (let ((current-prefix-arg '(4)))
 =3B  =3B  =3B(call-i= nteractively 'org-babel-tangle)))=
<= div>
(eval-after-load "org"
 =3B '(progn
 =3B  =3B=  =3B(define-key org-mode-map (kbd "C-c b") 'org-babel-tangle-block)))

So I ca= n just do C-c b and it will just tangle the code block at point.

And I agree with you I with the manual (http://orgmode.org/manual/Extracting-sour= ce-code.html) has this information.<= /span>

<= span style=3D"font-size: 12pt=3B">Hope this helps=2C
Joon<= /div>

= =0A=
= --_4e4e4a03-c6c5-4b2d-b46d-26a4c315978b_--