[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Deactivate babel source block
From: |
Rainer M Krug |
Subject: |
Re: [O] Deactivate babel source block |
Date: |
Mon, 07 Oct 2013 10:31:44 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin) |
Eric Schulte <address@hidden> writes:
> You want to set the :eval and :tangle header arguments, this can be done
> with `org-babel-insert-header-arg' bound to "C-c C-v j". I've just
> updated this function so that it now takes two optional arguments
> specifying the header argument and value.
>
> So your function could now be something like the following.
>
> (defun my-org-babel-deactivate ()
> (interactive)
> (org-babel-insert-header-arg "eval" "never")
> (org-babel-insert-header-arg "tangle" "no"))
Correct me if I am wrong, but I seem to remember that source blocks
under a commented heading are not tangled?
But I just tried it now, and it doesn't seem to be the case anymore -
code blocks under commented header are still tangled - has this feature
been removed or was it never there?
Rainer
>
> Hope this helps,
>
> Michael Bach <address@hidden> writes:
>
>> Dear org-mode Users and Developers,
>>
>>
>> I am looking for a nice way to deactivate a babel source block with
>> point being anywhere on it. Imagine e.g. C-c C-v C-w to say "I want to
>> toggle execution/tangling for this block".
>>
>> Background: I have the .emacs setup in a literate org-mode file where I
>> am testing new emacs packages. Now many blocks represent specific
>> features that I want to be activated / deactivated. This should ideally
>> behave like the other source code functions (i.e. C-c C-v family).
>>
>> My naive approach as elisp noob was:
>> #+begin_src emacs-lisp
>> (defun my-org-babel-deactivate ()
>> (interactive)
>> (org-edit-special)
>> (mark-whole-buffer)
>> (comment-region)
>> (org-edit-src-exit))
>> #+end_src
>>
>> Apart from it not working (Wrong number of arguments), this would have
>> been a dirty one in any case. Now I thought there must be a better way
>> by setting/un-setting the respective header arguments in an automated
>> way. Is this already possible with org-mode version 8.2?
>>
>> Best Regards,
>> Michael
>>
>>
<#secure method=pgpmime mode=sign>
--
Rainer M. Krug
email: RMKrug<at>gmail<dot>com