From mboxrd@z Thu Jan 1 00:00:00 1970 From: Grant Rettke Subject: Re: Can one tangle only the current blocks under header ? Date: Sun, 31 Jul 2016 09:34:07 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58728) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bTroh-0001I4-Ll for emacs-orgmode@gnu.org; Sun, 31 Jul 2016 10:34:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bTrof-0002QW-Hg for emacs-orgmode@gnu.org; Sun, 31 Jul 2016 10:34:10 -0400 Received: from mail-io0-x22a.google.com ([2607:f8b0:4001:c06::22a]:35623) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bTrof-0002Q2-Ci for emacs-orgmode@gnu.org; Sun, 31 Jul 2016 10:34:09 -0400 Received: by mail-io0-x22a.google.com with SMTP id m101so166700367ioi.2 for ; Sun, 31 Jul 2016 07:34:09 -0700 (PDT) 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: Joon Ro Cc: Xebar Saram , org mode You can `:tangle no' on the source block to exclude it from tangling. You can even tangle one source block to a different or as many files as you like during tangling. Sincerely, Grant Rettke On Sat, Jul 30, 2016 at 1:38 PM, Joon Ro wrote: > 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 files are not > proper org babel languages and look like this: > > #+BEGIN_SRC conf :mkdirp yes :tangle ~/.config/mpv/mpv.conf > softvol-max=600 > #+END_SRC > > the manual (http://orgmode.org/manual/Extracting-source-code.html) only > shows how to tangle the whole file > > any ideas? > > > If you read the help for org-babel-tangle: > > With one universal prefix argument, only tangle the block at point. > When two universal prefix arguments, only tangle blocks for the > tangle file of the block at point. > > > So if you do c-u first before org-babel-tangle, it will only tangle the code > 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/Extracting-source-code.html) has this > information. > > Hope this helps, > Joon >